anixapi 0.3.1 → 0.3.2

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, 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";
2
+ import { IBaseApiParams, IChangeEmailResendResponse, IChangeEmailResponse, IChangeEmailVerifyResponse, IChangeLoginInfoResponse, IChangeLoginResponse, IChangePasswordResponse, IEmailChangeRequest, IEmailChangeResendRequest, IGoogleBindRequest, IGoogleBindResponse, IGoogleUnbindResponse, IPasswordChangeRequest, IPrivacyEditRequest, IProfileSettingsResponse, IProfileSocialResponse, IResponse, ISelectPinnedSectionRequest, ISelectThemeRequest, ISelectThemeResponse, ISocialEditResponse, ISocialPagesEditRequest, IStatusEditRequest, ITelegramBindRequest, ITelegramBindResponse, ITelegramUnbindResponse, IVkBindRequest, IVkBindResponse, IVkUnbindResponse, IYandexBindRequest, IYandexBindResponse, IYandexUnbindResponse } from "../../types";
3
3
  /**
4
4
  * Класс с эндпоинтами настроек профиля
5
5
  */
@@ -195,7 +195,7 @@ export declare class ProfilePreference {
195
195
  * @example
196
196
  * const result = await client.endpoints.profilePreference.selectTheme(...);
197
197
  */
198
- selectTheme(body: ISelectThemeRequest, options?: IBaseApiParams): Promise<IResponse>;
198
+ selectTheme(body: ISelectThemeRequest, options?: IBaseApiParams): Promise<ISelectThemeResponse>;
199
199
  /**
200
200
  * GET profile/preference/social
201
201
  *
@@ -234,7 +234,14 @@ class ProfilePreference {
234
234
  * const result = await client.endpoints.profilePreference.selectTheme(...);
235
235
  */
236
236
  async selectTheme(body, options) {
237
- return await this.client.call({ path: `/profile/preference/themes/edit`, method: 'POST', json: body, ...options });
237
+ var _a;
238
+ const id = (_a = body.id) !== null && _a !== void 0 ? _a : body.theme;
239
+ return await this.client.call({
240
+ path: `/profile/preference/themes/edit`,
241
+ method: 'POST',
242
+ json: { id },
243
+ ...options,
244
+ });
238
245
  }
239
246
  /**
240
247
  * GET profile/preference/social
@@ -318,6 +318,7 @@ export interface IRoleDto {
318
318
  id: number;
319
319
  }
320
320
  export interface ITheme {
321
+ id?: number;
321
322
  name?: string;
322
323
  theme_animation_enabled?: boolean;
323
324
  theme_animation_speed?: string | null;
@@ -337,6 +338,7 @@ export interface ITheme {
337
338
  }
338
339
  export interface IAvailableTheme {
339
340
  id: number;
341
+ name?: string;
340
342
  }
341
343
  export interface IUser {
342
344
  id: number;
@@ -1,4 +1,4 @@
1
- import { IBadge, IProfile } from "./profile";
1
+ import { IBadge, IProfile, ITheme } from "./profile";
2
2
  import { IPageableResponse, IResponse } from "./response";
3
3
  export interface IProfileSettingsResponse extends IResponse {
4
4
  avatar: string;
@@ -27,6 +27,13 @@ export interface IProfileSettingsResponse extends IResponse {
27
27
  is_change_avatar_banned: boolean;
28
28
  ban_change_avatar_expires: number;
29
29
  channel_id: number;
30
+ /** Темы витрины (из preference/my) */
31
+ available_themes?: {
32
+ id: number;
33
+ name: string;
34
+ }[];
35
+ selected_theme_id?: number;
36
+ badge?: IBadge | null;
30
37
  }
31
38
  export interface IBadgesResponse extends IPageableResponse<IBadge> {
32
39
  profile: IProfile;
@@ -159,7 +166,14 @@ export interface IPasswordChangeResponse extends IResponse<ChangePasswordResult>
159
166
  token: string;
160
167
  }
161
168
  export interface ISelectThemeRequest {
162
- theme: number;
169
+ /** APK SelectThemeRequest: поле `id` */
170
+ id: number;
171
+ /** @deprecated используйте `id` */
172
+ theme?: number;
173
+ }
174
+ /** Ответ POST profile/preference/themes/edit */
175
+ export interface ISelectThemeResponse extends IResponse {
176
+ theme?: ITheme | null;
163
177
  }
164
178
  export interface ISelectPinnedSectionRequest {
165
179
  section: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anixapi",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Unofficial Anixart API wrapper for Node.js (TypeScript)",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",