rettiwt-api 1.0.5 → 1.0.6
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/README.md +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/queries/RootQuery.js +11 -0
- package/dist/queries/RootQuery.js.map +1 -1
- package/dist/resolvers/AccountResolver.d.ts +12 -0
- package/dist/resolvers/AccountResolver.js +84 -0
- package/dist/resolvers/AccountResolver.js.map +1 -0
- package/dist/server.js +3 -1
- package/dist/server.js.map +1 -1
- package/dist/services/AccountsService.d.ts +17 -0
- package/dist/services/AccountsService.js +171 -0
- package/dist/services/AccountsService.js.map +1 -0
- package/dist/services/FetcherService.d.ts +11 -2
- package/dist/services/FetcherService.js +47 -23
- package/dist/services/FetcherService.js.map +1 -1
- package/dist/services/accounting/AccountsService.d.ts +20 -0
- package/dist/services/accounting/AccountsService.js +147 -0
- package/dist/services/accounting/AccountsService.js.map +1 -0
- package/dist/services/accounting/Flows.d.ts +0 -0
- package/dist/services/accounting/Flows.js +2 -0
- package/dist/services/accounting/Flows.js.map +1 -0
- package/dist/services/accounting/LoginFlows.d.ts +20 -0
- package/dist/services/accounting/LoginFlows.js +70 -0
- package/dist/services/accounting/LoginFlows.js.map +1 -0
- package/dist/services/accounts/AccountService.d.ts +42 -0
- package/dist/services/accounts/AccountService.js +291 -0
- package/dist/services/accounts/AccountService.js.map +1 -0
- package/dist/services/accounts/LoginFlows.d.ts +77 -0
- package/dist/services/accounts/LoginFlows.js +92 -0
- package/dist/services/accounts/LoginFlows.js.map +1 -0
- package/dist/services/helper/Headers.d.ts +11 -1
- package/dist/services/helper/Headers.js +28 -2
- package/dist/services/helper/Headers.js.map +1 -1
- package/dist/types/HTTP.d.ts +0 -7
- package/dist/types/HTTP.js +1 -10
- package/dist/types/HTTP.js.map +1 -1
- package/dist/types/Service.d.ts +2 -0
- package/dist/types/Service.js.map +1 -1
- package/package.json +4 -2
- package/src/index.ts +3 -1
- package/src/queries/RootQuery.ts +11 -0
- package/src/resolvers/AccountResolver.ts +22 -0
- package/src/server.ts +3 -1
- package/src/services/FetcherService.ts +26 -8
- package/src/services/accounts/AccountService.ts +156 -0
- package/src/services/accounts/LoginFlows.ts +90 -0
- package/src/services/helper/Headers.ts +27 -1
- package/src/types/HTTP.ts +0 -8
- package/src/types/Service.ts +3 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.__esModule = true;
|
|
54
|
+
exports.AccountsService = void 0;
|
|
55
|
+
// CUSTOM LIBS
|
|
56
|
+
// SERVICES
|
|
57
|
+
var AuthService_1 = require("../AuthService");
|
|
58
|
+
var FetcherService_1 = require("../FetcherService");
|
|
59
|
+
var HTTP_1 = require("../../types/HTTP");
|
|
60
|
+
// HELPERS
|
|
61
|
+
var LoginFlows_1 = require("./LoginFlows");
|
|
62
|
+
/**
|
|
63
|
+
* The service that handles all operations related to accounting
|
|
64
|
+
*/
|
|
65
|
+
var AccountsService = /** @class */ (function (_super) {
|
|
66
|
+
__extends(AccountsService, _super);
|
|
67
|
+
function AccountsService() {
|
|
68
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
69
|
+
}
|
|
70
|
+
// MEMBER METHODS
|
|
71
|
+
/**
|
|
72
|
+
* @returns The response from Twitter after execution of the given flow
|
|
73
|
+
* @param flow The flow to be executed against Twitter API
|
|
74
|
+
* @param guestCredentials The guest credentials to use for making HTTP request
|
|
75
|
+
*/
|
|
76
|
+
AccountsService.prototype.executeFlow = function (flow, guestCredentials) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
var res, data;
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
switch (_a.label) {
|
|
81
|
+
case 0: return [4 /*yield*/, this.request(flow.url, HTTP_1.HttpMethods.POST, flow.body, HTTP_1.AuthType.GUEST, guestCredentials)["catch"](function (err) {
|
|
82
|
+
// Getting the list of errors
|
|
83
|
+
var errors = err.response.data.errors;
|
|
84
|
+
throw new Error(errors[0].message);
|
|
85
|
+
})];
|
|
86
|
+
case 1:
|
|
87
|
+
res = _a.sent();
|
|
88
|
+
data = res.data;
|
|
89
|
+
// Returning the response body as well as data of the flow
|
|
90
|
+
return [2 /*return*/, {
|
|
91
|
+
headers: res.headers,
|
|
92
|
+
nextFlowName: LoginFlows_1.LoginFlows[data['subtasks'][0]['subtask_id']],
|
|
93
|
+
nextFlowToken: data['flow_token']
|
|
94
|
+
}];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* @summary Logins into the given account and stores the cookies and store logged in credentials to database
|
|
101
|
+
* @returns The logged in account's cookies and other credentials
|
|
102
|
+
* @param cred The login credentials of the Twitter account to be logged into
|
|
103
|
+
*/
|
|
104
|
+
AccountsService.prototype.login = function (cred) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
var currentFlowName, currentFlow, guestCredentials, res;
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
switch (_a.label) {
|
|
109
|
+
case 0:
|
|
110
|
+
currentFlowName = LoginFlows_1.LoginFlows.Login;
|
|
111
|
+
currentFlow = (0, LoginFlows_1.generateLoginFlow)(cred, '', LoginFlows_1.LoginFlows.Login);
|
|
112
|
+
return [4 /*yield*/, AuthService_1.AuthService.getInstance()];
|
|
113
|
+
case 1: return [4 /*yield*/, (_a.sent()).getGuestCredentials(true)];
|
|
114
|
+
case 2:
|
|
115
|
+
guestCredentials = _a.sent();
|
|
116
|
+
_a.label = 3;
|
|
117
|
+
case 3:
|
|
118
|
+
if (!true) return [3 /*break*/, 9];
|
|
119
|
+
return [4 /*yield*/, this.executeFlow(currentFlow, guestCredentials)];
|
|
120
|
+
case 4:
|
|
121
|
+
res = _a.sent();
|
|
122
|
+
if (!(currentFlowName == LoginFlows_1.LoginFlows.AccountDuplicationCheck)) return [3 /*break*/, 7];
|
|
123
|
+
return [4 /*yield*/, AuthService_1.AuthService.getInstance()];
|
|
124
|
+
case 5:
|
|
125
|
+
// Storing credentials in database
|
|
126
|
+
return [4 /*yield*/, (_a.sent()).storeCredentials(res.headers)];
|
|
127
|
+
case 6:
|
|
128
|
+
// Storing credentials in database
|
|
129
|
+
_a.sent();
|
|
130
|
+
// Returning the headers
|
|
131
|
+
return [2 /*return*/, res.headers];
|
|
132
|
+
case 7:
|
|
133
|
+
// Changing flow name
|
|
134
|
+
currentFlowName = LoginFlows_1.LoginFlows[res.nextFlowName];
|
|
135
|
+
// Changing current flow data
|
|
136
|
+
currentFlow = (0, LoginFlows_1.generateLoginFlow)(cred, res.nextFlowToken, currentFlowName);
|
|
137
|
+
_a.label = 8;
|
|
138
|
+
case 8: return [3 /*break*/, 3];
|
|
139
|
+
case 9: return [2 /*return*/];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
return AccountsService;
|
|
145
|
+
}(FetcherService_1.FetcherService));
|
|
146
|
+
exports.AccountsService = AccountsService;
|
|
147
|
+
//# sourceMappingURL=AccountsService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountsService.js","sourceRoot":"","sources":["../../../src/services/accounting/AccountsService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,cAAc;AAEd,WAAW;AACX,8CAA6C;AAC7C,oDAAmD;AAInD,yCAAyD;AAEzD,UAAU;AACV,2CAA6D;AAE7D;;GAEG;AACH;IAAqC,mCAAc;IAAnD;;IAqEA,CAAC;IApEG,iBAAiB;IAEjB;;;;OAIG;IACW,qCAAW,GAAzB,UAA0B,IAAe,EAAE,gBAAkC;;;;;4BAE/D,qBAAM,IAAI,CAAC,OAAO,CAAM,IAAI,CAAC,GAAG,EAAE,kBAAW,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,eAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAErG,OAAK,CAAA,CAAC,UAAA,GAAG;4BACN,6BAA6B;4BAC7B,IAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;4BAExC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;wBACvC,CAAC,CAAC,EAAA;;wBAPF,GAAG,GAAG,SAOJ;wBAGF,IAA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;KAGrF;IACL,sBAAC;AAAD,CAAC,AArED,CAAqC,+BAAc,GAqElD;AArEY,0CAAe"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flows.js","sourceRoot":"","sources":["../../../src/services/accounting/Flows.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LoginCredentials, LoginFlow } from '../../types/Authentication';
|
|
2
|
+
/**
|
|
3
|
+
* @summary Stores the different flows involved in login process
|
|
4
|
+
*/
|
|
5
|
+
export declare enum LoginFlows {
|
|
6
|
+
Login = "Login",
|
|
7
|
+
LoginJsInstrumentationSubtask = "LoginJsInstrumentationSubtask",
|
|
8
|
+
LoginEnterUserIdentifierSSO = "LoginEnterUserIdentifierSSO",
|
|
9
|
+
LoginEnterAlternateIdentifierSubtask = "LoginEnterAlternateIdentifierSubtask",
|
|
10
|
+
LoginEnterPassword = "LoginEnterPassword",
|
|
11
|
+
AccountDuplicationCheck = "AccountDuplicationCheck",
|
|
12
|
+
LoginSuccessSubtask = "LoginSuccessSubtask"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @returns The login flow body content for the required login flow
|
|
16
|
+
* @param cred The login credentials of the account to be logged into
|
|
17
|
+
* @param flowToken The flow token from the previous flow
|
|
18
|
+
* @param flowName The required flow name
|
|
19
|
+
*/
|
|
20
|
+
export declare function generateLoginFlow(cred: LoginCredentials, flowToken: string, flowName: LoginFlows): LoginFlow;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// CUSTOM LIBS
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.generateLoginFlow = exports.LoginFlows = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* @summary Stores the different flows involved in login process
|
|
7
|
+
*/
|
|
8
|
+
var LoginFlows;
|
|
9
|
+
(function (LoginFlows) {
|
|
10
|
+
LoginFlows["Login"] = "Login";
|
|
11
|
+
LoginFlows["LoginJsInstrumentationSubtask"] = "LoginJsInstrumentationSubtask";
|
|
12
|
+
LoginFlows["LoginEnterUserIdentifierSSO"] = "LoginEnterUserIdentifierSSO";
|
|
13
|
+
LoginFlows["LoginEnterAlternateIdentifierSubtask"] = "LoginEnterAlternateIdentifierSubtask";
|
|
14
|
+
LoginFlows["LoginEnterPassword"] = "LoginEnterPassword";
|
|
15
|
+
LoginFlows["AccountDuplicationCheck"] = "AccountDuplicationCheck";
|
|
16
|
+
LoginFlows["LoginSuccessSubtask"] = "LoginSuccessSubtask";
|
|
17
|
+
})(LoginFlows = exports.LoginFlows || (exports.LoginFlows = {}));
|
|
18
|
+
;
|
|
19
|
+
/**
|
|
20
|
+
* @summary Store the body content of the different HTTP request for each flow in login process
|
|
21
|
+
*/
|
|
22
|
+
var LoginFlowsContent = {
|
|
23
|
+
"Login": {
|
|
24
|
+
"url": 'https://twitter.com/i/api/1.1/onboarding/task.json?flow_name=login',
|
|
25
|
+
"body": '{"input_flow_data":{"flow_context":{"debug_overrides":{},"start_location":{"location":"splash_screen"}}},"subtask_versions":{"contacts_live_sync_permission_prompt":0,"email_verification":1,"topics_selector":1,"wait_spinner":1,"cta":4}}'
|
|
26
|
+
},
|
|
27
|
+
"LoginJsInstrumentationSubtask": {
|
|
28
|
+
"url": 'https://twitter.com/i/api/1.1/onboarding/task.json',
|
|
29
|
+
"body": '{"flow_token":"<flow_token>","subtask_inputs":[{"subtask_id":"LoginJsInstrumentationSubtask","js_instrumentation":{"response":"{\\"rf\\":{\\"f3d0013d2401a9e86a63dac052aeec19524813e572f0b446241b550bc1e653e8\\":-146,\\"abef77ded0018c5ef4a2146465e76811c8ee7a377ff84c2181e58ac7e5bb8b97\\":-17,\\"a6d95f40b2cc05ac2baa2ce64ce976d3558cd9ca79a3e1ae797d3bda62847470\\":112,\\"ae30e4310433b0ae4e670acd918eebd0056daee600fa9db57082e8ace2c2fb1c\\":14},\\"s\\":\\"AR1nIiYWWtrhpM2n5cu-WDC77syV8L_zqLIHxmAePc0nhZAnrh3WdNig2MMFoIk-k1TjxWijXgVtjbLaYB-gTFA9KigwnaVsno0o6deCU1b_uH3XxKCRwaE-KN3c65PXRKNJP08YB1nQENeFXgM9MsrywIO0C60zGlPWj8XlB9sAICGoJ26OJ7IgvMZP_5VgIJZwMDpJx3gN4xhI44n32TiLxerU59vDbwltkf0rgsIL34PODWWDOt9m07jrFaPFkt40T_G0sWJhuy9xfEWetgOmMLnQCpn4Ut6kl_W9Yi6wNDH1vtnRMbgeKgaJJRv2cTIvOa9DBvYV63cp_3G9WQAAAYBLmqMB\\"}","link":"next_link"}}]}'
|
|
30
|
+
},
|
|
31
|
+
"LoginEnterUserIdentifierSSO": {
|
|
32
|
+
"url": 'https://twitter.com/i/api/1.1/onboarding/task.json',
|
|
33
|
+
"body": '{"flow_token":"<flow_token>","subtask_inputs":[{"subtask_id":"LoginEnterUserIdentifierSSO","settings_list":{"setting_responses":[{"key":"user_identifier","response_data":{"text_data":{"result":"<email>"}}}],"link":"next_link"}}]}'
|
|
34
|
+
},
|
|
35
|
+
"LoginEnterAlternateIdentifierSubtask": {
|
|
36
|
+
"url": 'https://twitter.com/i/api/1.1/onboarding/task.json',
|
|
37
|
+
"body": '{"flow_token":"<flow_token>","subtask_inputs":[{"subtask_id":"LoginEnterAlternateIdentifierSubtask","enter_text":{"text":"<user_name>","link":"next_link"}}]}'
|
|
38
|
+
},
|
|
39
|
+
"LoginEnterPassword": {
|
|
40
|
+
"url": 'https://twitter.com/i/api/1.1/onboarding/task.json',
|
|
41
|
+
"body": '{"flow_token":"<flow_token>","subtask_inputs":[{"subtask_id":"LoginEnterPassword","enter_password":{"password":"<password>","link":"next_link"}}]}'
|
|
42
|
+
},
|
|
43
|
+
"AccountDuplicationCheck": {
|
|
44
|
+
"url": 'https://twitter.com/i/api/1.1/onboarding/task.json',
|
|
45
|
+
"body": '{"flow_token":"<flow_token>","subtask_inputs":[{"subtask_id":"AccountDuplicationCheck","check_logged_in_account":{"link":"AccountDuplicationCheck_false"}}]}'
|
|
46
|
+
},
|
|
47
|
+
"LoginSuccessSubtask": {
|
|
48
|
+
"url": '',
|
|
49
|
+
"body": ''
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @returns The login flow body content for the required login flow
|
|
54
|
+
* @param cred The login credentials of the account to be logged into
|
|
55
|
+
* @param flowToken The flow token from the previous flow
|
|
56
|
+
* @param flowName The required flow name
|
|
57
|
+
*/
|
|
58
|
+
function generateLoginFlow(cred, flowToken, flowName) {
|
|
59
|
+
// Getting the requested flow
|
|
60
|
+
var flow = LoginFlowsContent[flowName];
|
|
61
|
+
// Replacing the provided values into the flow body
|
|
62
|
+
flow['body'] = flow['body'].replace("<flow_token>", flowToken);
|
|
63
|
+
flow['body'] = flow['body'].replace("<email>", cred.email);
|
|
64
|
+
flow['body'] = flow['body'].replace("<user_name>", cred.userName);
|
|
65
|
+
flow['body'] = flow['body'].replace("<password>", cred.password);
|
|
66
|
+
flow['body'] = flow['body'];
|
|
67
|
+
return flow;
|
|
68
|
+
}
|
|
69
|
+
exports.generateLoginFlow = generateLoginFlow;
|
|
70
|
+
//# sourceMappingURL=LoginFlows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginFlows.js","sourceRoot":"","sources":["../../../src/services/accounting/LoginFlows.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAKd;;GAEG;AACH,IAAY,UAQX;AARD,WAAY,UAAU;IAClB,6BAAe,CAAA;IACf,6EAA+D,CAAA;IAC/D,yEAA2D,CAAA;IAC3D,2FAA6E,CAAA;IAC7E,uDAAyC,CAAA;IACzC,iEAAmD,CAAA;IACnD,yDAA2C,CAAA;AAC/C,CAAC,EARW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAQrB;AAAA,CAAC;AAEF;;GAEG;AACH,IAAM,iBAAiB,GAAG;IACtB,OAAO,EAAE;QACL,KAAK,EAAE,oEAAoE;QAC3E,MAAM,EAAE,6OA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C;AAChB,CAAC;AAbD,8CAaC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare class AccountService {
|
|
2
|
+
private auth;
|
|
3
|
+
private guestCreds;
|
|
4
|
+
private cookies;
|
|
5
|
+
private flowToken;
|
|
6
|
+
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* @returns The current guest credentials to use. If if does not exists, then a new one is created
|
|
9
|
+
*/
|
|
10
|
+
private getGuestCredentials;
|
|
11
|
+
/**
|
|
12
|
+
* @summary Step 1: Initiates login
|
|
13
|
+
*/
|
|
14
|
+
private initiateLogin;
|
|
15
|
+
/**
|
|
16
|
+
* @summary Step 2: Does something
|
|
17
|
+
*/
|
|
18
|
+
private jsInstrumentationSubtask;
|
|
19
|
+
/**
|
|
20
|
+
* @summary Step 3: Takes the email for login
|
|
21
|
+
*/
|
|
22
|
+
private enterUserIdentifier;
|
|
23
|
+
/**
|
|
24
|
+
* @summary Step 4: Takes the username for login
|
|
25
|
+
*/
|
|
26
|
+
private enterAlternateUserIdentifier;
|
|
27
|
+
/**
|
|
28
|
+
* @summary Step 5: Takes the password for login
|
|
29
|
+
*/
|
|
30
|
+
private enterPassword;
|
|
31
|
+
/**
|
|
32
|
+
* @summary Step 6: Gets the actual cookies
|
|
33
|
+
*/
|
|
34
|
+
private accountDuplicationCheck;
|
|
35
|
+
/**
|
|
36
|
+
* @param email The email of the account to be logged into
|
|
37
|
+
* @param userName The username associated with the given account
|
|
38
|
+
* @param password The password to the account
|
|
39
|
+
* @returns The cookies for authenticating with the given account
|
|
40
|
+
*/
|
|
41
|
+
login(email: string, userName: string, password: string): Promise<string>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
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 __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
exports.__esModule = true;
|
|
42
|
+
exports.AccountService = void 0;
|
|
43
|
+
// PACKAGES
|
|
44
|
+
var node_libcurl_1 = require("node-libcurl");
|
|
45
|
+
// SERVICES
|
|
46
|
+
var AuthService_1 = require("../AuthService");
|
|
47
|
+
// HELPERS
|
|
48
|
+
var LoginFlows_1 = __importDefault(require("./LoginFlows"));
|
|
49
|
+
var Headers_1 = require("../helper/Headers");
|
|
50
|
+
var cookiejar_1 = require("cookiejar");
|
|
51
|
+
var AccountService = /** @class */ (function () {
|
|
52
|
+
// MEMBER METHODS
|
|
53
|
+
function AccountService() {
|
|
54
|
+
this.auth = new AuthService_1.AuthService();
|
|
55
|
+
this.guestCreds = { authToken: '', guestToken: '' };
|
|
56
|
+
this.cookies = [];
|
|
57
|
+
this.flowToken = '';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @returns The current guest credentials to use. If if does not exists, then a new one is created
|
|
61
|
+
*/
|
|
62
|
+
AccountService.prototype.getGuestCredentials = function () {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
+
var _a;
|
|
65
|
+
return __generator(this, function (_b) {
|
|
66
|
+
switch (_b.label) {
|
|
67
|
+
case 0:
|
|
68
|
+
if (!!this.guestCreds.guestToken) return [3 /*break*/, 2];
|
|
69
|
+
_a = this;
|
|
70
|
+
return [4 /*yield*/, this.auth.getGuestCredentials()];
|
|
71
|
+
case 1:
|
|
72
|
+
_a.guestCreds = _b.sent();
|
|
73
|
+
_b.label = 2;
|
|
74
|
+
case 2: return [2 /*return*/, this.guestCreds];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* @summary Step 1: Initiates login
|
|
81
|
+
*/
|
|
82
|
+
AccountService.prototype.initiateLogin = function () {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var res, _a, _b, _c, _d;
|
|
85
|
+
var _e;
|
|
86
|
+
return __generator(this, function (_f) {
|
|
87
|
+
switch (_f.label) {
|
|
88
|
+
case 0:
|
|
89
|
+
_b = (_a = node_libcurl_1.curly).post;
|
|
90
|
+
_c = [LoginFlows_1["default"].InitiateLogin.url];
|
|
91
|
+
_e = {};
|
|
92
|
+
_d = Headers_1.loginHeader;
|
|
93
|
+
return [4 /*yield*/, this.getGuestCredentials()];
|
|
94
|
+
case 1: return [4 /*yield*/, _b.apply(_a, _c.concat([(_e.httpHeader = _d.apply(void 0, [_f.sent(), this.cookies.toString()]),
|
|
95
|
+
_e.sslVerifyPeer = false,
|
|
96
|
+
_e.postFields = '',
|
|
97
|
+
_e)]))];
|
|
98
|
+
case 2:
|
|
99
|
+
res = _f.sent();
|
|
100
|
+
// Storing cookies received
|
|
101
|
+
this.cookies = new cookiejar_1.CookieJar().setCookies(res.headers[0]['Set-Cookie']);
|
|
102
|
+
// Getting the flow token
|
|
103
|
+
this.flowToken = res.data['flow_token'];
|
|
104
|
+
return [2 /*return*/];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* @summary Step 2: Does something
|
|
111
|
+
*/
|
|
112
|
+
AccountService.prototype.jsInstrumentationSubtask = function () {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
var res, _a, _b, _c, _d;
|
|
115
|
+
var _e;
|
|
116
|
+
return __generator(this, function (_f) {
|
|
117
|
+
switch (_f.label) {
|
|
118
|
+
case 0:
|
|
119
|
+
_b = (_a = node_libcurl_1.curly).post;
|
|
120
|
+
_c = [LoginFlows_1["default"].JsInstrumentationSubtask.url];
|
|
121
|
+
_e = {};
|
|
122
|
+
_d = Headers_1.loginHeader;
|
|
123
|
+
return [4 /*yield*/, this.getGuestCredentials()];
|
|
124
|
+
case 1: return [4 /*yield*/, _b.apply(_a, _c.concat([(_e.httpHeader = _d.apply(void 0, [_f.sent(), this.cookies.join(';').toString()]),
|
|
125
|
+
_e.sslVerifyPeer = false,
|
|
126
|
+
_e.postFields = JSON.stringify(LoginFlows_1["default"].JsInstrumentationSubtask.body(this.flowToken)),
|
|
127
|
+
_e)]))];
|
|
128
|
+
case 2:
|
|
129
|
+
res = _f.sent();
|
|
130
|
+
// Getting the flow token
|
|
131
|
+
this.flowToken = res.data['flow_token'];
|
|
132
|
+
return [2 /*return*/];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* @summary Step 3: Takes the email for login
|
|
139
|
+
*/
|
|
140
|
+
AccountService.prototype.enterUserIdentifier = function (email) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
+
var res, _a, _b, _c, _d;
|
|
143
|
+
var _e;
|
|
144
|
+
return __generator(this, function (_f) {
|
|
145
|
+
switch (_f.label) {
|
|
146
|
+
case 0:
|
|
147
|
+
_b = (_a = node_libcurl_1.curly).post;
|
|
148
|
+
_c = [LoginFlows_1["default"].EnterUserIdentifier.url];
|
|
149
|
+
_e = {};
|
|
150
|
+
_d = Headers_1.loginHeader;
|
|
151
|
+
return [4 /*yield*/, this.getGuestCredentials()];
|
|
152
|
+
case 1: return [4 /*yield*/, _b.apply(_a, _c.concat([(_e.httpHeader = _d.apply(void 0, [_f.sent(), this.cookies.join(';').toString()]),
|
|
153
|
+
_e.sslVerifyPeer = false,
|
|
154
|
+
_e.postFields = JSON.stringify(LoginFlows_1["default"].EnterUserIdentifier.body(this.flowToken, email)),
|
|
155
|
+
_e)]))];
|
|
156
|
+
case 2:
|
|
157
|
+
res = _f.sent();
|
|
158
|
+
// Getting the flow token
|
|
159
|
+
this.flowToken = res.data['flow_token'];
|
|
160
|
+
return [2 /*return*/];
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* @summary Step 4: Takes the username for login
|
|
167
|
+
*/
|
|
168
|
+
AccountService.prototype.enterAlternateUserIdentifier = function (userName) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
170
|
+
var res, _a, _b, _c, _d;
|
|
171
|
+
var _e;
|
|
172
|
+
return __generator(this, function (_f) {
|
|
173
|
+
switch (_f.label) {
|
|
174
|
+
case 0:
|
|
175
|
+
_b = (_a = node_libcurl_1.curly).post;
|
|
176
|
+
_c = [LoginFlows_1["default"].EnterAlternateUserIdentifier.url];
|
|
177
|
+
_e = {};
|
|
178
|
+
_d = Headers_1.loginHeader;
|
|
179
|
+
return [4 /*yield*/, this.getGuestCredentials()];
|
|
180
|
+
case 1: return [4 /*yield*/, _b.apply(_a, _c.concat([(_e.httpHeader = _d.apply(void 0, [_f.sent(), this.cookies.join(';').toString()]),
|
|
181
|
+
_e.sslVerifyPeer = false,
|
|
182
|
+
_e.postFields = JSON.stringify(LoginFlows_1["default"].EnterAlternateUserIdentifier.body(this.flowToken, userName)),
|
|
183
|
+
_e)]))];
|
|
184
|
+
case 2:
|
|
185
|
+
res = _f.sent();
|
|
186
|
+
// Getting the flow token
|
|
187
|
+
this.flowToken = res.data['flow_token'];
|
|
188
|
+
return [2 /*return*/];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* @summary Step 5: Takes the password for login
|
|
195
|
+
*/
|
|
196
|
+
AccountService.prototype.enterPassword = function (password) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
198
|
+
var res, _a, _b, _c, _d;
|
|
199
|
+
var _e;
|
|
200
|
+
return __generator(this, function (_f) {
|
|
201
|
+
switch (_f.label) {
|
|
202
|
+
case 0:
|
|
203
|
+
_b = (_a = node_libcurl_1.curly).post;
|
|
204
|
+
_c = [LoginFlows_1["default"].EnterPassword.url];
|
|
205
|
+
_e = {};
|
|
206
|
+
_d = Headers_1.loginHeader;
|
|
207
|
+
return [4 /*yield*/, this.getGuestCredentials()];
|
|
208
|
+
case 1: return [4 /*yield*/, _b.apply(_a, _c.concat([(_e.httpHeader = _d.apply(void 0, [_f.sent(), this.cookies.join(';').toString()]),
|
|
209
|
+
_e.sslVerifyPeer = false,
|
|
210
|
+
_e.postFields = JSON.stringify(LoginFlows_1["default"].EnterPassword.body(this.flowToken, password)),
|
|
211
|
+
_e)]))];
|
|
212
|
+
case 2:
|
|
213
|
+
res = _f.sent();
|
|
214
|
+
// Getting the flow token
|
|
215
|
+
this.flowToken = res.data['flow_token'];
|
|
216
|
+
return [2 /*return*/];
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* @summary Step 6: Gets the actual cookies
|
|
223
|
+
*/
|
|
224
|
+
AccountService.prototype.accountDuplicationCheck = function () {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
226
|
+
var res, _a, _b, _c, _d;
|
|
227
|
+
var _e;
|
|
228
|
+
return __generator(this, function (_f) {
|
|
229
|
+
switch (_f.label) {
|
|
230
|
+
case 0:
|
|
231
|
+
_b = (_a = node_libcurl_1.curly).post;
|
|
232
|
+
_c = [LoginFlows_1["default"].AccountDuplicationCheck.url];
|
|
233
|
+
_e = {};
|
|
234
|
+
_d = Headers_1.loginHeader;
|
|
235
|
+
return [4 /*yield*/, this.getGuestCredentials()];
|
|
236
|
+
case 1: return [4 /*yield*/, _b.apply(_a, _c.concat([(_e.httpHeader = _d.apply(void 0, [_f.sent(), this.cookies.join(';').toString()]),
|
|
237
|
+
_e.sslVerifyPeer = false,
|
|
238
|
+
_e.postFields = JSON.stringify(LoginFlows_1["default"].AccountDuplicationCheck.body(this.flowToken)),
|
|
239
|
+
_e)]))];
|
|
240
|
+
case 2:
|
|
241
|
+
res = _f.sent();
|
|
242
|
+
// Storing cookies received
|
|
243
|
+
this.cookies = new cookiejar_1.CookieJar().setCookies(res.headers[0]['Set-Cookie']);
|
|
244
|
+
// Getting the flow token
|
|
245
|
+
this.flowToken = res.data['flow_token'];
|
|
246
|
+
return [2 /*return*/];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* @param email The email of the account to be logged into
|
|
253
|
+
* @param userName The username associated with the given account
|
|
254
|
+
* @param password The password to the account
|
|
255
|
+
* @returns The cookies for authenticating with the given account
|
|
256
|
+
*/
|
|
257
|
+
AccountService.prototype.login = function (email, userName, password) {
|
|
258
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
259
|
+
return __generator(this, function (_a) {
|
|
260
|
+
switch (_a.label) {
|
|
261
|
+
case 0:
|
|
262
|
+
// Executing each step of login flow
|
|
263
|
+
return [4 /*yield*/, this.initiateLogin()];
|
|
264
|
+
case 1:
|
|
265
|
+
// Executing each step of login flow
|
|
266
|
+
_a.sent();
|
|
267
|
+
return [4 /*yield*/, this.jsInstrumentationSubtask()];
|
|
268
|
+
case 2:
|
|
269
|
+
_a.sent();
|
|
270
|
+
return [4 /*yield*/, this.enterUserIdentifier(email)];
|
|
271
|
+
case 3:
|
|
272
|
+
_a.sent();
|
|
273
|
+
return [4 /*yield*/, this.enterAlternateUserIdentifier(userName)];
|
|
274
|
+
case 4:
|
|
275
|
+
_a.sent();
|
|
276
|
+
return [4 /*yield*/, this.enterPassword(password)];
|
|
277
|
+
case 5:
|
|
278
|
+
_a.sent();
|
|
279
|
+
return [4 /*yield*/, this.accountDuplicationCheck()];
|
|
280
|
+
case 6:
|
|
281
|
+
_a.sent();
|
|
282
|
+
// Returning the final cookies
|
|
283
|
+
return [2 /*return*/, this.cookies.join(';')];
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
return AccountService;
|
|
289
|
+
}());
|
|
290
|
+
exports.AccountService = AccountService;
|
|
291
|
+
//# sourceMappingURL=AccountService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountService.js","sourceRoot":"","sources":["../../../src/services/accounts/AccountService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,WAAW;AACX,6CAAkD;AAElD,WAAW;AACX,8CAA6C;AAK7C,UAAU;AACV,4DAAsC;AACtC,6CAAgD;AAChD,uCAA8C;AAE9C;IAOI,iBAAiB;IACjB;QACI,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,EAAE,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;QACpD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACW,4CAAmB,GAAjC;;;;;;6BAEQ,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,EAA3B,wBAA2B;wBAC3B,KAAA,IAAI,CAAA;wBAAc,qBAAM,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAA;;wBAAvD,GAAK,UAAU,GAAG,SAAqC,CAAC;;4BAG5D,sBAAO,IAAI,CAAC,UAAU,EAAC;;;;KAC1B;IAED;;OAEG;IACW,sCAAa,GAA3B;;;;;;;wBAEmC,KAAA,CAAA,KAAA,oBAAK,CAAA,CAAC,IAAI,CAAA;8BAAC,uBAAU,CAAC,aAAa,CAAC,GAAG;;wBACtD,KAAA,qBAAW,CAAA;wBAAC,qBAAM,IA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