rubjs 2.8.7 → 2.8.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rubjs",
3
- "version": "2.8.7",
3
+ "version": "2.8.9",
4
4
  "main": "rubjs/index.js",
5
5
  "types": "rubjs/index.d.ts",
6
6
  "keywords": [
package/rubjs/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import Methods from "./methods";
2
2
  import Network from "./network";
3
3
  import SessionManager from "./session";
4
- import { VoiceChatClient } from "./utils";
4
+ import { VoiceChatClient } from "./clients";
5
5
  interface Platform {
6
6
  app_name: string;
7
7
  app_version: string;
@@ -0,0 +1,4 @@
1
+ import VoiceChatClient from "./VoiceChatClient";
2
+ import SendLiveClient from "./sendLiveClient";
3
+ import LoginClient from "./loginClient";
4
+ export { VoiceChatClient, SendLiveClient, LoginClient };
@@ -0,0 +1,12 @@
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.LoginClient = exports.SendLiveClient = exports.VoiceChatClient = void 0;
7
+ const VoiceChatClient_1 = __importDefault(require("./VoiceChatClient"));
8
+ exports.VoiceChatClient = VoiceChatClient_1.default;
9
+ const sendLiveClient_1 = __importDefault(require("./sendLiveClient"));
10
+ exports.SendLiveClient = sendLiveClient_1.default;
11
+ const loginClient_1 = __importDefault(require("./loginClient"));
12
+ exports.LoginClient = loginClient_1.default;
@@ -18,9 +18,20 @@ interface AuthFace {
18
18
  declare class LoginClient {
19
19
  static systemVersions: Record<string, string>;
20
20
  static sendCode(phone_number: string, pass_key?: string): Promise<AuthResult>;
21
- static signIn(phone_code: string, sessionPath: string, datas: AuthResult): Promise<{
21
+ static signIn(phone_code: string, datas: AuthResult, sessionPath?: string): Promise<{
22
22
  isOk: boolean;
23
23
  status: string;
24
+ sessionData?: undefined;
25
+ } | {
26
+ isOk: boolean;
27
+ status: string;
28
+ sessionData: {
29
+ phone: any;
30
+ auth: string;
31
+ guid: any;
32
+ agent: string;
33
+ private_key: any;
34
+ };
24
35
  }>;
25
36
  static registerDevice(network: Network, datas: AuthFace): Promise<void>;
26
37
  static getBrowser(userAgent: string, langCode: string, appVersion: string): Promise<{
@@ -40,7 +40,7 @@ class LoginClient {
40
40
  };
41
41
  });
42
42
  }
43
- static signIn(phone_code, sessionPath, datas) {
43
+ static signIn(phone_code, datas, sessionPath) {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
45
  const network = new loginNetwork_1.default();
46
46
  const [publicKey, privateKey] = crypto_1.default.createKeys();
@@ -63,22 +63,24 @@ class LoginClient {
63
63
  auth.key = Buffer.from(crypto_1.default.passphrase(sampleAuth), "utf8");
64
64
  auth.auth = sampleAuth;
65
65
  auth.decode_auth = crypto_1.default.decode_auth(sampleAuth);
66
- const session = new session_1.default(sessionPath);
67
- session.saveSession({
66
+ yield this.registerDevice(network, auth);
67
+ const sessionData = {
68
68
  phone: response.user.phone,
69
69
  auth: auth.auth,
70
70
  guid: response.user.user_guid,
71
71
  agent: network.userAgent,
72
72
  private_key: privateKey,
73
- });
74
- yield this.registerDevice(network, auth);
75
- return { isOk: true, status: "Sucessfull" };
73
+ };
74
+ if (sessionPath) {
75
+ const session = new session_1.default(sessionPath);
76
+ session.saveSession(sessionData);
77
+ }
78
+ return { isOk: true, status: "Sucessfull", sessionData };
76
79
  });
77
80
  }
78
81
  static registerDevice(network, datas) {
79
82
  return __awaiter(this, void 0, void 0, function* () {
80
83
  const browserData = yield this.getBrowser(network.userAgent, network.defaultPlatform.lang_code, network.defaultPlatform.app_version);
81
- const sendData = {};
82
84
  yield network.bulder("registerDevice", browserData, datas);
83
85
  });
84
86
  }
package/rubjs/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import Client from "./client";
2
2
  import Crypto from "./crypto";
3
3
  import * as Types from "./types";
4
- import { Filters, Utils, VoiceChatClient, SendLiveClient, LoginClient } from "./utils";
4
+ import { Filters, Utils } from "./utils";
5
+ import { VoiceChatClient, SendLiveClient, LoginClient } from "./clients";
5
6
  export default Client;
6
- export { Client, Crypto, Utils, VoiceChatClient, Filters, Types, SendLiveClient, LoginClient, };
7
+ export { Utils, Types, Crypto, Client, Filters, LoginClient, SendLiveClient, VoiceChatClient };
package/rubjs/index.js CHANGED
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.LoginClient = exports.SendLiveClient = exports.Types = exports.Filters = exports.VoiceChatClient = exports.Utils = exports.Crypto = exports.Client = void 0;
39
+ exports.VoiceChatClient = exports.SendLiveClient = exports.LoginClient = exports.Filters = exports.Client = exports.Crypto = exports.Types = exports.Utils = void 0;
40
40
  const client_1 = __importDefault(require("./client"));
41
41
  exports.Client = client_1.default;
42
42
  const crypto_1 = __importDefault(require("./crypto"));
@@ -46,7 +46,8 @@ exports.Types = Types;
46
46
  const utils_1 = require("./utils");
47
47
  Object.defineProperty(exports, "Filters", { enumerable: true, get: function () { return utils_1.Filters; } });
48
48
  Object.defineProperty(exports, "Utils", { enumerable: true, get: function () { return utils_1.Utils; } });
49
- Object.defineProperty(exports, "VoiceChatClient", { enumerable: true, get: function () { return utils_1.VoiceChatClient; } });
50
- Object.defineProperty(exports, "SendLiveClient", { enumerable: true, get: function () { return utils_1.SendLiveClient; } });
51
- Object.defineProperty(exports, "LoginClient", { enumerable: true, get: function () { return utils_1.LoginClient; } });
49
+ const clients_1 = require("./clients");
50
+ Object.defineProperty(exports, "VoiceChatClient", { enumerable: true, get: function () { return clients_1.VoiceChatClient; } });
51
+ Object.defineProperty(exports, "SendLiveClient", { enumerable: true, get: function () { return clients_1.SendLiveClient; } });
52
+ Object.defineProperty(exports, "LoginClient", { enumerable: true, get: function () { return clients_1.LoginClient; } });
52
53
  exports.default = client_1.default;
@@ -1,6 +1,3 @@
1
1
  import Filters from "./filters";
2
2
  import Utils from "./utils";
3
- import VoiceChatClient from "./VoiceChatClient";
4
- import SendLiveClient from "./sendLiveClient";
5
- import LoginClient from "./loginClient";
6
- export { Filters, Utils, VoiceChatClient, SendLiveClient, LoginClient };
3
+ export { Filters, Utils };
@@ -3,14 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LoginClient = exports.SendLiveClient = exports.VoiceChatClient = exports.Utils = exports.Filters = void 0;
6
+ exports.Utils = exports.Filters = void 0;
7
7
  const filters_1 = __importDefault(require("./filters"));
8
8
  exports.Filters = filters_1.default;
9
9
  const utils_1 = __importDefault(require("./utils"));
10
10
  exports.Utils = utils_1.default;
11
- const VoiceChatClient_1 = __importDefault(require("./VoiceChatClient"));
12
- exports.VoiceChatClient = VoiceChatClient_1.default;
13
- const sendLiveClient_1 = __importDefault(require("./sendLiveClient"));
14
- exports.SendLiveClient = sendLiveClient_1.default;
15
- const loginClient_1 = __importDefault(require("./loginClient"));
16
- exports.LoginClient = loginClient_1.default;
File without changes
File without changes
File without changes
File without changes