@30nama/sdk 1.0.0 → 1.0.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.
- package/dist/api/actions.d.ts +1 -384
- package/dist/api/actions.js +5 -520
- package/dist/api/actions.js.map +1 -1
- package/dist/api/index.js +7 -5
- package/dist/api/index.js.map +1 -1
- package/dist/api/request.d.ts +4 -4
- package/dist/api/request.js +2 -14
- package/dist/api/request.js.map +1 -1
- package/dist/api/services/videoContent.d.ts +0 -0
- package/dist/api/services/videoContent.js +6 -0
- package/dist/api/services/videoContent.js.map +1 -0
- package/dist/api/types.d.ts +13 -9
- package/dist/core.d.ts +1 -3
- package/dist/core.js +1 -37
- package/dist/core.js.map +1 -1
- package/dist/entities/IAttachment.d.ts +29 -0
- package/dist/entities/IAttachment.js +3 -0
- package/dist/entities/IAttachment.js.map +1 -0
- package/dist/entities/{ArchiveSlug.d.ts → ICollector.d.ts} +9 -9
- package/dist/entities/ICollector.js +3 -0
- package/dist/entities/ICollector.js.map +1 -0
- package/dist/entities/IPerson.d.ts +19 -0
- package/dist/entities/IPerson.js +3 -0
- package/dist/entities/IPerson.js.map +1 -0
- package/dist/entities/IRating.d.ts +9 -0
- package/dist/entities/IRating.js +3 -0
- package/dist/entities/IRating.js.map +1 -0
- package/dist/entities/IVideoContent.d.ts +59 -0
- package/dist/entities/IVideoContent.js +10 -0
- package/dist/entities/IVideoContent.js.map +1 -0
- package/dist/entities/index.d.ts +4 -53
- package/dist/entities/index.js +0 -31
- package/dist/entities/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/entities/ArchiveSlug.js +0 -13
- package/dist/entities/ArchiveSlug.js.map +0 -1
- package/dist/entities/ContinueWatchingTitle.d.ts +0 -12
- package/dist/entities/ContinueWatchingTitle.js +0 -11
- package/dist/entities/ContinueWatchingTitle.js.map +0 -1
- package/dist/entities/Download.d.ts +0 -31
- package/dist/entities/Download.js +0 -22
- package/dist/entities/Download.js.map +0 -1
- package/dist/entities/Downloadable.d.ts +0 -27
- package/dist/entities/Downloadable.js +0 -19
- package/dist/entities/Downloadable.js.map +0 -1
- package/dist/entities/Notification.d.ts +0 -15
- package/dist/entities/Notification.js +0 -18
- package/dist/entities/Notification.js.map +0 -1
- package/dist/entities/Person.d.ts +0 -23
- package/dist/entities/Person.js +0 -12
- package/dist/entities/Person.js.map +0 -1
- package/dist/entities/Plan.d.ts +0 -22
- package/dist/entities/Plan.js +0 -14
- package/dist/entities/Plan.js.map +0 -1
- package/dist/entities/PlayerData.d.ts +0 -37
- package/dist/entities/PlayerData.js +0 -14
- package/dist/entities/PlayerData.js.map +0 -1
- package/dist/entities/Single.d.ts +0 -52
- package/dist/entities/Single.js +0 -18
- package/dist/entities/Single.js.map +0 -1
- package/dist/entities/Stranger.d.ts +0 -5
- package/dist/entities/Stranger.js +0 -10
- package/dist/entities/Stranger.js.map +0 -1
- package/dist/entities/StreamData.d.ts +0 -53
- package/dist/entities/StreamData.js +0 -13
- package/dist/entities/StreamData.js.map +0 -1
- package/dist/entities/Title.d.ts +0 -103
- package/dist/entities/Title.js +0 -25
- package/dist/entities/Title.js.map +0 -1
- package/dist/entities/User.d.ts +0 -20
- package/dist/entities/User.js +0 -21
- package/dist/entities/User.js.map +0 -1
- package/dist/entities/UserLibrary.d.ts +0 -14
- package/dist/entities/UserLibrary.js +0 -12
- package/dist/entities/UserLibrary.js.map +0 -1
package/dist/api/actions.js
CHANGED
|
@@ -1,526 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
2
|
+
// import { API } from './types'
|
|
3
|
+
// import request from './request'
|
|
4
|
+
// import { } from '../entities'
|
|
11
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
const request_1 = require("./request");
|
|
14
|
-
const entities_1 = require("../entities");
|
|
15
|
-
/**
|
|
16
|
-
* @description Test connection to API endpoint
|
|
17
|
-
*/
|
|
6
|
+
exports.test = void 0;
|
|
18
7
|
function test() {
|
|
19
|
-
|
|
20
|
-
This.log('info', 'Running action: test');
|
|
21
|
-
const req = new request_1.default('test', this);
|
|
22
|
-
const response = req.execute();
|
|
23
|
-
return response;
|
|
8
|
+
console.log('test');
|
|
24
9
|
}
|
|
25
10
|
exports.test = test;
|
|
26
|
-
/**
|
|
27
|
-
* @returns Current session's user data
|
|
28
|
-
* @param {string} overrideSession Override current session token
|
|
29
|
-
*/
|
|
30
|
-
function user(overrideSession) {
|
|
31
|
-
const This = this;
|
|
32
|
-
This.log('info', 'Running action: user');
|
|
33
|
-
const req = new request_1.default('user', this, overrideSession);
|
|
34
|
-
const response = req.execute();
|
|
35
|
-
return response;
|
|
36
|
-
}
|
|
37
|
-
exports.user = user;
|
|
38
|
-
/**
|
|
39
|
-
* @description Terminates current session token
|
|
40
|
-
*/
|
|
41
|
-
function logout() {
|
|
42
|
-
const This = this;
|
|
43
|
-
This.log('info', 'Running action: logout');
|
|
44
|
-
const req = new request_1.default('logout', this);
|
|
45
|
-
const response = req.execute();
|
|
46
|
-
return response;
|
|
47
|
-
}
|
|
48
|
-
exports.logout = logout;
|
|
49
|
-
/**
|
|
50
|
-
* @returns a new session token for user
|
|
51
|
-
* @param {string} user_login Username, email or mobile number
|
|
52
|
-
* @param {string} user_password User Password
|
|
53
|
-
*/
|
|
54
|
-
function login(user_login, user_password, recaptcha_response) {
|
|
55
|
-
const This = this;
|
|
56
|
-
This.log('info', 'Running action: login');
|
|
57
|
-
const req = new request_1.default('login', this);
|
|
58
|
-
const response = req.execute({ user_login, user_password, recaptcha_response });
|
|
59
|
-
return response;
|
|
60
|
-
}
|
|
61
|
-
exports.login = login;
|
|
62
|
-
/**
|
|
63
|
-
* @description User authentication with email or mobile number (with OTP)
|
|
64
|
-
* @returns OTP options
|
|
65
|
-
* @param {string} user_login email or mobile number
|
|
66
|
-
*/
|
|
67
|
-
function otp(user_login, recaptcha_response) {
|
|
68
|
-
const This = this;
|
|
69
|
-
This.log('info', 'Running action: otp');
|
|
70
|
-
const req = new request_1.default('otp', this);
|
|
71
|
-
const response = req.execute({ user_login, recaptcha_response });
|
|
72
|
-
return response;
|
|
73
|
-
}
|
|
74
|
-
exports.otp = otp;
|
|
75
|
-
/**
|
|
76
|
-
* @description Verify user authentication with OTP
|
|
77
|
-
* @returns a new session token for user
|
|
78
|
-
* @param {string} user_login email or mobile number
|
|
79
|
-
* @param {string} user_code One time password
|
|
80
|
-
*/
|
|
81
|
-
function otp_verify(user_login, user_code) {
|
|
82
|
-
const This = this;
|
|
83
|
-
This.log('info', 'Running action: otp_verify');
|
|
84
|
-
const req = new request_1.default('otp_verify', this);
|
|
85
|
-
const response = req.execute({ user_login, user_code });
|
|
86
|
-
return response;
|
|
87
|
-
}
|
|
88
|
-
exports.otp_verify = otp_verify;
|
|
89
|
-
/**
|
|
90
|
-
* @returns auth_code and url
|
|
91
|
-
*/
|
|
92
|
-
function qrlogin_code() {
|
|
93
|
-
const This = this;
|
|
94
|
-
This.log('info', 'Running action: qrlogin_code');
|
|
95
|
-
const req = new request_1.default('qrlogin_code', this);
|
|
96
|
-
const response = req.execute();
|
|
97
|
-
return response;
|
|
98
|
-
}
|
|
99
|
-
exports.qrlogin_code = qrlogin_code;
|
|
100
|
-
/**
|
|
101
|
-
* @returns Checks if auth_code is authenticated and if so, returns session token
|
|
102
|
-
* @param {string} auth_code Authentication Code for QrLogin
|
|
103
|
-
*/
|
|
104
|
-
function qrlogin_login(auth_code) {
|
|
105
|
-
const This = this;
|
|
106
|
-
This.log('info', 'Running action: qrlogin_login');
|
|
107
|
-
const req = new request_1.default('qrlogin_login', this);
|
|
108
|
-
const response = req.execute({ auth_code });
|
|
109
|
-
return response;
|
|
110
|
-
}
|
|
111
|
-
exports.qrlogin_login = qrlogin_login;
|
|
112
|
-
/**
|
|
113
|
-
* Marks the auth_code as authenticated with current session
|
|
114
|
-
* @param {string} auth_code Authentication Code for QrLogin
|
|
115
|
-
*/
|
|
116
|
-
function qrlogin_auth(auth_code) {
|
|
117
|
-
const This = this;
|
|
118
|
-
This.log('info', 'Running action: qrlogin_auth');
|
|
119
|
-
const req = new request_1.default('qrlogin_auth', this);
|
|
120
|
-
return req.execute({ auth_code });
|
|
121
|
-
}
|
|
122
|
-
exports.qrlogin_auth = qrlogin_auth;
|
|
123
|
-
/**
|
|
124
|
-
* @returns Homepage data
|
|
125
|
-
*/
|
|
126
|
-
function home() {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
129
|
-
const This = this;
|
|
130
|
-
This.log('info', 'Running action: home');
|
|
131
|
-
const req = new request_1.default('home', this);
|
|
132
|
-
const response = (yield req.execute());
|
|
133
|
-
// Serialize posts
|
|
134
|
-
if ((_b = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.hero_header) === null || _b === void 0 ? void 0 : _b.posts)
|
|
135
|
-
response.result.hero_header.posts = response.result.hero_header.posts.map((post) => new entities_1.Title(post));
|
|
136
|
-
if ((_d = (_c = response === null || response === void 0 ? void 0 : response.result) === null || _c === void 0 ? void 0 : _c.new_releases) === null || _d === void 0 ? void 0 : _d.posts)
|
|
137
|
-
response.result.new_releases.posts = response.result.new_releases.posts.map((post) => new entities_1.Title(post));
|
|
138
|
-
if ((_f = (_e = response === null || response === void 0 ? void 0 : response.result) === null || _e === void 0 ? void 0 : _e.suggested) === null || _f === void 0 ? void 0 : _f.posts)
|
|
139
|
-
response.result.suggested.posts = response.result.suggested.posts.map((post) => new entities_1.Title(post));
|
|
140
|
-
if ((_h = (_g = response === null || response === void 0 ? void 0 : response.result) === null || _g === void 0 ? void 0 : _g.top_10) === null || _h === void 0 ? void 0 : _h.posts)
|
|
141
|
-
response.result.top_10.posts = response.result.top_10.posts.map((post) => new entities_1.Title(post));
|
|
142
|
-
if ((_k = (_j = response === null || response === void 0 ? void 0 : response.result) === null || _j === void 0 ? void 0 : _j.movies) === null || _k === void 0 ? void 0 : _k.posts)
|
|
143
|
-
response.result.movies.posts = response.result.movies.posts.map((post) => new entities_1.Title(post));
|
|
144
|
-
if ((_m = (_l = response === null || response === void 0 ? void 0 : response.result) === null || _l === void 0 ? void 0 : _l.series) === null || _m === void 0 ? void 0 : _m.posts)
|
|
145
|
-
response.result.series.posts = response.result.series.posts.map((post) => new entities_1.Title(post));
|
|
146
|
-
if ((_p = (_o = response === null || response === void 0 ? void 0 : response.result) === null || _o === void 0 ? void 0 : _o.anime) === null || _p === void 0 ? void 0 : _p.posts)
|
|
147
|
-
response.result.anime.posts = response.result.anime.posts.map((post) => new entities_1.Title(post));
|
|
148
|
-
return response;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
exports.home = home;
|
|
152
|
-
/**
|
|
153
|
-
* @returns Stream homepage data
|
|
154
|
-
*/
|
|
155
|
-
function home_stream() {
|
|
156
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
158
|
-
const This = this;
|
|
159
|
-
This.log('info', 'Running action: home_stream');
|
|
160
|
-
const req = new request_1.default('home_stream', this);
|
|
161
|
-
const response = (yield req.execute());
|
|
162
|
-
// Serialie posts
|
|
163
|
-
if ((_b = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.hero_header) === null || _b === void 0 ? void 0 : _b.posts)
|
|
164
|
-
response.result.hero_header.posts = response.result.hero_header.posts.map((post) => new entities_1.Title(post));
|
|
165
|
-
if ((_d = (_c = response === null || response === void 0 ? void 0 : response.result) === null || _c === void 0 ? void 0 : _c.suggested) === null || _d === void 0 ? void 0 : _d.posts)
|
|
166
|
-
response.result.suggested.posts = response.result.suggested.posts.map((post) => new entities_1.Title(post));
|
|
167
|
-
if ((_f = (_e = response === null || response === void 0 ? void 0 : response.result) === null || _e === void 0 ? void 0 : _e.movies) === null || _f === void 0 ? void 0 : _f.posts)
|
|
168
|
-
response.result.movies.posts = response.result.movies.posts.map((post) => new entities_1.Title(post));
|
|
169
|
-
if ((_h = (_g = response === null || response === void 0 ? void 0 : response.result) === null || _g === void 0 ? void 0 : _g.series) === null || _h === void 0 ? void 0 : _h.posts)
|
|
170
|
-
response.result.series.posts = response.result.series.posts.map((post) => new entities_1.Title(post));
|
|
171
|
-
if ((_k = (_j = response === null || response === void 0 ? void 0 : response.result) === null || _j === void 0 ? void 0 : _j.anime) === null || _k === void 0 ? void 0 : _k.posts)
|
|
172
|
-
response.result.anime.posts = response.result.anime.posts.map((post) => new entities_1.Title(post));
|
|
173
|
-
return response;
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
exports.home_stream = home_stream;
|
|
177
|
-
/**
|
|
178
|
-
* @returns Serialized data for a single post
|
|
179
|
-
* @param {number} post_id Post ID to get data for
|
|
180
|
-
*/
|
|
181
|
-
function single(post_id) {
|
|
182
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
-
const This = this;
|
|
184
|
-
This.log('info', 'Running action: single');
|
|
185
|
-
const req = new request_1.default('single', this);
|
|
186
|
-
const response = (yield req.execute({ post_id }));
|
|
187
|
-
if (response === null || response === void 0 ? void 0 : response.result)
|
|
188
|
-
response.result = new entities_1.Single(response.result);
|
|
189
|
-
return response;
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
exports.single = single;
|
|
193
|
-
/**
|
|
194
|
-
* @returns Categories and Genres for the menu
|
|
195
|
-
*/
|
|
196
|
-
function menu() {
|
|
197
|
-
const This = this;
|
|
198
|
-
This.log('info', 'Running action: menu');
|
|
199
|
-
const req = new request_1.default('menu', this);
|
|
200
|
-
const response = req.execute();
|
|
201
|
-
return response;
|
|
202
|
-
}
|
|
203
|
-
exports.menu = menu;
|
|
204
|
-
/**
|
|
205
|
-
* @returns Only post titles based on search query
|
|
206
|
-
* @param {string} query Search keyword, English/Farsi Title or IMDb ID
|
|
207
|
-
* @param {boolean} streamonly Only return streamable posts
|
|
208
|
-
* @param {number} page Search result page number
|
|
209
|
-
*/
|
|
210
|
-
function search(query, streamonly, page) {
|
|
211
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
-
var _a;
|
|
213
|
-
const This = this;
|
|
214
|
-
This.log('info', 'Running action: search');
|
|
215
|
-
const req = new request_1.default('search', this);
|
|
216
|
-
const response = (yield req.execute({ query, streamonly, page }));
|
|
217
|
-
if ((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.posts)
|
|
218
|
-
response.result.posts = response.result.posts.map((post) => new entities_1.Title(post));
|
|
219
|
-
return response;
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
exports.search = search;
|
|
223
|
-
/**
|
|
224
|
-
* @returns Post titles that user have been watching recently
|
|
225
|
-
*/
|
|
226
|
-
function continue_watching() {
|
|
227
|
-
const This = this;
|
|
228
|
-
This.log('info', 'Running action: continue_watching');
|
|
229
|
-
const req = new request_1.default('continue_watching', this);
|
|
230
|
-
const response = req.execute();
|
|
231
|
-
return response;
|
|
232
|
-
}
|
|
233
|
-
exports.continue_watching = continue_watching;
|
|
234
|
-
/**
|
|
235
|
-
* @description Removes a continue watching post
|
|
236
|
-
* @param {number} id Post ID
|
|
237
|
-
*/
|
|
238
|
-
function continue_watching_dismiss(id) {
|
|
239
|
-
const This = this;
|
|
240
|
-
This.log('info', 'Running action: continue_watching_dismiss');
|
|
241
|
-
const req = new request_1.default('continue_watching_dismiss', this);
|
|
242
|
-
const response = req.execute({ id });
|
|
243
|
-
return response;
|
|
244
|
-
}
|
|
245
|
-
exports.continue_watching_dismiss = continue_watching_dismiss;
|
|
246
|
-
/**
|
|
247
|
-
* @returns Stream data for a single post
|
|
248
|
-
* @param {number} post_id Post ID to get data for
|
|
249
|
-
* @param {boolean} free_stream Pass this parameter for free posts
|
|
250
|
-
*/
|
|
251
|
-
function stream(post_id, free_stream) {
|
|
252
|
-
const This = this;
|
|
253
|
-
This.log('info', 'Running action: stream');
|
|
254
|
-
const req = new request_1.default('stream', this);
|
|
255
|
-
const response = req.execute({ post_id, free_stream });
|
|
256
|
-
return response;
|
|
257
|
-
}
|
|
258
|
-
exports.stream = stream;
|
|
259
|
-
/**
|
|
260
|
-
* @returns Only post titles based on search query
|
|
261
|
-
* @param {string} slugs Category to search in
|
|
262
|
-
* @param {string} orderby Order by
|
|
263
|
-
* @param {boolean} streamonly Only return streamable posts
|
|
264
|
-
* @param {number} page Search result page number
|
|
265
|
-
*/
|
|
266
|
-
function archive(slugs_1, streamonly_1, page_1) {
|
|
267
|
-
return __awaiter(this, arguments, void 0, function* (slugs, streamonly, page, orderby = 'relevant', order = 'DESC') {
|
|
268
|
-
var _a;
|
|
269
|
-
const This = this;
|
|
270
|
-
This.log('info', 'Running action: archive');
|
|
271
|
-
const req = new request_1.default('archive', this);
|
|
272
|
-
const response = (yield req.execute({ slugs, streamonly, page, orderby, order }));
|
|
273
|
-
if ((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.posts)
|
|
274
|
-
response.result.posts = response.result.posts.map((post) => new entities_1.Title(post));
|
|
275
|
-
return response;
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
exports.archive = archive;
|
|
279
|
-
/**
|
|
280
|
-
* @returns Save current stream time for continue watching
|
|
281
|
-
* @param {number} post_id Current title ID
|
|
282
|
-
* @param {number} file_id Current source file ID
|
|
283
|
-
* @param {number} user_id User's ID
|
|
284
|
-
* @param {number} time Current time in seconds
|
|
285
|
-
* @param {number} duration Duration of the video in seconds
|
|
286
|
-
* @param {string} token HLS token
|
|
287
|
-
*/
|
|
288
|
-
function observer(post_id, file_id, user_id, time, duration, token) {
|
|
289
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
290
|
-
const This = this;
|
|
291
|
-
This.log('info', 'Running action: observer');
|
|
292
|
-
const req = new request_1.default('observer', this);
|
|
293
|
-
const response = (yield req.execute({ post_id, file_id, user_id, time, duration, token }));
|
|
294
|
-
return response;
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
exports.observer = observer;
|
|
298
|
-
/**
|
|
299
|
-
* @returns User notifications
|
|
300
|
-
* @param {number} page Page number `default: 1`
|
|
301
|
-
*/
|
|
302
|
-
function notification() {
|
|
303
|
-
return __awaiter(this, arguments, void 0, function* (page = 1) {
|
|
304
|
-
const This = this;
|
|
305
|
-
This.log('info', 'Running action: notification');
|
|
306
|
-
const req = new request_1.default('notification', this);
|
|
307
|
-
const response = (yield req.execute({ page }));
|
|
308
|
-
return response;
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
exports.notification = notification;
|
|
312
|
-
/**
|
|
313
|
-
* @description Mark a notification as read
|
|
314
|
-
* @param {number} notification_id Notification ID to mark as read (return `all` to mark all as read)
|
|
315
|
-
*/
|
|
316
|
-
function notification_read(notification_id) {
|
|
317
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
318
|
-
const This = this;
|
|
319
|
-
This.log('info', 'Running action: notification_read');
|
|
320
|
-
const req = new request_1.default('notification_read', this);
|
|
321
|
-
const response = (yield req.execute({ notification_id }));
|
|
322
|
-
return response;
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
exports.notification_read = notification_read;
|
|
326
|
-
/**
|
|
327
|
-
* @return Download links for a single post
|
|
328
|
-
* @param {number} post_id Post ID to get data for
|
|
329
|
-
* @param {boolean} free_download Pass this parameter for free posts
|
|
330
|
-
*/
|
|
331
|
-
function download(post_id, free_download) {
|
|
332
|
-
const This = this;
|
|
333
|
-
This.log('info', 'Running action: download');
|
|
334
|
-
const req = new request_1.default('download', this);
|
|
335
|
-
const response = req.execute({ post_id, free_download });
|
|
336
|
-
return response;
|
|
337
|
-
}
|
|
338
|
-
exports.download = download;
|
|
339
|
-
/**
|
|
340
|
-
* @returns Advanced search parameters
|
|
341
|
-
*/
|
|
342
|
-
function advanced_search_parameters() {
|
|
343
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
344
|
-
const This = this;
|
|
345
|
-
This.log('info', 'Running action: advanced_search_parameters');
|
|
346
|
-
const req = new request_1.default('advanced_search_parameters', this);
|
|
347
|
-
const response = (yield req.execute());
|
|
348
|
-
// Convert name keys to title
|
|
349
|
-
if (response === null || response === void 0 ? void 0 : response.result) {
|
|
350
|
-
for (const key in response.result) {
|
|
351
|
-
if (key === 'imdb_rate') {
|
|
352
|
-
response.result[key].forEach((item) => {
|
|
353
|
-
item.title = item.name.toString();
|
|
354
|
-
delete item.name;
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
else if (key === 'age' || key === 'encoder') {
|
|
358
|
-
response.result[key] = response.result[key].map((item) => {
|
|
359
|
-
return {
|
|
360
|
-
title: item,
|
|
361
|
-
value: item
|
|
362
|
-
};
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
const val = response.result[key];
|
|
367
|
-
if (!Array.isArray(val))
|
|
368
|
-
continue;
|
|
369
|
-
val.forEach((item) => {
|
|
370
|
-
item.title = item.name;
|
|
371
|
-
delete item.name;
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
return response;
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
exports.advanced_search_parameters = advanced_search_parameters;
|
|
380
|
-
/**
|
|
381
|
-
* @returns Post titles based on advanced search query
|
|
382
|
-
* @param {object} parameters Search filters
|
|
383
|
-
* @param {string} orderby Order by `default: relevant`
|
|
384
|
-
* @param {string} order Order `default: ASC`
|
|
385
|
-
* @param {number} page Search result page number
|
|
386
|
-
*/
|
|
387
|
-
function advanced_search(parameters, orderby = 'relevant', order = 'DESC', page = 1) {
|
|
388
|
-
const This = this;
|
|
389
|
-
This.log('info', 'Running action: advanced_search');
|
|
390
|
-
const req = new request_1.default('advanced_search', this);
|
|
391
|
-
const response = req.execute({ parameters: JSON.stringify(parameters), orderby, order, page });
|
|
392
|
-
return response;
|
|
393
|
-
}
|
|
394
|
-
exports.advanced_search = advanced_search;
|
|
395
|
-
/**
|
|
396
|
-
* @description Trigger logger by key
|
|
397
|
-
*/
|
|
398
|
-
function checks(key) {
|
|
399
|
-
const This = this;
|
|
400
|
-
This.log('info', 'Running action: checks');
|
|
401
|
-
const req = new request_1.default('checks', this);
|
|
402
|
-
const response = req.execute({ key });
|
|
403
|
-
return response;
|
|
404
|
-
}
|
|
405
|
-
exports.checks = checks;
|
|
406
|
-
/**
|
|
407
|
-
*
|
|
408
|
-
* @returns Stream servers host and ips
|
|
409
|
-
*
|
|
410
|
-
*/
|
|
411
|
-
function stream_servers() {
|
|
412
|
-
const This = this;
|
|
413
|
-
This.log('info', 'Running action: stream_servers');
|
|
414
|
-
const req = new request_1.default('stream_servers', this);
|
|
415
|
-
const response = req.execute();
|
|
416
|
-
return response;
|
|
417
|
-
}
|
|
418
|
-
exports.stream_servers = stream_servers;
|
|
419
|
-
/**
|
|
420
|
-
*
|
|
421
|
-
* @returns Pricing plans
|
|
422
|
-
* @param {string} gateway Payment gateway
|
|
423
|
-
* @param {string} discount_code Discount code
|
|
424
|
-
*
|
|
425
|
-
*/
|
|
426
|
-
function plans(gateway, discount_code) {
|
|
427
|
-
const This = this;
|
|
428
|
-
This.log('info', 'Running action: plans');
|
|
429
|
-
const req = new request_1.default('plans', this);
|
|
430
|
-
const response = req.execute({ gateway, discount_code });
|
|
431
|
-
return response;
|
|
432
|
-
}
|
|
433
|
-
exports.plans = plans;
|
|
434
|
-
/**
|
|
435
|
-
*
|
|
436
|
-
* @returns Shaparak gateway
|
|
437
|
-
* @param {string} plan_id plan id to buy (CTA id)
|
|
438
|
-
* @param {string} discount_code Discount code
|
|
439
|
-
*
|
|
440
|
-
*/
|
|
441
|
-
function shaparak(plan_id, discount_code) {
|
|
442
|
-
const This = this;
|
|
443
|
-
This.log('info', 'Running action: shaparak');
|
|
444
|
-
const req = new request_1.default('shaparak', this);
|
|
445
|
-
const response = req.execute({ plan_id, discount_code });
|
|
446
|
-
return response;
|
|
447
|
-
}
|
|
448
|
-
exports.shaparak = shaparak;
|
|
449
|
-
/**
|
|
450
|
-
*
|
|
451
|
-
* @returns Paypal gateway
|
|
452
|
-
* @param {string} plan_id plan id to buy (CTA id)
|
|
453
|
-
* @param {string} discount_code Discount code
|
|
454
|
-
*
|
|
455
|
-
*/
|
|
456
|
-
function paypal(plan_id, discount_code) {
|
|
457
|
-
const This = this;
|
|
458
|
-
This.log('info', 'Running action: paypal');
|
|
459
|
-
const req = new request_1.default('paypal', this);
|
|
460
|
-
const response = req.execute({ plan_id, discount_code });
|
|
461
|
-
return response;
|
|
462
|
-
}
|
|
463
|
-
exports.paypal = paypal;
|
|
464
|
-
/**
|
|
465
|
-
* @returns User full library
|
|
466
|
-
*/
|
|
467
|
-
function user_mylist() {
|
|
468
|
-
const This = this;
|
|
469
|
-
This.log('info', 'Running action: user_mylist');
|
|
470
|
-
const req = new request_1.default('user_mylist', this);
|
|
471
|
-
const response = req.execute();
|
|
472
|
-
return response;
|
|
473
|
-
}
|
|
474
|
-
exports.user_mylist = user_mylist;
|
|
475
|
-
/**
|
|
476
|
-
* @returns User list titles
|
|
477
|
-
* @param {string} group List type
|
|
478
|
-
* @param {string} orderby Order by `default: add_list`
|
|
479
|
-
* @param {string} order Order `default: ASC`
|
|
480
|
-
* @param {number} page Search result page number
|
|
481
|
-
*/
|
|
482
|
-
function user_list(group, page = 1, orderby = 'add_list', order = 'DESC') {
|
|
483
|
-
const This = this;
|
|
484
|
-
This.log('info', 'Running action: user_list');
|
|
485
|
-
const req = new request_1.default('user_list', this);
|
|
486
|
-
const response = req.execute({ action: 'list', group, page, orderby, order });
|
|
487
|
-
return response;
|
|
488
|
-
}
|
|
489
|
-
exports.user_list = user_list;
|
|
490
|
-
/**
|
|
491
|
-
* @returns Wether item added or removed from list
|
|
492
|
-
* @param {string} group List type
|
|
493
|
-
* @param {number} post_id Post id
|
|
494
|
-
*/
|
|
495
|
-
function user_list_toggle(group, post_id) {
|
|
496
|
-
const This = this;
|
|
497
|
-
This.log('info', 'Running action: user_list (toggle)');
|
|
498
|
-
const req = new request_1.default('user_list', this);
|
|
499
|
-
const response = req.execute({ action: 'add', group, post_id });
|
|
500
|
-
return response;
|
|
501
|
-
}
|
|
502
|
-
exports.user_list_toggle = user_list_toggle;
|
|
503
|
-
/**
|
|
504
|
-
* @description Apply voucher code to user account
|
|
505
|
-
* @param {string} voucher_code Voucher code
|
|
506
|
-
*/
|
|
507
|
-
function voucher(voucher_code) {
|
|
508
|
-
const This = this;
|
|
509
|
-
This.log('info', 'Running action: voucher');
|
|
510
|
-
const req = new request_1.default('voucher', this);
|
|
511
|
-
const response = req.execute({ voucher_code });
|
|
512
|
-
return response;
|
|
513
|
-
}
|
|
514
|
-
exports.voucher = voucher;
|
|
515
|
-
/**
|
|
516
|
-
* @returns Offer details if available
|
|
517
|
-
*/
|
|
518
|
-
function offer() {
|
|
519
|
-
const This = this;
|
|
520
|
-
This.log('info', 'Running action: offer');
|
|
521
|
-
const req = new request_1.default('offer', this);
|
|
522
|
-
const response = req.execute();
|
|
523
|
-
return response;
|
|
524
|
-
}
|
|
525
|
-
exports.offer = offer;
|
|
526
11
|
//# sourceMappingURL=actions.js.map
|
package/dist/api/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/api/actions.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,uCAA+B;AAC/B,0CAAwJ;AAExJ;;GAEG;AACH,SAAgB,IAAI;IAChB,MAAM,IAAI,GAAG,IAAW,CAAA;IACxB,IAAI,CAAC,GAAG,CA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,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC,CAAA;IAC9C,OAAO,QAAoD,CAAA;AAC/D,CAAC;AAND,0BAMC;AAED;;GAEG;AACH,SAAgB,KAAK;IACjB,MAAM,IAAI,GAAG,IAAW,CAAA;IACxB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IACzC,MAAM,GAAG,GAAG,IAAI,iBAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IACtC,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,CAAA;IAS9B,OAAO,QAAgD,CAAA;AAC3D,CAAC;AAdD,sBAcC"}
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/api/actions.ts"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,kCAAkC;AAClC,iCAAiC;;;AAEjC,SAAgB,IAAI;IAChB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACvB,CAAC;AAFD,oBAEC"}
|
package/dist/api/index.js
CHANGED
|
@@ -46,7 +46,7 @@ exports.API = {
|
|
|
46
46
|
const testRes = yield testReq.execute();
|
|
47
47
|
if (!testRes)
|
|
48
48
|
return;
|
|
49
|
-
if (!testRes.
|
|
49
|
+
if (!testRes.result)
|
|
50
50
|
return;
|
|
51
51
|
return host;
|
|
52
52
|
}
|
|
@@ -70,9 +70,11 @@ exports.API = {
|
|
|
70
70
|
// Node 1
|
|
71
71
|
const getEndpointsFromAPI = () => __awaiter(this, void 0, void 0, function* () {
|
|
72
72
|
try {
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
73
|
+
// TODO: Implement this
|
|
74
|
+
// const getEndpointsReq = new request('endpoint', this)
|
|
75
|
+
// const endpointsRes = await (getEndpointsReq.execute() as Promise<BaseResponse<Endpoints> | undefined>)
|
|
76
|
+
// return endpointsRes?. as { location: string; host: string }[]
|
|
77
|
+
return [];
|
|
76
78
|
}
|
|
77
79
|
catch (err) {
|
|
78
80
|
this.log('warn', '(getEndpointsFromAPI)', err);
|
|
@@ -111,7 +113,7 @@ exports.API = {
|
|
|
111
113
|
// Try current endpoint, if it's valid, return true
|
|
112
114
|
const testReq = new request_1.default('test', this);
|
|
113
115
|
const testRes = yield testReq.execute(undefined, 1000 * 15);
|
|
114
|
-
if (testRes === null || testRes === void 0 ? void 0 : testRes.
|
|
116
|
+
if (testRes === null || testRes === void 0 ? void 0 : testRes.result)
|
|
115
117
|
return true;
|
|
116
118
|
const endpoints = yield getFastestResponse([getEndpointsFromAPI(), getEndpointsFromGithub(), getEndpointsFromArvanCloud()]);
|
|
117
119
|
if (!endpoints || !(yield this.useTransferEndpoint(endpoints)))
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoC;AACpC,uCAA+B;AAC/B,uCAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoC;AACpC,uCAA+B;AAC/B,uCAAiC;AAYjC,MAAM,kBAAkB,GAAG,CAAI,QAAwB,EAAc,EAAE;IACnE,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAe,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;IAC/H,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IACzD,OAAO,OAAO,CAAC,IA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IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;oBAAE,MAAM,0BAA0B,CAAA;gBAChG,OAAO,IAAI,CAAA;YACf,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACX,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;gBACrB,OAAO,KAAK,CAAA;YAChB,CAAC;QACL,CAAC;KAAA;CASgB,CAAA;AAErB,uEAAuE;AACvE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;IAAG,WAAG,CAAC,OAAe,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,WAAU,CAAC,CAAA"}
|
package/dist/api/request.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { API,
|
|
1
|
+
import { API, BaseResponse } from './types';
|
|
2
2
|
export type RequestHeaders = Record<string, string | number | boolean>;
|
|
3
3
|
export default class {
|
|
4
|
-
private token;
|
|
5
4
|
private overrideSession?;
|
|
6
5
|
private config;
|
|
7
6
|
private actionUrl;
|
|
7
|
+
private servicePath;
|
|
8
8
|
private emmiter;
|
|
9
9
|
private store;
|
|
10
10
|
private log;
|
|
@@ -12,7 +12,7 @@ export default class {
|
|
|
12
12
|
private buildUrl;
|
|
13
13
|
private buildHeaders;
|
|
14
14
|
private sendRequest;
|
|
15
|
-
execute(body?: {
|
|
15
|
+
execute<T>(body?: {
|
|
16
16
|
[key: string]: any;
|
|
17
|
-
}, timeout?: number): Promise<
|
|
17
|
+
}, timeout?: number): Promise<BaseResponse<T> | undefined>;
|
|
18
18
|
}
|