ayiin 1.0.25 → 2.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.
- package/.github/CODEOWNERS +1 -0
- package/.github/FUNDING.yml +3 -0
- package/.github/workflows/npm.yaml +23 -0
- package/LICENSE +674 -674
- package/README.md +28 -28
- package/ayiin/index.d.ts +5 -14
- package/ayiin/index.js +5 -77
- package/ayiin/methods/crypt.d.ts +38 -0
- package/ayiin/methods/crypt.js +79 -0
- package/ayiin/methods/index.d.ts +65 -0
- package/ayiin/methods/index.js +75 -0
- package/ayiin/methods/mailer.d.ts +18 -0
- package/ayiin/methods/mailer.js +58 -0
- package/ayiin/methods/tools.d.ts +17 -0
- package/ayiin/methods/tools.js +34 -0
- package/ayiin/types/options.d.ts +4 -0
- package/ayiin/types/sendMail.d.ts +5 -0
- package/ayiin/types/{video.js → sendMail.js} +0 -1
- package/package.json +27 -14
- package/tsconfig.json +18 -18
- package/ayiin/base.d.ts +0 -14
- package/ayiin/base.js +0 -77
- package/ayiin/types/provider.d.ts +0 -1
- package/ayiin/types/response.d.ts +0 -12
- package/ayiin/types/response.js +0 -4
- package/ayiin/types/video.d.ts +0 -25
- package/ayiin/types/videos.d.ts +0 -9
- package/ayiin/types/videos.js +0 -3
- /package/ayiin/types/{provider.js → options.js} +0 -0
package/ayiin/base.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance } from "axios";
|
|
2
|
-
import { Response, ResponseAxios } from "./types/response";
|
|
3
|
-
import { Provider } from "./types/provider";
|
|
4
|
-
type TypeField = "json" | "stream";
|
|
5
|
-
declare class Base {
|
|
6
|
-
api: AxiosInstance;
|
|
7
|
-
baseUrl: string;
|
|
8
|
-
basePath: string;
|
|
9
|
-
constructor(apiToken: string, basePath?: string);
|
|
10
|
-
post: (provider: Provider, url: string) => Promise<Response>;
|
|
11
|
-
get: (url: string, type?: TypeField) => Promise<ResponseAxios>;
|
|
12
|
-
validatePath: (autoClean?: boolean) => void;
|
|
13
|
-
}
|
|
14
|
-
export default Base;
|
package/ayiin/base.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
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
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const fs_1 = __importDefault(require("fs"));
|
|
16
|
-
const path_1 = __importDefault(require("path"));
|
|
17
|
-
const axios_1 = __importDefault(require("axios"));
|
|
18
|
-
class Base {
|
|
19
|
-
constructor(apiToken, basePath) {
|
|
20
|
-
this.baseUrl = "https://ayiinhub.vercel.app/api";
|
|
21
|
-
this.post = (provider, url) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const res = yield this.api.post(`${provider}/${url}`);
|
|
23
|
-
const data = res.data;
|
|
24
|
-
if (data.success) {
|
|
25
|
-
return data;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
throw new Error(data.message);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
this.get = (url, type) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
if (type && type === "stream") {
|
|
33
|
-
const res = yield this.api.get(url, {
|
|
34
|
-
responseType: "stream"
|
|
35
|
-
});
|
|
36
|
-
const response = {
|
|
37
|
-
success: true,
|
|
38
|
-
message: "success",
|
|
39
|
-
response: res
|
|
40
|
-
};
|
|
41
|
-
return response;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
const res = yield this.api.get(url);
|
|
45
|
-
const data = res.data;
|
|
46
|
-
if (data.success) {
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
throw new Error(data.message);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
this.validatePath = (autoClean) => {
|
|
55
|
-
if (!fs_1.default.existsSync(this.basePath)) {
|
|
56
|
-
fs_1.default.mkdirSync(this.basePath);
|
|
57
|
-
}
|
|
58
|
-
;
|
|
59
|
-
if (autoClean) {
|
|
60
|
-
const files = fs_1.default.readdirSync(this.basePath);
|
|
61
|
-
files.forEach(file => {
|
|
62
|
-
fs_1.default.unlinkSync(path_1.default.join(this.basePath, file));
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
this.api = axios_1.default.create({
|
|
67
|
-
baseURL: `${this.baseUrl}`,
|
|
68
|
-
headers: {
|
|
69
|
-
"Authorization": `Bearer ${apiToken}`,
|
|
70
|
-
"Content-Type": "application/json",
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
this.basePath = basePath !== null && basePath !== void 0 ? basePath : "downloads";
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
;
|
|
77
|
-
exports.default = Base;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Provider = "xnxx" | "xvideos";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AxiosResponse } from "axios";
|
|
2
|
-
export interface Response {
|
|
3
|
-
success: boolean;
|
|
4
|
-
message: string;
|
|
5
|
-
result?: any;
|
|
6
|
-
}
|
|
7
|
-
export interface ResponseAxios<AR extends AxiosResponse = AxiosResponse<any, any>> {
|
|
8
|
-
response: AR;
|
|
9
|
-
success: boolean;
|
|
10
|
-
message: string;
|
|
11
|
-
result?: any;
|
|
12
|
-
}
|
package/ayiin/types/response.js
DELETED
package/ayiin/types/video.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
interface Assets {
|
|
2
|
-
embed: string;
|
|
3
|
-
thumbnail: string;
|
|
4
|
-
bigimg: string;
|
|
5
|
-
video: string;
|
|
6
|
-
}
|
|
7
|
-
interface Data {
|
|
8
|
-
title: string;
|
|
9
|
-
id: string;
|
|
10
|
-
image: string;
|
|
11
|
-
duration: string;
|
|
12
|
-
views: string;
|
|
13
|
-
rating: string;
|
|
14
|
-
uploaded: string;
|
|
15
|
-
upvoted: string;
|
|
16
|
-
downvoted: string;
|
|
17
|
-
models: Array<string>;
|
|
18
|
-
tags: Array<string>;
|
|
19
|
-
}
|
|
20
|
-
export interface Video {
|
|
21
|
-
data: Data;
|
|
22
|
-
source: string;
|
|
23
|
-
assets: Assets;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
package/ayiin/types/videos.d.ts
DELETED
package/ayiin/types/videos.js
DELETED
|
File without changes
|