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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RestorePasswordVerifyResult = exports.RestorePasswordResult = exports.RegisterVerifyResult = exports.RegisterResult = exports.LoginResult = void 0;
3
+ exports.GoogleAuthResult = exports.TelegramAuthResult = exports.OAuthAuthResult = exports.CheckLoginResult = exports.RestorePasswordVerifyResult = exports.RestorePasswordResult = exports.RegisterVerifyResult = exports.RegisterResult = exports.LoginResult = void 0;
4
4
  var LoginResult;
5
5
  (function (LoginResult) {
6
6
  LoginResult[LoginResult["InvalidLogin"] = 2] = "InvalidLogin";
@@ -45,3 +45,47 @@ var RestorePasswordVerifyResult;
45
45
  RestorePasswordVerifyResult[RestorePasswordVerifyResult["CodeExpired"] = 5] = "CodeExpired";
46
46
  RestorePasswordVerifyResult[RestorePasswordVerifyResult["InvalidHash"] = 6] = "InvalidHash";
47
47
  })(RestorePasswordVerifyResult || (exports.RestorePasswordVerifyResult = RestorePasswordVerifyResult = {}));
48
+ var CheckLoginResult;
49
+ (function (CheckLoginResult) {
50
+ CheckLoginResult[CheckLoginResult["InvalidLogin"] = 2] = "InvalidLogin";
51
+ })(CheckLoginResult || (exports.CheckLoginResult = CheckLoginResult = {}));
52
+ /** Общие коды OAuth: VK / Telegram / Yandex (beta 21) */
53
+ var OAuthAuthResult;
54
+ (function (OAuthAuthResult) {
55
+ OAuthAuthResult[OAuthAuthResult["InvalidRequest"] = 2] = "InvalidRequest";
56
+ OAuthAuthResult[OAuthAuthResult["NotRegistered"] = 3] = "NotRegistered";
57
+ OAuthAuthResult[OAuthAuthResult["InvalidLogin"] = 4] = "InvalidLogin";
58
+ OAuthAuthResult[OAuthAuthResult["InvalidEmail"] = 5] = "InvalidEmail";
59
+ OAuthAuthResult[OAuthAuthResult["LoginAlreadyTaken"] = 6] = "LoginAlreadyTaken";
60
+ OAuthAuthResult[OAuthAuthResult["EmailAlreadyTaken"] = 7] = "EmailAlreadyTaken";
61
+ OAuthAuthResult[OAuthAuthResult["CodeAlreadySend"] = 8] = "CodeAlreadySend";
62
+ OAuthAuthResult[OAuthAuthResult["EmailServiceDisallowed"] = 9] = "EmailServiceDisallowed";
63
+ OAuthAuthResult[OAuthAuthResult["TooManyRegistrations"] = 10] = "TooManyRegistrations";
64
+ })(OAuthAuthResult || (exports.OAuthAuthResult = OAuthAuthResult = {}));
65
+ /** @deprecated используйте {@link OAuthAuthResult} */
66
+ var TelegramAuthResult;
67
+ (function (TelegramAuthResult) {
68
+ TelegramAuthResult[TelegramAuthResult["InvalidRequest"] = 2] = "InvalidRequest";
69
+ TelegramAuthResult[TelegramAuthResult["NotRegistered"] = 3] = "NotRegistered";
70
+ TelegramAuthResult[TelegramAuthResult["InvalidLogin"] = 4] = "InvalidLogin";
71
+ TelegramAuthResult[TelegramAuthResult["InvalidEmail"] = 5] = "InvalidEmail";
72
+ TelegramAuthResult[TelegramAuthResult["LoginAlreadyTaken"] = 6] = "LoginAlreadyTaken";
73
+ TelegramAuthResult[TelegramAuthResult["EmailAlreadyTaken"] = 7] = "EmailAlreadyTaken";
74
+ TelegramAuthResult[TelegramAuthResult["CodeAlreadySend"] = 8] = "CodeAlreadySend";
75
+ TelegramAuthResult[TelegramAuthResult["EmailServiceDisallowed"] = 9] = "EmailServiceDisallowed";
76
+ TelegramAuthResult[TelegramAuthResult["TooManyRegistrations"] = 10] = "TooManyRegistrations";
77
+ })(TelegramAuthResult || (exports.TelegramAuthResult = TelegramAuthResult = {}));
78
+ /** Коды Google OAuth (отличаются от VK/TG/Yandex) */
79
+ var GoogleAuthResult;
80
+ (function (GoogleAuthResult) {
81
+ GoogleAuthResult[GoogleAuthResult["InvalidRequest"] = 2] = "InvalidRequest";
82
+ GoogleAuthResult[GoogleAuthResult["NotRegistered"] = 3] = "NotRegistered";
83
+ GoogleAuthResult[GoogleAuthResult["InvalidLogin"] = 4] = "InvalidLogin";
84
+ GoogleAuthResult[GoogleAuthResult["InvalidEmail"] = 5] = "InvalidEmail";
85
+ GoogleAuthResult[GoogleAuthResult["LoginAlreadyTaken"] = 6] = "LoginAlreadyTaken";
86
+ GoogleAuthResult[GoogleAuthResult["EmailAlreadyTaken"] = 7] = "EmailAlreadyTaken";
87
+ GoogleAuthResult[GoogleAuthResult["EmailChanged"] = 8] = "EmailChanged";
88
+ GoogleAuthResult[GoogleAuthResult["EmailChangedAndCodeAlreadySend"] = 9] = "EmailChangedAndCodeAlreadySend";
89
+ GoogleAuthResult[GoogleAuthResult["EmailServiceDisallowed"] = 10] = "EmailServiceDisallowed";
90
+ GoogleAuthResult[GoogleAuthResult["TooManyRegistrations"] = 11] = "TooManyRegistrations";
91
+ })(GoogleAuthResult || (exports.GoogleAuthResult = GoogleAuthResult = {}));
@@ -342,6 +342,25 @@ export interface IChannelCompact {
342
342
  permission?: number;
343
343
  title?: string;
344
344
  }
345
+ /** GET channel/editor/available/all */
346
+ export interface IEditorChannel {
347
+ id: number;
348
+ title: string;
349
+ avatar?: string | null;
350
+ subscriber_count: number;
351
+ is_blog: boolean;
352
+ }
353
+ export interface IEditorChannelsResponse extends IResponse {
354
+ channels: IEditorChannel[];
355
+ }
356
+ /** GET type/{typeId}/channel */
357
+ export interface ITypeChannelResponse extends IResponse {
358
+ channel?: IChannel | null;
359
+ articles: IArticle[];
360
+ is_hidden_by_user: boolean;
361
+ are_widgets_hidden_globally: boolean;
362
+ is_widget_eligible: boolean;
363
+ }
345
364
  export interface IArticleCommentCompact {
346
365
  article?: IArticle;
347
366
  embeddable_description?: string;
@@ -1,5 +1,6 @@
1
1
  import { IResponse } from "./response";
2
- export declare const DEFAULT_VERSION_CODE = 25082901;
2
+ /** Anixart 9.0 BETA 21 */
3
+ export declare const DEFAULT_VERSION_CODE = 26080522;
3
4
  export interface IConfigRequest {
4
5
  versionCode?: number;
5
6
  beta?: boolean;
@@ -10,6 +11,11 @@ export interface IConfigUrlsResponse extends IResponse {
10
11
  editor_url?: string;
11
12
  static_domain?: string;
12
13
  should_use_mirror_urls: boolean;
14
+ google_auth_available?: boolean;
15
+ telegram_auth_available?: boolean;
16
+ vk_auth_available?: boolean;
17
+ yandex_auth_available?: boolean;
18
+ consent_required?: boolean;
13
19
  }
14
20
  export interface ITogglesResponse extends IResponse {
15
21
  minVersionCode?: number;
@@ -34,8 +40,16 @@ export interface ITogglesResponse extends IResponse {
34
40
  googleAuthAvailable?: boolean;
35
41
  vkAuthAvailable?: boolean;
36
42
  telegramAuthAvailable?: boolean;
43
+ yandexAuthAvailable?: boolean;
44
+ consentRequired?: boolean;
37
45
  [key: string]: unknown;
38
46
  }
39
47
  export interface ILatestArticleResponse extends IResponse {
40
48
  article_id?: number | null;
41
49
  }
50
+ /** GET config/anixplayer */
51
+ export interface IAnixPlayerConfigResponse extends IResponse {
52
+ last_version_code: number;
53
+ whats_new: string;
54
+ download_links: Record<string, string>;
55
+ }
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_VERSION_CODE = void 0;
4
- exports.DEFAULT_VERSION_CODE = 25082901;
4
+ /** Anixart 9.0 BETA 21 */
5
+ exports.DEFAULT_VERSION_CODE = 26080522;
@@ -78,6 +78,8 @@ export interface IProfile {
78
78
  is_sponsor_transferred: boolean;
79
79
  is_vk_bound: boolean;
80
80
  is_google_bound: boolean;
81
+ is_telegram_bound?: boolean;
82
+ is_yandex_bound?: boolean;
81
83
  is_article_notifications_enabled: boolean;
82
84
  is_release_type_notifications_enabled: boolean;
83
85
  is_episode_notifications_enabled: boolean;
@@ -274,6 +276,8 @@ export declare enum BlocklistAddResult {
274
276
  }
275
277
  export interface IChangeLogin {
276
278
  id: number;
279
+ newLogin?: string;
280
+ new_login?: string;
277
281
  timestamp: number;
278
282
  }
279
283
  export interface IProfileSocialResponse extends IResponse {
@@ -266,6 +266,7 @@ export interface IDubber {
266
266
  episode_count: number;
267
267
  view_count: number;
268
268
  pinned: boolean;
269
+ quality?: number;
269
270
  }
270
271
  export interface IDubbersResponse extends IResponse {
271
272
  types: IDubber[];
@@ -276,6 +277,7 @@ export interface ISource {
276
277
  name: string;
277
278
  type: IDubber | number;
278
279
  episode_count: number;
280
+ quality?: number;
279
281
  }
280
282
  export interface ISourcesResponse extends IResponse {
281
283
  sources: ISource[];
@@ -15,6 +15,11 @@ export interface IProfileSettingsResponse extends IResponse {
15
15
  isVkBound: boolean;
16
16
  is_goolge_bound: boolean;
17
17
  isGoogleBound: boolean;
18
+ is_telegram_bound?: boolean;
19
+ isTelegramBound?: boolean;
20
+ is_yandex_bound?: boolean;
21
+ isYandexBound?: boolean;
22
+ episode_channel_widgets_hidden?: boolean;
18
23
  is_login_changed: boolean;
19
24
  isLoginChanged: boolean;
20
25
  is_change_login_banned: boolean;
@@ -29,11 +34,40 @@ export interface IBadgesResponse extends IPageableResponse<IBadge> {
29
34
  export interface IEmailChangeConfirmResponse extends IResponse<ChangeEmailConfirmResult> {
30
35
  emailHint: string;
31
36
  }
37
+ /** POST profile/preference/email/change */
32
38
  export interface IEmailChangeRequest {
33
- oldEmail: string;
34
- newEmail: string;
35
- password: string;
36
- }
39
+ current_email: string;
40
+ current_password: string;
41
+ new_email: string;
42
+ }
43
+ /** POST profile/preference/email/resend */
44
+ export interface IEmailChangeResendRequest {
45
+ new_email: string;
46
+ current_email: string;
47
+ current_password: string;
48
+ hash: string;
49
+ }
50
+ /** POST profile/preference/password/change */
51
+ export interface IPasswordChangeRequest {
52
+ current: string;
53
+ new: string;
54
+ }
55
+ /** POST profile/preference/telegram/bind */
56
+ export interface ITelegramBindRequest {
57
+ idToken: string;
58
+ }
59
+ /** POST profile/preference/google/bind */
60
+ export interface IGoogleBindRequest {
61
+ idToken: string;
62
+ }
63
+ /** POST profile/preference/vk/bind | yandex/bind */
64
+ export interface IAccessTokenBindRequest {
65
+ accessToken: string;
66
+ }
67
+ /** @alias IAccessTokenBindRequest */
68
+ export type IVkBindRequest = IAccessTokenBindRequest;
69
+ /** @alias IAccessTokenBindRequest */
70
+ export type IYandexBindRequest = IAccessTokenBindRequest;
37
71
  export interface ILoginInfoResponse extends IResponse {
38
72
  login: string;
39
73
  avatar: string;
@@ -60,9 +94,46 @@ export declare enum ChangeLoginResult {
60
94
  TimeLimit = 4
61
95
  }
62
96
  export declare enum ChangeEmailResult {
63
- InvalidEmail = 2,
64
- InvalidCurrentEmail = 3,
65
- EmailAlreadyTaken = 4
97
+ InvalidPassword = 2,
98
+ InvalidOldEmail = 3,
99
+ InvalidEmail = 4,
100
+ EmailAlreadyTaken = 5,
101
+ CodeAlreadySend = 6,
102
+ CodeCannotSend = 7
103
+ }
104
+ export declare enum ChangeEmailResendResult {
105
+ InvalidPassword = 2,
106
+ InvalidOldEmail = 3,
107
+ InvalidHash = 4,
108
+ CodeCannotSend = 5
109
+ }
110
+ export declare enum TelegramBindResult {
111
+ InvalidRequest = 2,
112
+ TelegramAlreadyBound = 3
113
+ }
114
+ export declare enum TelegramUnbindResult {
115
+ TelegramNotBound = 2
116
+ }
117
+ export declare enum GoogleBindResult {
118
+ InvalidRequest = 2,
119
+ GoogleAlreadyBound = 3
120
+ }
121
+ export declare enum GoogleUnbindResult {
122
+ GoogleNotBound = 2
123
+ }
124
+ export declare enum VkBindResult {
125
+ InvalidRequest = 2,
126
+ VkAlreadyBound = 3
127
+ }
128
+ export declare enum VkUnbindResult {
129
+ VkNotBound = 2
130
+ }
131
+ export declare enum YandexBindResult {
132
+ InvalidRequest = 2,
133
+ YandexAlreadyBound = 3
134
+ }
135
+ export declare enum YandexUnbindResult {
136
+ YandexNotBound = 2
66
137
  }
67
138
  export declare enum ChangeEmailConfirmResult {
68
139
  InvalidPassword = 2
@@ -93,6 +164,13 @@ export interface ISelectThemeRequest {
93
164
  export interface ISelectPinnedSectionRequest {
94
165
  section: number;
95
166
  }
167
+ export interface IChangeEmailResponse extends IResponse<ChangeEmailResult> {
168
+ hash?: string;
169
+ timestamp_expires?: number;
170
+ }
171
+ export interface IChangeEmailResendResponse extends IResponse<ChangeEmailResendResult> {
172
+ timestamp_expires?: number;
173
+ }
96
174
  export interface IChangeEmailVerifyResponse extends IResponse {
97
175
  }
98
176
  export interface IChangeLoginInfoResponse extends IResponse {
@@ -102,16 +180,24 @@ export interface IChangeLoginInfoResponse extends IResponse {
102
180
  }
103
181
  export interface IChangeLoginResponse extends IResponse {
104
182
  }
105
- export interface IChangePasswordResponse extends IResponse {
183
+ export interface IChangePasswordResponse extends IResponse<ChangePasswordResult> {
106
184
  token?: string;
107
185
  }
108
- export interface IGoogleBindResponse extends IResponse {
186
+ export interface IGoogleBindResponse extends IResponse<GoogleBindResult> {
187
+ }
188
+ export interface IGoogleUnbindResponse extends IResponse<GoogleUnbindResult> {
189
+ }
190
+ export interface ITelegramBindResponse extends IResponse<TelegramBindResult> {
191
+ }
192
+ export interface ITelegramUnbindResponse extends IResponse<TelegramUnbindResult> {
193
+ }
194
+ export interface IVkBindResponse extends IResponse<VkBindResult> {
109
195
  }
110
- export interface IGoogleUnbindResponse extends IResponse {
196
+ export interface IVkUnbindResponse extends IResponse<VkUnbindResult> {
111
197
  }
112
- export interface IVkBindResponse extends IResponse {
198
+ export interface IYandexBindResponse extends IResponse<YandexBindResult> {
113
199
  }
114
- export interface IVkUnbindResponse extends IResponse {
200
+ export interface IYandexUnbindResponse extends IResponse<YandexUnbindResult> {
115
201
  }
116
202
  export interface ISocialEditResponse extends IResponse {
117
203
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PrivacyFriendRequestState = exports.PrivacyState = exports.PasswordChangeResult = exports.ChangePasswordResult = exports.ChangeEmailConfirmResult = exports.ChangeEmailResult = exports.ChangeLoginResult = exports.SocialEditResult = void 0;
3
+ exports.PrivacyFriendRequestState = exports.PrivacyState = exports.PasswordChangeResult = exports.ChangePasswordResult = exports.ChangeEmailConfirmResult = exports.YandexUnbindResult = exports.YandexBindResult = exports.VkUnbindResult = exports.VkBindResult = exports.GoogleUnbindResult = exports.GoogleBindResult = exports.TelegramUnbindResult = exports.TelegramBindResult = exports.ChangeEmailResendResult = exports.ChangeEmailResult = exports.ChangeLoginResult = exports.SocialEditResult = void 0;
4
4
  var SocialEditResult;
5
5
  (function (SocialEditResult) {
6
6
  SocialEditResult[SocialEditResult["InvalidVk"] = 2] = "InvalidVk";
@@ -17,10 +17,56 @@ var ChangeLoginResult;
17
17
  })(ChangeLoginResult || (exports.ChangeLoginResult = ChangeLoginResult = {}));
18
18
  var ChangeEmailResult;
19
19
  (function (ChangeEmailResult) {
20
- ChangeEmailResult[ChangeEmailResult["InvalidEmail"] = 2] = "InvalidEmail";
21
- ChangeEmailResult[ChangeEmailResult["InvalidCurrentEmail"] = 3] = "InvalidCurrentEmail";
22
- ChangeEmailResult[ChangeEmailResult["EmailAlreadyTaken"] = 4] = "EmailAlreadyTaken";
20
+ ChangeEmailResult[ChangeEmailResult["InvalidPassword"] = 2] = "InvalidPassword";
21
+ ChangeEmailResult[ChangeEmailResult["InvalidOldEmail"] = 3] = "InvalidOldEmail";
22
+ ChangeEmailResult[ChangeEmailResult["InvalidEmail"] = 4] = "InvalidEmail";
23
+ ChangeEmailResult[ChangeEmailResult["EmailAlreadyTaken"] = 5] = "EmailAlreadyTaken";
24
+ ChangeEmailResult[ChangeEmailResult["CodeAlreadySend"] = 6] = "CodeAlreadySend";
25
+ ChangeEmailResult[ChangeEmailResult["CodeCannotSend"] = 7] = "CodeCannotSend";
23
26
  })(ChangeEmailResult || (exports.ChangeEmailResult = ChangeEmailResult = {}));
27
+ var ChangeEmailResendResult;
28
+ (function (ChangeEmailResendResult) {
29
+ ChangeEmailResendResult[ChangeEmailResendResult["InvalidPassword"] = 2] = "InvalidPassword";
30
+ ChangeEmailResendResult[ChangeEmailResendResult["InvalidOldEmail"] = 3] = "InvalidOldEmail";
31
+ ChangeEmailResendResult[ChangeEmailResendResult["InvalidHash"] = 4] = "InvalidHash";
32
+ ChangeEmailResendResult[ChangeEmailResendResult["CodeCannotSend"] = 5] = "CodeCannotSend";
33
+ })(ChangeEmailResendResult || (exports.ChangeEmailResendResult = ChangeEmailResendResult = {}));
34
+ var TelegramBindResult;
35
+ (function (TelegramBindResult) {
36
+ TelegramBindResult[TelegramBindResult["InvalidRequest"] = 2] = "InvalidRequest";
37
+ TelegramBindResult[TelegramBindResult["TelegramAlreadyBound"] = 3] = "TelegramAlreadyBound";
38
+ })(TelegramBindResult || (exports.TelegramBindResult = TelegramBindResult = {}));
39
+ var TelegramUnbindResult;
40
+ (function (TelegramUnbindResult) {
41
+ TelegramUnbindResult[TelegramUnbindResult["TelegramNotBound"] = 2] = "TelegramNotBound";
42
+ })(TelegramUnbindResult || (exports.TelegramUnbindResult = TelegramUnbindResult = {}));
43
+ var GoogleBindResult;
44
+ (function (GoogleBindResult) {
45
+ GoogleBindResult[GoogleBindResult["InvalidRequest"] = 2] = "InvalidRequest";
46
+ GoogleBindResult[GoogleBindResult["GoogleAlreadyBound"] = 3] = "GoogleAlreadyBound";
47
+ })(GoogleBindResult || (exports.GoogleBindResult = GoogleBindResult = {}));
48
+ var GoogleUnbindResult;
49
+ (function (GoogleUnbindResult) {
50
+ GoogleUnbindResult[GoogleUnbindResult["GoogleNotBound"] = 2] = "GoogleNotBound";
51
+ })(GoogleUnbindResult || (exports.GoogleUnbindResult = GoogleUnbindResult = {}));
52
+ var VkBindResult;
53
+ (function (VkBindResult) {
54
+ VkBindResult[VkBindResult["InvalidRequest"] = 2] = "InvalidRequest";
55
+ VkBindResult[VkBindResult["VkAlreadyBound"] = 3] = "VkAlreadyBound";
56
+ })(VkBindResult || (exports.VkBindResult = VkBindResult = {}));
57
+ var VkUnbindResult;
58
+ (function (VkUnbindResult) {
59
+ VkUnbindResult[VkUnbindResult["VkNotBound"] = 2] = "VkNotBound";
60
+ })(VkUnbindResult || (exports.VkUnbindResult = VkUnbindResult = {}));
61
+ var YandexBindResult;
62
+ (function (YandexBindResult) {
63
+ YandexBindResult[YandexBindResult["InvalidRequest"] = 2] = "InvalidRequest";
64
+ YandexBindResult[YandexBindResult["YandexAlreadyBound"] = 3] = "YandexAlreadyBound";
65
+ })(YandexBindResult || (exports.YandexBindResult = YandexBindResult = {}));
66
+ var YandexUnbindResult;
67
+ (function (YandexUnbindResult) {
68
+ YandexUnbindResult[YandexUnbindResult["YandexNotBound"] = 2] = "YandexNotBound";
69
+ })(YandexUnbindResult || (exports.YandexUnbindResult = YandexUnbindResult = {}));
24
70
  var ChangeEmailConfirmResult;
25
71
  (function (ChangeEmailConfirmResult) {
26
72
  ChangeEmailConfirmResult[ChangeEmailConfirmResult["InvalidPassword"] = 2] = "InvalidPassword";
@@ -20,20 +20,18 @@ class KodikParser {
20
20
  return atob(latestEndpoint);
21
21
  }
22
22
  static async getDirectLinks(url, endpointPath = this._endpointUrl) {
23
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
23
+ var _a, _b, _c, _d, _e, _f;
24
24
  const urlResponse = await (await fetch(url)).text();
25
- const urlParams = JSON.parse((_c = (_b = (_a = urlResponse.match(/var\surlParams\s=\s'(?<params>.*?)';/is)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.params) !== null && _c !== void 0 ? _c : "{}");
26
- const videoInfoHash = (_e = (_d = urlResponse.match(/\w+.hash\s=\s'(?<hash>.*?)';/is)) === null || _d === void 0 ? void 0 : _d.groups) === null || _e === void 0 ? void 0 : _e.hash;
27
- const videoInfoId = (_g = (_f = urlResponse.match(/\w+.id\s=\s'(?<id>.*?)';/is)) === null || _f === void 0 ? void 0 : _f.groups) === null || _g === void 0 ? void 0 : _g.id;
28
- const videoInfoType = (_j = (_h = urlResponse.match(/\w+.type\s=\s'(?<type>.*?)';/)) === null || _h === void 0 ? void 0 : _h.groups) === null || _j === void 0 ? void 0 : _j.type;
25
+ const videoInfoHash = (_b = (_a = urlResponse.match(/\w+.hash\s=\s'(?<hash>.*?)';/is)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.hash;
26
+ const videoInfoId = (_d = (_c = urlResponse.match(/\w+.id\s=\s'(?<id>.*?)';/is)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.id;
27
+ const videoInfoType = (_f = (_e = urlResponse.match(/\w+.type\s=\s'(?<type>.*?)';/)) === null || _e === void 0 ? void 0 : _e.groups) === null || _f === void 0 ? void 0 : _f.type;
29
28
  const validKodikUrl = /\/\/(get|cloud)\.(kodik-storage|solodcdn)\.com\/useruploads\/.*?\/.*?\/(240|360|480|720|1080)\.mp4:hls:manifest.m3u8/s;
30
29
  if (!videoInfoHash || !videoInfoId || !videoInfoType)
31
30
  return null;
32
31
  const requestBody = {
33
- ...urlParams,
34
32
  type: videoInfoType,
35
33
  hash: videoInfoHash,
36
- id: videoInfoId
34
+ id: videoInfoId,
37
35
  };
38
36
  const directLinksResponse = await fetch(`https://${this._baseKodikDomain}${endpointPath}?${new URLSearchParams(requestBody).toString()}`, {
39
37
  referrer: '',
@@ -108,14 +108,30 @@ const client = new Anixart({ token: "existing-token" });
108
108
  ### OAuth и регистрация
109
109
 
110
110
  ```typescript
111
- // Вход через VK
112
- await client.endpoints.auth.signInWithVk({ vkAccessToken: "..." });
111
+ import { OAuthAuthResult, GoogleAuthResult } from "anixapi";
112
+
113
+ // Вход через VK / Google / Telegram / Yandex
114
+ const vk = await client.endpoints.auth.signInWithVk({ vkAccessToken: "..." });
115
+ const google = await client.endpoints.auth.signInWithGoogle({ googleIdToken: "..." });
116
+ const tg = await client.endpoints.auth.signInWithTelegram({ telegramIdToken: "..." });
117
+ const ya = await client.endpoints.auth.signInWithYandex({ yandexAccessToken: "..." });
118
+
119
+ // code === OAuthAuthResult.NotRegistered (3) → нужно signUpWith*
120
+ if (ya.code === OAuthAuthResult.NotRegistered) {
121
+ await client.endpoints.auth.signUpWithYandex({
122
+ login: "newuser",
123
+ email: ya.email ?? "user@example.com",
124
+ yandexAccessToken: "...",
125
+ });
126
+ }
113
127
 
114
- // Регистрация
128
+ // Регистрация по email
115
129
  await client.endpoints.auth.signUp({ login, email, password });
116
130
  await client.endpoints.auth.verify({ login, email, password, code, hash });
117
131
  ```
118
132
 
133
+ Флаги доступности провайдеров: `GET config/urls` → `vk_auth_available`, `google_auth_available`, `telegram_auth_available`, `yandex_auth_available`.
134
+
119
135
  Полный список методов: `client.endpoints.auth.*`
120
136
 
121
137
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anixapi",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Unofficial Anixart API wrapper for Node.js (TypeScript)",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",