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,5 +1,5 @@
1
1
  import { Anixart } from "../../client";
2
- import { IBaseApiParams, IChangeEmailVerifyResponse, IChangeLoginInfoResponse, IChangeLoginResponse, IChangePasswordResponse, IGoogleBindResponse, IGoogleUnbindResponse, IPrivacyEditRequest, IProfileSettingsResponse, IProfileSocialResponse, IResponse, ISelectPinnedSectionRequest, ISelectThemeRequest, ISocialEditResponse, ISocialPagesEditRequest, IStatusEditRequest, IVkBindResponse, IVkUnbindResponse } from "../../types";
2
+ import { IBaseApiParams, IChangeEmailResendResponse, IChangeEmailResponse, IChangeEmailVerifyResponse, IChangeLoginInfoResponse, IChangeLoginResponse, IChangePasswordResponse, IEmailChangeRequest, IEmailChangeResendRequest, IGoogleBindRequest, IGoogleBindResponse, IGoogleUnbindResponse, IPasswordChangeRequest, IPrivacyEditRequest, IProfileSettingsResponse, IProfileSocialResponse, IResponse, ISelectPinnedSectionRequest, ISelectThemeRequest, ISocialEditResponse, ISocialPagesEditRequest, IStatusEditRequest, ITelegramBindRequest, ITelegramBindResponse, ITelegramUnbindResponse, IVkBindRequest, IVkBindResponse, IVkUnbindResponse, IYandexBindRequest, IYandexBindResponse, IYandexUnbindResponse } from "../../types";
3
3
  /**
4
4
  * Класс с эндпоинтами настроек профиля
5
5
  */
@@ -27,25 +27,25 @@ export declare class ProfilePreference {
27
27
  */
28
28
  avatarEdit(image?: Buffer, name?: string, options?: IBaseApiParams): Promise<IProfileSettingsResponse>;
29
29
  /**
30
- * GET profile/preference/email/change
30
+ * POST profile/preference/email/change
31
31
  *
32
- * Возможные коды ответа: {@link DefaultResult}
33
- * @returns {@link IResponse}
32
+ * Возможные коды ответа: {@link ChangeEmailResult}
33
+ * @returns {@link IChangeEmailResponse}
34
34
  *
35
35
  * @example
36
- * const result = await client.endpoints.profilePreference.changeEmail(...);
36
+ * const result = await client.endpoints.profilePreference.changeEmail({ current_email, current_password, new_email });
37
37
  */
38
- changeEmail(query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IResponse>;
38
+ changeEmail(data: IEmailChangeRequest, options?: IBaseApiParams): Promise<IChangeEmailResponse>;
39
39
  /**
40
- * GET profile/preference/email/resend
40
+ * POST profile/preference/email/resend
41
41
  *
42
- * Возможные коды ответа: {@link DefaultResult}
43
- * @returns {@link IResponse}
42
+ * Возможные коды ответа: {@link ChangeEmailResendResult}
43
+ * @returns {@link IChangeEmailResendResponse}
44
44
  *
45
45
  * @example
46
- * const result = await client.endpoints.profilePreference.changeEmailResend(...);
46
+ * const result = await client.endpoints.profilePreference.changeEmailResend({ new_email, current_email, current_password, hash });
47
47
  */
48
- changeEmailResend(query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IResponse>;
48
+ changeEmailResend(data: IEmailChangeResendRequest, options?: IBaseApiParams): Promise<IChangeEmailResendResponse>;
49
49
  /**
50
50
  * GET profile/preference/email/verify
51
51
  *
@@ -77,33 +77,43 @@ export declare class ProfilePreference {
77
77
  */
78
78
  changeLoginInfo(options?: IBaseApiParams): Promise<IChangeLoginInfoResponse>;
79
79
  /**
80
- * GET profile/preference/password/change
80
+ * POST profile/preference/password/change
81
81
  *
82
- * Возможные коды ответа: {@link DefaultResult}
82
+ * Возможные коды ответа: {@link ChangePasswordResult}
83
83
  * @returns {@link IChangePasswordResponse}
84
84
  *
85
85
  * @example
86
- * const result = await client.endpoints.profilePreference.changePassword(...);
86
+ * const result = await client.endpoints.profilePreference.changePassword({ current, new: newPassword });
87
87
  */
88
- changePassword(query?: Record<string, string | number | boolean | undefined>, options?: IBaseApiParams): Promise<IChangePasswordResponse>;
88
+ changePassword(data: IPasswordChangeRequest, options?: IBaseApiParams): Promise<IChangePasswordResponse>;
89
89
  /**
90
- * POST profile/preference/google/bind
90
+ * POST profile/preference/episode-widget/edit
91
91
  *
92
92
  * Возможные коды ответа: {@link DefaultResult}
93
+ * @returns {@link IResponse}
94
+ *
95
+ * @example
96
+ * const result = await client.endpoints.profilePreference.episodeWidgetEdit(true);
97
+ */
98
+ episodeWidgetEdit(hidden: boolean, options?: IBaseApiParams): Promise<IResponse>;
99
+ /**
100
+ * POST profile/preference/google/bind
101
+ *
102
+ * Возможные коды ответа: {@link GoogleBindResult}
93
103
  * @returns {@link IGoogleBindResponse}
94
104
  *
95
105
  * @example
96
- * const result = await client.endpoints.profilePreference.googleBind(...);
106
+ * const result = await client.endpoints.profilePreference.googleBind({ idToken });
97
107
  */
98
- googleBind(data?: Record<string, string | number | undefined>, options?: IBaseApiParams): Promise<IGoogleBindResponse>;
108
+ googleBind(data: IGoogleBindRequest, options?: IBaseApiParams): Promise<IGoogleBindResponse>;
99
109
  /**
100
110
  * POST profile/preference/google/unbind
101
111
  *
102
- * Возможные коды ответа: {@link DefaultResult}
112
+ * Возможные коды ответа: {@link GoogleUnbindResult}
103
113
  * @returns {@link IGoogleUnbindResponse}
104
114
  *
105
115
  * @example
106
- * const result = await client.endpoints.profilePreference.googleUnbind(...);
116
+ * const result = await client.endpoints.profilePreference.googleUnbind();
107
117
  */
108
118
  googleUnbind(options?: IBaseApiParams): Promise<IGoogleUnbindResponse>;
109
119
  /**
@@ -216,24 +226,64 @@ export declare class ProfilePreference {
216
226
  * const result = await client.endpoints.profilePreference.statusEdit(...);
217
227
  */
218
228
  statusEdit(body: IStatusEditRequest, options?: IBaseApiParams): Promise<IProfileSettingsResponse>;
229
+ /**
230
+ * POST profile/preference/telegram/bind
231
+ *
232
+ * Возможные коды ответа: {@link TelegramBindResult}
233
+ * @returns {@link ITelegramBindResponse}
234
+ *
235
+ * @example
236
+ * const result = await client.endpoints.profilePreference.telegramBind({ idToken });
237
+ */
238
+ telegramBind(data: ITelegramBindRequest, options?: IBaseApiParams): Promise<ITelegramBindResponse>;
239
+ /**
240
+ * POST profile/preference/telegram/unbind
241
+ *
242
+ * Возможные коды ответа: {@link TelegramUnbindResult}
243
+ * @returns {@link ITelegramUnbindResponse}
244
+ *
245
+ * @example
246
+ * const result = await client.endpoints.profilePreference.telegramUnbind();
247
+ */
248
+ telegramUnbind(options?: IBaseApiParams): Promise<ITelegramUnbindResponse>;
219
249
  /**
220
250
  * POST profile/preference/vk/bind
221
251
  *
222
- * Возможные коды ответа: {@link DefaultResult}
252
+ * Возможные коды ответа: {@link VkBindResult}
223
253
  * @returns {@link IVkBindResponse}
224
254
  *
225
255
  * @example
226
- * const result = await client.endpoints.profilePreference.vkBind(...);
256
+ * const result = await client.endpoints.profilePreference.vkBind({ accessToken });
227
257
  */
228
- vkBind(data?: Record<string, string | number | undefined>, options?: IBaseApiParams): Promise<IVkBindResponse>;
258
+ vkBind(data: IVkBindRequest, options?: IBaseApiParams): Promise<IVkBindResponse>;
229
259
  /**
230
260
  * POST profile/preference/vk/unbind
231
261
  *
232
- * Возможные коды ответа: {@link DefaultResult}
262
+ * Возможные коды ответа: {@link VkUnbindResult}
233
263
  * @returns {@link IVkUnbindResponse}
234
264
  *
235
265
  * @example
236
- * const result = await client.endpoints.profilePreference.vkUnbind(...);
266
+ * const result = await client.endpoints.profilePreference.vkUnbind();
237
267
  */
238
268
  vkUnbind(options?: IBaseApiParams): Promise<IVkUnbindResponse>;
269
+ /**
270
+ * POST profile/preference/yandex/bind (с beta 21)
271
+ *
272
+ * Возможные коды ответа: {@link YandexBindResult}
273
+ * @returns {@link IYandexBindResponse}
274
+ *
275
+ * @example
276
+ * const result = await client.endpoints.profilePreference.yandexBind({ accessToken });
277
+ */
278
+ yandexBind(data: IYandexBindRequest, options?: IBaseApiParams): Promise<IYandexBindResponse>;
279
+ /**
280
+ * POST profile/preference/yandex/unbind (с beta 21)
281
+ *
282
+ * Возможные коды ответа: {@link YandexUnbindResult}
283
+ * @returns {@link IYandexUnbindResponse}
284
+ *
285
+ * @example
286
+ * const result = await client.endpoints.profilePreference.yandexUnbind();
287
+ */
288
+ yandexUnbind(options?: IBaseApiParams): Promise<IYandexUnbindResponse>;
239
289
  }
@@ -33,28 +33,28 @@ class ProfilePreference {
33
33
  return await this.client.call({ path: `/profile/preference/avatar/edit`, method: 'POST', image: image ? { type: 'image', name: name !== null && name !== void 0 ? name : 'image.jpg', stream: image } : undefined, ...options });
34
34
  }
35
35
  /**
36
- * GET profile/preference/email/change
36
+ * POST profile/preference/email/change
37
37
  *
38
- * Возможные коды ответа: {@link DefaultResult}
39
- * @returns {@link IResponse}
38
+ * Возможные коды ответа: {@link ChangeEmailResult}
39
+ * @returns {@link IChangeEmailResponse}
40
40
  *
41
41
  * @example
42
- * const result = await client.endpoints.profilePreference.changeEmail(...);
42
+ * const result = await client.endpoints.profilePreference.changeEmail({ current_email, current_password, new_email });
43
43
  */
44
- async changeEmail(query, options) {
45
- return await this.client.call({ path: `/profile/preference/email/change`, queryParams: query, apiV2: true, ...options });
44
+ async changeEmail(data, options) {
45
+ return await this.client.call({ path: `/profile/preference/email/change`, method: 'POST', urlEncoded: data, apiV2: true, ...options });
46
46
  }
47
47
  /**
48
- * GET profile/preference/email/resend
48
+ * POST profile/preference/email/resend
49
49
  *
50
- * Возможные коды ответа: {@link DefaultResult}
51
- * @returns {@link IResponse}
50
+ * Возможные коды ответа: {@link ChangeEmailResendResult}
51
+ * @returns {@link IChangeEmailResendResponse}
52
52
  *
53
53
  * @example
54
- * const result = await client.endpoints.profilePreference.changeEmailResend(...);
54
+ * const result = await client.endpoints.profilePreference.changeEmailResend({ new_email, current_email, current_password, hash });
55
55
  */
56
- async changeEmailResend(query, options) {
57
- return await this.client.call({ path: `/profile/preference/email/resend`, queryParams: query, ...options });
56
+ async changeEmailResend(data, options) {
57
+ return await this.client.call({ path: `/profile/preference/email/resend`, method: 'POST', urlEncoded: data, ...options });
58
58
  }
59
59
  /**
60
60
  * GET profile/preference/email/verify
@@ -93,25 +93,37 @@ class ProfilePreference {
93
93
  return await this.client.call({ path: `/profile/preference/login/info`, method: 'POST', ...options });
94
94
  }
95
95
  /**
96
- * GET profile/preference/password/change
96
+ * POST profile/preference/password/change
97
97
  *
98
- * Возможные коды ответа: {@link DefaultResult}
98
+ * Возможные коды ответа: {@link ChangePasswordResult}
99
99
  * @returns {@link IChangePasswordResponse}
100
100
  *
101
101
  * @example
102
- * const result = await client.endpoints.profilePreference.changePassword(...);
102
+ * const result = await client.endpoints.profilePreference.changePassword({ current, new: newPassword });
103
103
  */
104
- async changePassword(query, options) {
105
- return await this.client.call({ path: `/profile/preference/password/change`, queryParams: query, ...options });
104
+ async changePassword(data, options) {
105
+ return await this.client.call({ path: `/profile/preference/password/change`, method: 'POST', urlEncoded: data, ...options });
106
106
  }
107
107
  /**
108
- * POST profile/preference/google/bind
108
+ * POST profile/preference/episode-widget/edit
109
109
  *
110
110
  * Возможные коды ответа: {@link DefaultResult}
111
+ * @returns {@link IResponse}
112
+ *
113
+ * @example
114
+ * const result = await client.endpoints.profilePreference.episodeWidgetEdit(true);
115
+ */
116
+ async episodeWidgetEdit(hidden, options) {
117
+ return await this.client.call({ path: `/profile/preference/episode-widget/edit`, method: 'POST', queryParams: { hidden }, ...options });
118
+ }
119
+ /**
120
+ * POST profile/preference/google/bind
121
+ *
122
+ * Возможные коды ответа: {@link GoogleBindResult}
111
123
  * @returns {@link IGoogleBindResponse}
112
124
  *
113
125
  * @example
114
- * const result = await client.endpoints.profilePreference.googleBind(...);
126
+ * const result = await client.endpoints.profilePreference.googleBind({ idToken });
115
127
  */
116
128
  async googleBind(data, options) {
117
129
  return await this.client.call({ path: `/profile/preference/google/bind`, method: 'POST', urlEncoded: data, ...options });
@@ -119,11 +131,11 @@ class ProfilePreference {
119
131
  /**
120
132
  * POST profile/preference/google/unbind
121
133
  *
122
- * Возможные коды ответа: {@link DefaultResult}
134
+ * Возможные коды ответа: {@link GoogleUnbindResult}
123
135
  * @returns {@link IGoogleUnbindResponse}
124
136
  *
125
137
  * @example
126
- * const result = await client.endpoints.profilePreference.googleUnbind(...);
138
+ * const result = await client.endpoints.profilePreference.googleUnbind();
127
139
  */
128
140
  async googleUnbind(options) {
129
141
  return await this.client.call({ path: `/profile/preference/google/unbind`, method: 'POST', ...options });
@@ -260,14 +272,38 @@ class ProfilePreference {
260
272
  async statusEdit(body, options) {
261
273
  return await this.client.call({ path: `/profile/preference/status/edit`, method: 'POST', json: body, ...options });
262
274
  }
275
+ /**
276
+ * POST profile/preference/telegram/bind
277
+ *
278
+ * Возможные коды ответа: {@link TelegramBindResult}
279
+ * @returns {@link ITelegramBindResponse}
280
+ *
281
+ * @example
282
+ * const result = await client.endpoints.profilePreference.telegramBind({ idToken });
283
+ */
284
+ async telegramBind(data, options) {
285
+ return await this.client.call({ path: `/profile/preference/telegram/bind`, method: 'POST', urlEncoded: data, ...options });
286
+ }
287
+ /**
288
+ * POST profile/preference/telegram/unbind
289
+ *
290
+ * Возможные коды ответа: {@link TelegramUnbindResult}
291
+ * @returns {@link ITelegramUnbindResponse}
292
+ *
293
+ * @example
294
+ * const result = await client.endpoints.profilePreference.telegramUnbind();
295
+ */
296
+ async telegramUnbind(options) {
297
+ return await this.client.call({ path: `/profile/preference/telegram/unbind`, method: 'POST', ...options });
298
+ }
263
299
  /**
264
300
  * POST profile/preference/vk/bind
265
301
  *
266
- * Возможные коды ответа: {@link DefaultResult}
302
+ * Возможные коды ответа: {@link VkBindResult}
267
303
  * @returns {@link IVkBindResponse}
268
304
  *
269
305
  * @example
270
- * const result = await client.endpoints.profilePreference.vkBind(...);
306
+ * const result = await client.endpoints.profilePreference.vkBind({ accessToken });
271
307
  */
272
308
  async vkBind(data, options) {
273
309
  return await this.client.call({ path: `/profile/preference/vk/bind`, method: 'POST', urlEncoded: data, ...options });
@@ -275,14 +311,38 @@ class ProfilePreference {
275
311
  /**
276
312
  * POST profile/preference/vk/unbind
277
313
  *
278
- * Возможные коды ответа: {@link DefaultResult}
314
+ * Возможные коды ответа: {@link VkUnbindResult}
279
315
  * @returns {@link IVkUnbindResponse}
280
316
  *
281
317
  * @example
282
- * const result = await client.endpoints.profilePreference.vkUnbind(...);
318
+ * const result = await client.endpoints.profilePreference.vkUnbind();
283
319
  */
284
320
  async vkUnbind(options) {
285
321
  return await this.client.call({ path: `/profile/preference/vk/unbind`, method: 'POST', ...options });
286
322
  }
323
+ /**
324
+ * POST profile/preference/yandex/bind (с beta 21)
325
+ *
326
+ * Возможные коды ответа: {@link YandexBindResult}
327
+ * @returns {@link IYandexBindResponse}
328
+ *
329
+ * @example
330
+ * const result = await client.endpoints.profilePreference.yandexBind({ accessToken });
331
+ */
332
+ async yandexBind(data, options) {
333
+ return await this.client.call({ path: `/profile/preference/yandex/bind`, method: 'POST', urlEncoded: data, ...options });
334
+ }
335
+ /**
336
+ * POST profile/preference/yandex/unbind (с beta 21)
337
+ *
338
+ * Возможные коды ответа: {@link YandexUnbindResult}
339
+ * @returns {@link IYandexUnbindResponse}
340
+ *
341
+ * @example
342
+ * const result = await client.endpoints.profilePreference.yandexUnbind();
343
+ */
344
+ async yandexUnbind(options) {
345
+ return await this.client.call({ path: `/profile/preference/yandex/unbind`, method: 'POST', ...options });
346
+ }
287
347
  }
288
348
  exports.ProfilePreference = ProfilePreference;
@@ -1,11 +1,31 @@
1
1
  import { Anixart } from "../../client";
2
- import { IBaseApiParams, IResponse, ITypeResponse } from "../../types";
2
+ import { IBaseApiParams, IResponse, ITypeChannelResponse, ITypeResponse } from "../../types";
3
3
  /**
4
4
  * Класс с эндпоинтами типов озвучки
5
5
  */
6
6
  export declare class Type {
7
7
  private readonly client;
8
8
  constructor(client: Anixart);
9
+ /**
10
+ * GET type/{typeId}/channel
11
+ *
12
+ * Возможные коды ответа: {@link DefaultResult}
13
+ * @returns {@link ITypeChannelResponse}
14
+ *
15
+ * @example
16
+ * const result = await client.endpoints.type.channel(1, ...);
17
+ */
18
+ channel(typeId: number, options?: IBaseApiParams): Promise<ITypeChannelResponse>;
19
+ /**
20
+ * GET type/widget/hide/{typeId}
21
+ *
22
+ * Возможные коды ответа: {@link DefaultResult}
23
+ * @returns {@link IResponse}
24
+ *
25
+ * @example
26
+ * const result = await client.endpoints.type.hideWidget(1, true, ...);
27
+ */
28
+ hideWidget(typeId: number, permanent?: boolean, options?: IBaseApiParams): Promise<IResponse>;
9
29
  /**
10
30
  * GET type/pin/{releaseId}/{typeId}
11
31
  *
@@ -26,6 +46,16 @@ export declare class Type {
26
46
  * const result = await client.endpoints.type.types(...);
27
47
  */
28
48
  types(options?: IBaseApiParams): Promise<ITypeResponse>;
49
+ /**
50
+ * GET type/widget/unhide/{typeId}
51
+ *
52
+ * Возможные коды ответа: {@link DefaultResult}
53
+ * @returns {@link IResponse}
54
+ *
55
+ * @example
56
+ * const result = await client.endpoints.type.unhideWidget(1, ...);
57
+ */
58
+ unhideWidget(typeId: number, options?: IBaseApiParams): Promise<IResponse>;
29
59
  /**
30
60
  * GET type/unpin/{releaseId}/{typeId}
31
61
  *
@@ -8,6 +8,30 @@ class Type {
8
8
  constructor(client) {
9
9
  this.client = client;
10
10
  }
11
+ /**
12
+ * GET type/{typeId}/channel
13
+ *
14
+ * Возможные коды ответа: {@link DefaultResult}
15
+ * @returns {@link ITypeChannelResponse}
16
+ *
17
+ * @example
18
+ * const result = await client.endpoints.type.channel(1, ...);
19
+ */
20
+ async channel(typeId, options) {
21
+ return await this.client.call({ path: `/type/${typeId}/channel`, ...options });
22
+ }
23
+ /**
24
+ * GET type/widget/hide/{typeId}
25
+ *
26
+ * Возможные коды ответа: {@link DefaultResult}
27
+ * @returns {@link IResponse}
28
+ *
29
+ * @example
30
+ * const result = await client.endpoints.type.hideWidget(1, true, ...);
31
+ */
32
+ async hideWidget(typeId, permanent = false, options) {
33
+ return await this.client.call({ path: `/type/widget/hide/${typeId}`, queryParams: { permanent }, ...options });
34
+ }
11
35
  /**
12
36
  * GET type/pin/{releaseId}/{typeId}
13
37
  *
@@ -32,6 +56,18 @@ class Type {
32
56
  async types(options) {
33
57
  return await this.client.call({ path: `/type/all`, ...options });
34
58
  }
59
+ /**
60
+ * GET type/widget/unhide/{typeId}
61
+ *
62
+ * Возможные коды ответа: {@link DefaultResult}
63
+ * @returns {@link IResponse}
64
+ *
65
+ * @example
66
+ * const result = await client.endpoints.type.unhideWidget(1, ...);
67
+ */
68
+ async unhideWidget(typeId, options) {
69
+ return await this.client.call({ path: `/type/widget/unhide/${typeId}`, ...options });
70
+ }
35
71
  /**
36
72
  * GET type/unpin/{releaseId}/{typeId}
37
73
  *
@@ -14,6 +14,7 @@ export declare class Dubber {
14
14
  readonly pinned: boolean;
15
15
  readonly viewCount: number;
16
16
  readonly workers: string;
17
+ readonly quality: number | null;
17
18
  constructor(client: Anixart, dubberResponce: IDubber, release: Release);
18
19
  getSources(): Promise<Source[]>;
19
20
  }
@@ -15,6 +15,7 @@ class Dubber {
15
15
  this.pinned = dubberResponce.pinned,
16
16
  this.viewCount = dubberResponce.view_count;
17
17
  this.workers = dubberResponce.workers;
18
+ this.quality = typeof dubberResponce.quality === 'number' ? dubberResponce.quality : null;
18
19
  }
19
20
  async getSources() {
20
21
  const request = await this.client.endpoints.episode.sources(this.release.id, this.id);
@@ -31,6 +31,8 @@ export declare class FullProfile extends BaseProfile {
31
31
  readonly isBookmarksTransferred: boolean;
32
32
  readonly isVkBound: boolean;
33
33
  readonly isGoogleBound: boolean;
34
+ readonly isTelegramBound: boolean;
35
+ readonly isYandexBound: boolean;
34
36
  readonly isReleaseTypeNotificationsEnabled: boolean;
35
37
  readonly isEpisodeNotificationsEnabled: boolean;
36
38
  readonly isFirstEpisodeNotificationEnabled: boolean;
@@ -5,7 +5,7 @@ const BaseProfile_1 = require("./BaseProfile");
5
5
  const Release_1 = require("./Release");
6
6
  class FullProfile extends BaseProfile_1.BaseProfile {
7
7
  constructor(client, profile) {
8
- var _a, _b, _c, _d, _e, _f, _g, _h;
8
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
9
9
  super(client, {
10
10
  id: profile.id,
11
11
  login: profile.login,
@@ -52,6 +52,8 @@ class FullProfile extends BaseProfile_1.BaseProfile {
52
52
  this.isBookmarksTransferred = profile.is_bookmarks_transferred;
53
53
  this.isVkBound = profile.is_vk_bound;
54
54
  this.isGoogleBound = profile.is_google_bound;
55
+ this.isTelegramBound = (_j = profile.is_telegram_bound) !== null && _j !== void 0 ? _j : false;
56
+ this.isYandexBound = (_k = profile.is_yandex_bound) !== null && _k !== void 0 ? _k : false;
55
57
  this.isReleaseTypeNotificationsEnabled = profile.is_release_type_notifications_enabled;
56
58
  this.isEpisodeNotificationsEnabled = profile.is_episode_notifications_enabled;
57
59
  this.isFirstEpisodeNotificationEnabled = profile.is_first_episode_notification_enabled;
package/dist/client.js CHANGED
@@ -22,7 +22,7 @@ const Release_1 = require("./classes/Release");
22
22
  const form_data_1 = __importDefault(require("form-data"));
23
23
  const Collection_1 = require("./classes/Collection");
24
24
  const DEFAULT_BASE_URL = 'https://api-s.anixsekai.com';
25
- const USER_AGENT = "AnixartApp/9.0 BETA 7-25082901 (Android 9; SDK 28; x86_64; ROG ASUS AI2201_B; ru)";
25
+ const USER_AGENT = "AnixartApp/9.0 BETA 19-26073118 (Android 9; SDK 28; x86_64; ROG ASUS AI2201_B; ru)";
26
26
  const API_ENDPOINTS_URL = 'https://raw.githubusercontent.com/AnixHelper/pages/refs/heads/main/urls.json';
27
27
  /**
28
28
  * Класс для работы с API Anixart
@@ -75,9 +75,99 @@ export interface ISignUpRequest {
75
75
  export interface ISignUpVerifyRequest extends ISignUpRequest {
76
76
  vkAccessToken?: string;
77
77
  googleIdToken?: string;
78
+ telegramIdToken?: string;
79
+ yandexAccessToken?: string;
78
80
  hash: string;
79
81
  code: number;
80
82
  }
83
+ /** POST auth/checkLogin */
84
+ export interface ICheckLoginRequest {
85
+ login: string;
86
+ }
87
+ export declare enum CheckLoginResult {
88
+ InvalidLogin = 2
89
+ }
90
+ export interface ICheckLoginResponse extends IResponse<CheckLoginResult> {
91
+ available: boolean;
92
+ suggested_logins?: string[] | null;
93
+ }
94
+ /** POST auth/telegram (sign-in) */
95
+ export interface IOAuthTelegramSignInRequest {
96
+ telegramIdToken: string;
97
+ }
98
+ /** POST auth/telegram (sign-up) */
99
+ export interface IOAuthTelegramSignUpRequest {
100
+ login: string;
101
+ email: string;
102
+ telegramIdToken: string;
103
+ }
104
+ /** POST auth/yandex (sign-in) */
105
+ export interface IOAuthYandexSignInRequest {
106
+ yandexAccessToken: string;
107
+ }
108
+ /** POST auth/yandex (sign-up) */
109
+ export interface IOAuthYandexSignUpRequest {
110
+ login: string;
111
+ email: string;
112
+ yandexAccessToken: string;
113
+ }
114
+ /** Общие коды OAuth: VK / Telegram / Yandex (beta 21) */
115
+ export declare enum OAuthAuthResult {
116
+ InvalidRequest = 2,
117
+ NotRegistered = 3,
118
+ InvalidLogin = 4,
119
+ InvalidEmail = 5,
120
+ LoginAlreadyTaken = 6,
121
+ EmailAlreadyTaken = 7,
122
+ CodeAlreadySend = 8,
123
+ EmailServiceDisallowed = 9,
124
+ TooManyRegistrations = 10
125
+ }
126
+ /** @deprecated используйте {@link OAuthAuthResult} */
127
+ export declare enum TelegramAuthResult {
128
+ InvalidRequest = 2,
129
+ NotRegistered = 3,
130
+ InvalidLogin = 4,
131
+ InvalidEmail = 5,
132
+ LoginAlreadyTaken = 6,
133
+ EmailAlreadyTaken = 7,
134
+ CodeAlreadySend = 8,
135
+ EmailServiceDisallowed = 9,
136
+ TooManyRegistrations = 10
137
+ }
138
+ /** Коды Google OAuth (отличаются от VK/TG/Yandex) */
139
+ export declare enum GoogleAuthResult {
140
+ InvalidRequest = 2,
141
+ NotRegistered = 3,
142
+ InvalidLogin = 4,
143
+ InvalidEmail = 5,
144
+ LoginAlreadyTaken = 6,
145
+ EmailAlreadyTaken = 7,
146
+ EmailChanged = 8,
147
+ EmailChangedAndCodeAlreadySend = 9,
148
+ EmailServiceDisallowed = 10,
149
+ TooManyRegistrations = 11
150
+ }
151
+ export type VkAuthResult = OAuthAuthResult;
152
+ export type YandexAuthResult = OAuthAuthResult;
153
+ /** Базовый ответ OAuth sign-in / sign-up */
154
+ export interface IOAuthAuthResponse<T extends number = OAuthAuthResult> extends IResponse<T> {
155
+ profile?: IProfile;
156
+ profileToken?: IProfileToken;
157
+ hash?: string;
158
+ codeTimestampExpires?: number;
159
+ suggested_logins?: string[] | null;
160
+ }
161
+ export interface ITelegramAuthResponse extends IOAuthAuthResponse<TelegramAuthResult> {
162
+ }
163
+ export interface IVkAuthResponse extends IOAuthAuthResponse<OAuthAuthResult> {
164
+ }
165
+ export interface IGoogleAuthResponse extends IOAuthAuthResponse<GoogleAuthResult> {
166
+ }
167
+ /** Yandex дополнительно отдаёт email при регистрации */
168
+ export interface IYandexAuthResponse extends IOAuthAuthResponse<OAuthAuthResult> {
169
+ email?: string | null;
170
+ }
81
171
  export interface ILoginRequest {
82
172
  login: string;
83
173
  password: string;
@@ -88,6 +178,8 @@ export interface IResendRequest {
88
178
  password?: string;
89
179
  vkAccessToken?: string;
90
180
  googleIdToken?: string;
181
+ telegramIdToken?: string;
182
+ yandexAccessToken?: string;
91
183
  hash: string;
92
184
  }
93
185
  export interface IRestoreResendRequest {