anixartjs 0.0.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.
Files changed (81) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +187 -0
  3. package/dist/api/auth.d.ts +11 -0
  4. package/dist/api/auth.js +49 -0
  5. package/dist/api/channel.d.ts +42 -0
  6. package/dist/api/channel.js +111 -0
  7. package/dist/api/collection.d.ts +30 -0
  8. package/dist/api/collection.js +57 -0
  9. package/dist/api/discover.d.ts +11 -0
  10. package/dist/api/discover.js +24 -0
  11. package/dist/api/feed.d.ts +9 -0
  12. package/dist/api/feed.js +18 -0
  13. package/dist/api/index.d.ts +9 -0
  14. package/dist/api/index.js +25 -0
  15. package/dist/api/notification.d.ts +14 -0
  16. package/dist/api/notification.js +33 -0
  17. package/dist/api/profile.d.ts +26 -0
  18. package/dist/api/profile.js +59 -0
  19. package/dist/api/release.d.ts +40 -0
  20. package/dist/api/release.js +101 -0
  21. package/dist/api/settings.d.ts +30 -0
  22. package/dist/api/settings.js +81 -0
  23. package/dist/classes/Article.d.ts +18 -0
  24. package/dist/classes/Article.js +43 -0
  25. package/dist/classes/ArticleComment.d.ts +15 -0
  26. package/dist/classes/ArticleComment.js +36 -0
  27. package/dist/classes/BaseArticle.d.ts +21 -0
  28. package/dist/classes/BaseArticle.js +23 -0
  29. package/dist/classes/BaseComment.d.ts +22 -0
  30. package/dist/classes/BaseComment.js +25 -0
  31. package/dist/classes/BaseProfile.d.ts +25 -0
  32. package/dist/classes/BaseProfile.js +37 -0
  33. package/dist/classes/Channel.d.ts +47 -0
  34. package/dist/classes/Channel.js +103 -0
  35. package/dist/classes/Dubber.d.ts +19 -0
  36. package/dist/classes/Dubber.js +24 -0
  37. package/dist/classes/Episode.d.ts +20 -0
  38. package/dist/classes/Episode.js +30 -0
  39. package/dist/classes/FullProfile.d.ts +53 -0
  40. package/dist/classes/FullProfile.js +75 -0
  41. package/dist/classes/Release.d.ts +88 -0
  42. package/dist/classes/Release.js +140 -0
  43. package/dist/classes/ReleaseComment.d.ts +16 -0
  44. package/dist/classes/ReleaseComment.js +44 -0
  45. package/dist/classes/Source.d.ts +15 -0
  46. package/dist/classes/Source.js +20 -0
  47. package/dist/classes/SuggestionArticle.d.ts +14 -0
  48. package/dist/classes/SuggestionArticle.js +28 -0
  49. package/dist/client.d.ts +27 -0
  50. package/dist/client.js +121 -0
  51. package/dist/endpoints.d.ts +18 -0
  52. package/dist/endpoints.js +25 -0
  53. package/dist/index.d.ts +2 -0
  54. package/dist/index.js +20 -0
  55. package/dist/types/auth.d.ts +25 -0
  56. package/dist/types/auth.js +2 -0
  57. package/dist/types/channel.d.ts +178 -0
  58. package/dist/types/channel.js +2 -0
  59. package/dist/types/collection.d.ts +38 -0
  60. package/dist/types/collection.js +2 -0
  61. package/dist/types/index.d.ts +12 -0
  62. package/dist/types/index.js +25 -0
  63. package/dist/types/notification.d.ts +22 -0
  64. package/dist/types/notification.js +2 -0
  65. package/dist/types/profile.d.ts +141 -0
  66. package/dist/types/profile.js +21 -0
  67. package/dist/types/release.d.ts +240 -0
  68. package/dist/types/release.js +23 -0
  69. package/dist/types/request.d.ts +36 -0
  70. package/dist/types/request.js +2 -0
  71. package/dist/types/response.d.ts +51 -0
  72. package/dist/types/response.js +12 -0
  73. package/dist/types/settings.d.ts +61 -0
  74. package/dist/types/settings.js +14 -0
  75. package/dist/utils/ArticleBuilder.d.ts +36 -0
  76. package/dist/utils/ArticleBuilder.js +138 -0
  77. package/dist/utils/LinkParser.d.ts +110 -0
  78. package/dist/utils/LinkParser.js +119 -0
  79. package/dist/utils/Utils.d.ts +3 -0
  80. package/dist/utils/Utils.js +11 -0
  81. package/package.json +32 -0
@@ -0,0 +1,15 @@
1
+ import { Anixart } from '../client';
2
+ import { IDubber, ISource } from '../types';
3
+ import { Dubber } from './Dubber';
4
+ import { Episode } from './Episode';
5
+ export declare class Source {
6
+ private readonly client;
7
+ readonly dubber: Dubber;
8
+ readonly localId: number;
9
+ readonly id: number;
10
+ readonly episodeCount: number;
11
+ readonly name: string;
12
+ readonly type: IDubber | number;
13
+ constructor(client: Anixart, source: ISource, dubber: Dubber);
14
+ getEpisodes(sort?: number): Promise<Episode[]>;
15
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Source = void 0;
4
+ const Episode_1 = require("./Episode");
5
+ class Source {
6
+ constructor(client, source, dubber) {
7
+ this.client = client;
8
+ this.dubber = dubber;
9
+ this.localId = source['@id'];
10
+ this.id = source.id;
11
+ this.episodeCount = source.episode_count;
12
+ this.name = source.name;
13
+ this.type = source.type;
14
+ }
15
+ async getEpisodes(sort = 1) {
16
+ const request = await this.client.endpoints.release.getEpisodes(this.dubber.release.id, this.dubber.id, this.id, sort);
17
+ return request.episodes.map(episode => new Episode_1.Episode(this.client, episode, this));
18
+ }
19
+ }
20
+ exports.Source = Source;
@@ -0,0 +1,14 @@
1
+ import { Channel } from "./Channel";
2
+ import { Anixart } from "../client";
3
+ import { IArticle, ResponseCode } from "../types";
4
+ import { BaseArticle } from "./BaseArticle";
5
+ import { Article } from "./Article";
6
+ export declare class SuggestionArticle extends BaseArticle {
7
+ readonly client: Anixart;
8
+ readonly repostArticle: Article | null;
9
+ readonly channel: Channel;
10
+ constructor(client: Anixart, articleResponce: IArticle, channel?: Channel);
11
+ private writeProperties;
12
+ publish(): Promise<number | null>;
13
+ delete(): Promise<ResponseCode>;
14
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SuggestionArticle = void 0;
4
+ const Channel_1 = require("./Channel");
5
+ const BaseArticle_1 = require("./BaseArticle");
6
+ const Article_1 = require("./Article");
7
+ class SuggestionArticle extends BaseArticle_1.BaseArticle {
8
+ constructor(client, articleResponce, channel) {
9
+ super(client, articleResponce, channel);
10
+ this.client = client;
11
+ this.channel = channel !== null && channel !== void 0 ? channel : new Channel_1.Channel(this.client, articleResponce.channel);
12
+ this.repostArticle = articleResponce.repost_article
13
+ ? new Article_1.Article(client, articleResponce.repost_article, channel)
14
+ : null;
15
+ }
16
+ writeProperties(prop, value) {
17
+ this[prop] = value;
18
+ }
19
+ async publish() {
20
+ const request = await this.client.endpoints.channel.publishArticleSuggestion(this.id);
21
+ return request.code == 0 ? request.article_id : null;
22
+ }
23
+ async delete() {
24
+ const request = await this.client.endpoints.channel.removeArticleSuggestion(this.id);
25
+ return request.code;
26
+ }
27
+ }
28
+ exports.SuggestionArticle = SuggestionArticle;
@@ -0,0 +1,27 @@
1
+ import { IBaseRequest, IResponse, ResponseCode } from "./types";
2
+ import { Endpoints } from "./endpoints";
3
+ import { Channel } from "./classes/Channel";
4
+ import { Article } from "./classes/Article";
5
+ import { FullProfile } from "./classes/FullProfile";
6
+ import { Release } from "./classes/Release";
7
+ export interface IAnixartOptions {
8
+ baseUrl?: string | URL;
9
+ token?: string;
10
+ }
11
+ /**
12
+ * Класс для работы с API Anixart
13
+ */
14
+ export declare class Anixart {
15
+ readonly baseUrl: string | URL;
16
+ token?: string | null;
17
+ readonly endpoints: Endpoints;
18
+ constructor(options: IAnixartOptions);
19
+ getChannelById(id: number): Promise<Channel | null>;
20
+ getProfileById(id: number): Promise<FullProfile>;
21
+ getLatestFeed(page: number): Promise<Article[]>;
22
+ getRandomRelease(extended?: boolean): Promise<Release>;
23
+ getArticleById(id: number): Promise<Article | null>;
24
+ getReleaseById(id: number, extended?: boolean): Promise<Release | null>;
25
+ login(username: string, password: string): Promise<ResponseCode>;
26
+ call<T extends IResponse>(request: IBaseRequest): Promise<T>;
27
+ }
package/dist/client.js ADDED
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Anixart = void 0;
7
+ const endpoints_1 = require("./endpoints");
8
+ const Channel_1 = require("./classes/Channel");
9
+ const Article_1 = require("./classes/Article");
10
+ const FullProfile_1 = require("./classes/FullProfile");
11
+ const Release_1 = require("./classes/Release");
12
+ const form_data_1 = __importDefault(require("form-data"));
13
+ const DEFAULT_BASE_URL = 'https://api.anixart.tv';
14
+ const USER_AGENT = "AnixartApp/9.0 BETA 1-24121614 (Android 9; SDK 28; x86_64; ROG ASUS AI2201_B; ru)";
15
+ /**
16
+ * Класс для работы с API Anixart
17
+ */
18
+ class Anixart {
19
+ constructor(options) {
20
+ var _a, _b;
21
+ this.endpoints = new endpoints_1.Endpoints(this);
22
+ this.baseUrl = (_a = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _a !== void 0 ? _a : DEFAULT_BASE_URL;
23
+ this.token = (_b = options === null || options === void 0 ? void 0 : options.token) !== null && _b !== void 0 ? _b : null;
24
+ }
25
+ async getChannelById(id) {
26
+ const request = await this.endpoints.channel.info(id);
27
+ return request.channel ? new Channel_1.Channel(this, request.channel) : null;
28
+ }
29
+ async getProfileById(id) {
30
+ const request = await this.endpoints.profile.info(id);
31
+ return new FullProfile_1.FullProfile(this, request.profile);
32
+ }
33
+ async getLatestFeed(page) {
34
+ const request = await this.endpoints.feed.latest(page);
35
+ return request.content.map(article => new Article_1.Article(this, article));
36
+ }
37
+ async getRandomRelease(extended = false) {
38
+ const request = await this.endpoints.release.getRandomRelease(extended);
39
+ return new Release_1.Release(this, request.release);
40
+ }
41
+ async getArticleById(id) {
42
+ const request = await this.endpoints.channel.getArticle(id);
43
+ return request.article ? new Article_1.Article(this, request.article) : null;
44
+ }
45
+ async getReleaseById(id, extended = true) {
46
+ const request = await this.endpoints.release.info(id, extended);
47
+ return request.release ? new Release_1.Release(this, request.release) : null;
48
+ }
49
+ async login(username, password) {
50
+ const request = await this.endpoints.auth.signIn({
51
+ login: username,
52
+ password
53
+ });
54
+ if (request.code == 0)
55
+ this.token = request.profileToken.token;
56
+ return request.code;
57
+ }
58
+ async call(request) {
59
+ var _a, _b;
60
+ let data;
61
+ try {
62
+ let url = new URL(request.path, (_a = request.customBaseUrl) !== null && _a !== void 0 ? _a : this.baseUrl);
63
+ const headers = {
64
+ 'User-Agent': USER_AGENT,
65
+ };
66
+ const requestInit = {
67
+ headers,
68
+ method: 'GET',
69
+ };
70
+ if (request.queryParams) {
71
+ for (const [key, value] of Object.entries(request.queryParams)) {
72
+ if (typeof (value) != 'undefined') {
73
+ url.searchParams.append(key, value);
74
+ }
75
+ }
76
+ }
77
+ if (request.token || this.token || request.bearer) {
78
+ request.bearer ? headers["Authorization"] = `Bearer ${request.bearer}` : url.searchParams.append('token', (_b = request.token) !== null && _b !== void 0 ? _b : this.token);
79
+ }
80
+ if (request.json || request.urlEncoded || request.image) {
81
+ requestInit.method = 'POST';
82
+ switch (true) {
83
+ case (request.json !== undefined):
84
+ headers['Content-Type'] = 'application/json';
85
+ requestInit.body = JSON.stringify(request.json);
86
+ break;
87
+ case (request.urlEncoded !== undefined):
88
+ headers['Content-Type'] = 'application/x-www-form-urlencoded';
89
+ requestInit.body = new URLSearchParams(request.urlEncoded).toString();
90
+ break;
91
+ case (request.image !== null && request.image !== undefined):
92
+ const formData = new form_data_1.default();
93
+ formData.append(request.image.type, new Blob([request.image.stream]), request.image.name);
94
+ if (request.image.boundary) {
95
+ formData.setBoundary(request.image.boundary);
96
+ }
97
+ headers['Content-Length'] = String(formData);
98
+ requestInit.body = formData.getBuffer();
99
+ requestInit.headers = formData.getHeaders(headers);
100
+ break;
101
+ }
102
+ }
103
+ if (request.apiV2) {
104
+ headers['API-Version'] = 'v2';
105
+ }
106
+ if (request.method) {
107
+ requestInit.method = request.method;
108
+ }
109
+ const response = await fetch(url.toString(), requestInit);
110
+ data = await response.text();
111
+ }
112
+ catch (error) {
113
+ throw new Error(`[AnixartJS] Unexpected error: ${error}`);
114
+ }
115
+ if (data.trim() == "") {
116
+ throw new Error("[AnixartJS] Bad Request");
117
+ }
118
+ return JSON.parse(data);
119
+ }
120
+ }
121
+ exports.Anixart = Anixart;
@@ -0,0 +1,18 @@
1
+ import { Auth, Settings, Profile, Release, Notification, Collection, Discover, Channel, Feed } from "./api";
2
+ import { IBaseApiParams, IScheduleResponse, ITypeResponse } from "./types";
3
+ import { Anixart } from "./client";
4
+ export declare class Endpoints {
5
+ readonly client: Anixart;
6
+ readonly auth: Auth;
7
+ readonly profile: Profile;
8
+ readonly release: Release;
9
+ readonly settings: Settings;
10
+ readonly notification: Notification;
11
+ readonly collection: Collection;
12
+ readonly discover: Discover;
13
+ readonly channel: Channel;
14
+ readonly feed: Feed;
15
+ constructor(client: Anixart);
16
+ getSchedule(options?: IBaseApiParams): Promise<IScheduleResponse>;
17
+ getTypes(options?: IBaseApiParams): Promise<ITypeResponse>;
18
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Endpoints = void 0;
4
+ const api_1 = require("./api");
5
+ class Endpoints {
6
+ constructor(client) {
7
+ this.client = client;
8
+ this.auth = new api_1.Auth(client);
9
+ this.profile = new api_1.Profile(client);
10
+ this.release = new api_1.Release(client);
11
+ this.settings = new api_1.Settings(client);
12
+ this.notification = new api_1.Notification(client);
13
+ this.collection = new api_1.Collection(client);
14
+ this.discover = new api_1.Discover(client);
15
+ this.channel = new api_1.Channel(client);
16
+ this.feed = new api_1.Feed(client);
17
+ }
18
+ async getSchedule(options) {
19
+ return await this.client.call({ path: '/schedule', ...options });
20
+ }
21
+ async getTypes(options) {
22
+ return await this.client.call({ path: '/type/all', ...options });
23
+ }
24
+ }
25
+ exports.Endpoints = Endpoints;
@@ -0,0 +1,2 @@
1
+ export { Anixart, type IAnixartOptions } from "./client";
2
+ export * from './utils/LinkParser';
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Anixart = void 0;
18
+ var client_1 = require("./client");
19
+ Object.defineProperty(exports, "Anixart", { enumerable: true, get: function () { return client_1.Anixart; } });
20
+ __exportStar(require("./utils/LinkParser"), exports);
@@ -0,0 +1,25 @@
1
+ import { IResponse } from "./response";
2
+ import { IProfile, IProfileToken } from "./profile";
3
+ export interface IRegisterRequest {
4
+ username: string;
5
+ password: string;
6
+ email: string;
7
+ }
8
+ export interface IRegisterResponse extends IResponse {
9
+ hash: string;
10
+ codeTimestampExpires: number;
11
+ }
12
+ export interface IRegisterVerifyRequest extends IRegisterRequest {
13
+ code: number;
14
+ hash: string;
15
+ }
16
+ export interface IRestorePasswordRequest extends Omit<IRegisterVerifyRequest, "email"> {
17
+ }
18
+ export interface ILoginRequest {
19
+ login: string;
20
+ password: string;
21
+ }
22
+ export interface ILoginResponse extends IResponse {
23
+ profile: IProfile;
24
+ profileToken: IProfileToken;
25
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,178 @@
1
+ import { IProfile } from "./profile";
2
+ import { IResponse, IBaseComment } from "./response";
3
+ export interface IChannel {
4
+ id: number;
5
+ title: string;
6
+ description: string;
7
+ avatar: string;
8
+ cover: string;
9
+ permission: number;
10
+ article_count: number;
11
+ subscriber_count: number;
12
+ creation_date: number;
13
+ last_update_date: number;
14
+ is_blog: boolean;
15
+ is_commenting_enabled: boolean;
16
+ is_article_suggestion_enabled: boolean;
17
+ is_verified: boolean;
18
+ is_deleted: boolean;
19
+ blog_profile_id: number;
20
+ is_subscribed: boolean;
21
+ is_blocked: boolean;
22
+ block_reason: string;
23
+ block_expire_date: number;
24
+ is_perm_blocked: boolean;
25
+ is_administrator_or_higher: boolean;
26
+ }
27
+ export interface IArticleUploadFileResponse extends IResponse {
28
+ file: IArticleImageItem;
29
+ success: number;
30
+ }
31
+ export interface IArticleSuggestionPublishResponse extends IResponse {
32
+ article_id: number;
33
+ }
34
+ export interface IChannelResponse extends IResponse {
35
+ channel: IChannel;
36
+ suggestion_count: number;
37
+ }
38
+ export interface IChannelCreateRequest {
39
+ title: string;
40
+ description: string;
41
+ is_article_suggestion_enabled: boolean;
42
+ is_commenting_enabled: boolean;
43
+ }
44
+ export interface ISubsciptionCountResponse extends IResponse {
45
+ subscription_count: number;
46
+ }
47
+ export interface IArticleCommentResponce extends IResponse {
48
+ comment: IArticleComment;
49
+ }
50
+ export interface IArticleTextBlock {
51
+ text: string;
52
+ text_length: number;
53
+ }
54
+ export interface IArticleHeaderBlock {
55
+ text: string;
56
+ text_length: number;
57
+ level: number;
58
+ }
59
+ export interface IArticleImageItem {
60
+ id: string;
61
+ url: string;
62
+ hash: string;
63
+ width: number;
64
+ height: number;
65
+ }
66
+ export interface IArticleImageBlock {
67
+ items: IArticleImageItem[];
68
+ item_count: number;
69
+ }
70
+ export interface IArticleQuoteBlock {
71
+ text: string;
72
+ caption: string;
73
+ alignment: string;
74
+ text_length: number;
75
+ caption_length: number;
76
+ }
77
+ export interface IArticleListBlock {
78
+ style: string;
79
+ items: string[];
80
+ item_count: number;
81
+ }
82
+ export interface IArticleEmbedBlock {
83
+ url: string;
84
+ hash: string;
85
+ embed: string;
86
+ width: number;
87
+ height: number;
88
+ image: string;
89
+ title: string;
90
+ service: string;
91
+ site_name: string;
92
+ description: string;
93
+ }
94
+ export interface IArticlePayloadBlock {
95
+ id: string;
96
+ data: IArticleTextBlock | IArticleImageBlock | IArticleHeaderBlock | IArticleQuoteBlock | IArticleListBlock | IArticleEmbedBlock | {};
97
+ name: string;
98
+ type: string;
99
+ }
100
+ export interface IArticleCreateRequest {
101
+ repost_article_id: number | null;
102
+ payload: {
103
+ time: number;
104
+ version: string;
105
+ blocks: IArticlePayloadBlock[];
106
+ block_count: number;
107
+ };
108
+ }
109
+ export interface IArticleSuggestionCreateRequest extends Omit<IArticleCreateRequest, 'repost_article_id'> {
110
+ }
111
+ export interface IEmbedData extends IResponse {
112
+ success: number;
113
+ hash: string;
114
+ site_name: string;
115
+ title: string;
116
+ description: string;
117
+ image: string;
118
+ embed: string;
119
+ width: number;
120
+ height: number;
121
+ url: string;
122
+ }
123
+ export interface IArticleResponse extends IResponse {
124
+ article: IArticle;
125
+ }
126
+ export interface IArticleCreateResponse extends IResponse {
127
+ article: IArticle;
128
+ }
129
+ export interface IArticle {
130
+ id: number;
131
+ channel: IChannel;
132
+ author: IProfile;
133
+ payload: {
134
+ time: number;
135
+ blocks: IArticlePayloadBlock[];
136
+ };
137
+ vote: number;
138
+ repost_article: IArticle;
139
+ comment_count: number;
140
+ repost_count: number;
141
+ vote_count: number;
142
+ creation_date: number;
143
+ last_update_date: number;
144
+ is_deleted: boolean;
145
+ under_moderation_reason: string;
146
+ is_under_moderation: boolean;
147
+ }
148
+ export interface IChannelBlockManageRequest {
149
+ target_profile_id: number;
150
+ is_blocked: boolean;
151
+ reason: string | null;
152
+ expire_date: number | null;
153
+ is_reason_showing_enabled: boolean;
154
+ is_perm_blocked: boolean;
155
+ }
156
+ export interface IChannelBlockInfo {
157
+ "@id": number;
158
+ reason: string | null;
159
+ added_date: number;
160
+ expire_date: number | null;
161
+ is_reason_showing_enabled: boolean;
162
+ is_perm_blocked: boolean;
163
+ }
164
+ export interface IChannelBlockInfoResponse extends IResponse {
165
+ channel_block: IChannelBlockInfo | null;
166
+ }
167
+ export interface IChannelSearchRequest {
168
+ query: string;
169
+ permission: number;
170
+ is_blog: boolean;
171
+ is_subscibed: boolean;
172
+ }
173
+ export interface IArticleComment extends IBaseComment {
174
+ article: IArticle;
175
+ }
176
+ export interface IChannelMediaTokenResponse extends IResponse {
177
+ media_upload_token: string;
178
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,38 @@
1
+ import { IProfile } from "./profile";
2
+ import { IRelease } from "./release";
3
+ import { IResponse } from "./response";
4
+ import { IBaseRequestPageable } from "./request";
5
+ export interface ICollection {
6
+ '@id': string;
7
+ id: string;
8
+ creator: IProfile;
9
+ title: string;
10
+ description: string;
11
+ image: string;
12
+ creation_date: number;
13
+ last_update_date: number;
14
+ comment_count: number;
15
+ favorites_count: number;
16
+ is_private: boolean;
17
+ is_deleted: boolean;
18
+ is_favorite: boolean;
19
+ releases: IRelease[];
20
+ }
21
+ export interface ICollectionResponse extends IResponse {
22
+ collection: ICollection;
23
+ watching_count: number;
24
+ plan_count: number;
25
+ completed_count: number;
26
+ hold_on_count: number;
27
+ dropped_count: number;
28
+ }
29
+ export interface IReleaseInCollectionRequest extends IBaseRequestPageable {
30
+ id: number;
31
+ sort: number;
32
+ }
33
+ export interface ICollectionCreateRequest {
34
+ title: string;
35
+ description: string;
36
+ releases: number[];
37
+ is_private: boolean;
38
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ export * from "./response";
2
+ export * from "./profile";
3
+ export * from "./auth";
4
+ export * from "./request";
5
+ export * from "./release";
6
+ export * from "./settings";
7
+ export * from "./notification";
8
+ export * from "./collection";
9
+ export * from "./channel";
10
+ export type Writable<T> = {
11
+ -readonly [K in keyof T]: T[K];
12
+ };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./response"), exports);
18
+ __exportStar(require("./profile"), exports);
19
+ __exportStar(require("./auth"), exports);
20
+ __exportStar(require("./request"), exports);
21
+ __exportStar(require("./release"), exports);
22
+ __exportStar(require("./settings"), exports);
23
+ __exportStar(require("./notification"), exports);
24
+ __exportStar(require("./collection"), exports);
25
+ __exportStar(require("./channel"), exports);
@@ -0,0 +1,22 @@
1
+ import { IProfile } from "./profile";
2
+ import { IRelease } from "./release";
3
+ import { IResponse } from "./response";
4
+ export interface INotificationCountResponse extends IResponse {
5
+ count: number;
6
+ }
7
+ export interface IBaseNotification {
8
+ id: number;
9
+ type: string;
10
+ profile: IProfile;
11
+ timestamp: number;
12
+ is_pushed: boolean;
13
+ is_new: boolean;
14
+ }
15
+ export interface IFriendNotification extends IBaseNotification {
16
+ status: string;
17
+ by_profile: IProfile;
18
+ }
19
+ export interface IRelatedReleaseNotification extends IBaseNotification {
20
+ '@id': number;
21
+ release: IRelease | number;
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });