ravejs 1.16.13 → 1.17.13
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/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -2
- package/dist/factories/mesh-factory.d.ts +1 -0
- package/dist/factories/mesh-factory.d.ts.map +1 -1
- package/dist/factories/mesh-factory.js +13 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +4 -2
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { APIErrorData } from './schemas/error';
|
|
2
|
-
export declare const VERSION = "1.
|
|
2
|
+
export declare const VERSION = "1.17.13";
|
|
3
3
|
export declare const SYMBOLS = "0123456789abcdef";
|
|
4
4
|
export declare const API_URL = "https://api1.a-l-p-a.com";
|
|
5
5
|
export declare const PARSE_API_URL = "https://api3.a-l-p-a.com";
|
|
6
6
|
export declare const EVENTS_API_URL = "https://api2.a-l-p-a.com/api";
|
|
7
7
|
export declare const WE_MESH_API_URL = "https://wallace2.red.wemesh.ca";
|
|
8
8
|
export declare const MOJO_AUTH_URL = "https://api.mojoauth.com";
|
|
9
|
+
export declare const RAVE_LINK_URL = "https://rave.link";
|
|
9
10
|
export declare const HASH_SECRET = "c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2";
|
|
10
11
|
export declare const DEFAULT_LANGUAGE = "ru";
|
|
11
12
|
export declare const UUID_PATTERN = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/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W,qEAC4C,CAAC;AACrE,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,YAAY,yCAAyC,CAAC;AACnE,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAIvC,eAAO,MAAM,WAAW;;;;;;;;CASvB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CAyB1B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;CAwB3B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;CAU/B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAyBlD,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CODES_MAP = exports.PARSE_USERS_HEADERS = exports.PATCHED_IP_DATA = exports.PATCHED_DEVICE = exports.MOJO_AUTH_HEADERS = exports.API_HEADERS = exports.SOCKET_PING_DELAY = exports.UUID_PATTERN = exports.DEFAULT_LANGUAGE = exports.HASH_SECRET = exports.MOJO_AUTH_URL = exports.WE_MESH_API_URL = exports.EVENTS_API_URL = exports.PARSE_API_URL = exports.API_URL = exports.SYMBOLS = exports.VERSION = void 0;
|
|
3
|
+
exports.CODES_MAP = exports.PARSE_USERS_HEADERS = exports.PATCHED_IP_DATA = exports.PATCHED_DEVICE = exports.MOJO_AUTH_HEADERS = exports.API_HEADERS = exports.SOCKET_PING_DELAY = exports.UUID_PATTERN = exports.DEFAULT_LANGUAGE = exports.HASH_SECRET = exports.RAVE_LINK_URL = exports.MOJO_AUTH_URL = exports.WE_MESH_API_URL = exports.EVENTS_API_URL = exports.PARSE_API_URL = exports.API_URL = exports.SYMBOLS = exports.VERSION = void 0;
|
|
4
4
|
// Constants
|
|
5
|
-
exports.VERSION = '1.
|
|
5
|
+
exports.VERSION = '1.17.13';
|
|
6
6
|
exports.SYMBOLS = '0123456789abcdef';
|
|
7
7
|
exports.API_URL = 'https://api1.a-l-p-a.com';
|
|
8
8
|
exports.PARSE_API_URL = 'https://api3.a-l-p-a.com';
|
|
9
9
|
exports.EVENTS_API_URL = 'https://api2.a-l-p-a.com/api';
|
|
10
10
|
exports.WE_MESH_API_URL = 'https://wallace2.red.wemesh.ca';
|
|
11
11
|
exports.MOJO_AUTH_URL = 'https://api.mojoauth.com';
|
|
12
|
+
exports.RAVE_LINK_URL = 'https://rave.link';
|
|
12
13
|
exports.HASH_SECRET = 'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2';
|
|
13
14
|
exports.DEFAULT_LANGUAGE = 'ru';
|
|
14
15
|
exports.UUID_PATTERN = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
|
@@ -8,6 +8,7 @@ export declare class MeshFactory {
|
|
|
8
8
|
private readonly __http;
|
|
9
9
|
private readonly __account;
|
|
10
10
|
constructor(config: RaveConfig | undefined, http: HttpWorkflow, account: Account);
|
|
11
|
+
private __getRaveLink;
|
|
11
12
|
get: (meshId: string) => Promise<GetMeshResponse>;
|
|
12
13
|
getByLink: (meshLink: string) => Promise<GetMeshResponse>;
|
|
13
14
|
getMany: (params?: GetManyMeshesParams) => Promise<GetManyMeshesResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-factory.d.ts","sourceRoot":"","sources":["../../src/factories/mesh-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mesh-factory.d.ts","sourceRoot":"","sources":["../../src/factories/mesh-factory.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EACL,qBAAqB,EAErB,eAAe,EAIhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;gBAExB,MAAM,EAAE,UAAU,YAAK,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO;IAMzE,OAAO,CAAC,aAAa,CAYnB;IAEK,GAAG,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,eAAe,CAAC,CAO3D;IAEK,SAAS,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,eAAe,CAAC,CAOnE;IAEK,OAAO,GACZ,SAAQ,mBAIP,KACA,OAAO,CAAC,qBAAqB,CAAC,CAO/B;IAEK,IAAI,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,UAAU,CAAC,CA0CvD;CACH"}
|
|
@@ -4,25 +4,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.MeshFactory = void 0;
|
|
7
|
-
const
|
|
7
|
+
const undici_1 = require("undici");
|
|
8
8
|
const crypto_1 = require("crypto");
|
|
9
|
+
const zod_1 = __importDefault(require("zod"));
|
|
9
10
|
const constants_1 = require("../constants");
|
|
10
11
|
const responses_1 = require("../schemas/responses");
|
|
11
12
|
const utils_1 = require("../utils/utils");
|
|
12
13
|
const mesh_socket_1 = require("../core/mesh-socket");
|
|
13
14
|
class MeshFactory {
|
|
14
15
|
constructor(config = {}, http, account) {
|
|
16
|
+
this.__getRaveLink = async (meshLink) => {
|
|
17
|
+
const meshId = (0, utils_1.matchMeshId)(await this.__http.sendRaw({
|
|
18
|
+
method: 'GET',
|
|
19
|
+
path: meshLink,
|
|
20
|
+
}, zod_1.default.string()));
|
|
21
|
+
return await this.get(meshId);
|
|
22
|
+
};
|
|
15
23
|
this.get = async (meshId) => {
|
|
16
24
|
return await this.__http.sendGet({
|
|
17
25
|
path: `/meshes/${meshId}`,
|
|
18
26
|
}, responses_1.GetMeshSchema);
|
|
19
27
|
};
|
|
20
28
|
this.getByLink = async (meshLink) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return await this.get(meshId);
|
|
29
|
+
if (meshLink.startsWith(constants_1.RAVE_LINK_URL))
|
|
30
|
+
return await this.__getRaveLink(meshLink);
|
|
31
|
+
const { headers } = await (0, undici_1.request)(meshLink);
|
|
32
|
+
return await this.get((0, utils_1.parseMeshId)(headers.location));
|
|
26
33
|
};
|
|
27
34
|
this.getMany = async (params = {
|
|
28
35
|
limit: 20,
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC"}
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SocksProxies } from 'fetch-socks';
|
|
2
2
|
export declare const isOk: (status: number) => boolean;
|
|
3
3
|
export declare const matchMeshId: (text: string) => string;
|
|
4
|
+
export declare const parseMeshId: (text: string) => string;
|
|
4
5
|
export declare const validateProxy: (proxy: string) => SocksProxies;
|
|
5
6
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,YAAkC,CAAC;AACtE,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAG7B,CAAC;AAEf,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,YAwB7C,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,YAAkC,CAAC;AACtE,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAG7B,CAAC;AAEf,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MACZ,CAAC;AAEhC,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,YAwB7C,CAAC"}
|
package/dist/utils/utils.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateProxy = exports.matchMeshId = exports.isOk = void 0;
|
|
4
|
-
const isOk = (status) => status >= 200 && status <
|
|
3
|
+
exports.validateProxy = exports.parseMeshId = exports.matchMeshId = exports.isOk = void 0;
|
|
4
|
+
const isOk = (status) => status >= 200 && status < 303;
|
|
5
5
|
exports.isOk = isOk;
|
|
6
6
|
const matchMeshId = (text) => {
|
|
7
7
|
var _a;
|
|
8
8
|
return ((_a = text.match(/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi)) === null || _a === void 0 ? void 0 : _a[0]) || '';
|
|
9
9
|
};
|
|
10
10
|
exports.matchMeshId = matchMeshId;
|
|
11
|
+
const parseMeshId = (text) => text.split('openRaveId=')[1];
|
|
12
|
+
exports.parseMeshId = parseMeshId;
|
|
11
13
|
const validateProxy = (proxy) => {
|
|
12
14
|
const match = proxy.match(/socks([45])/);
|
|
13
15
|
if (proxy.includes('@')) {
|