steamcommunity 3.44.3 → 3.44.4
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/FUNDING.yml +2 -2
- package/.idea/inspectionProfiles/Project_Default.xml +10 -10
- package/README.md +23 -23
- package/classes/CConfirmation.js +35 -35
- package/classes/CMarketItem.js +189 -189
- package/classes/CMarketSearchResult.js +89 -89
- package/classes/CSteamGroup.js +155 -155
- package/components/chat.js +283 -283
- package/components/groups.js +732 -732
- package/components/inventoryhistory.js +188 -188
- package/components/twofactor.js +159 -159
- package/examples/disable_twofactor.js +62 -62
- package/examples/edit-group-announcement.js +118 -118
- package/examples/enable_twofactor.js +112 -112
- package/index.js +587 -589
- package/package.json +1 -1
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
// If you aren't running this script inside of the repository, replace the following line with:
|
|
2
|
-
// const SteamCommunity = require('steamcommunity');
|
|
3
|
-
const SteamCommunity = require('../index.js');
|
|
4
|
-
const ReadLine = require('readline');
|
|
5
|
-
const FS = require('fs');
|
|
6
|
-
|
|
7
|
-
const EResult = SteamCommunity.EResult;
|
|
8
|
-
|
|
9
|
-
let community = new SteamCommunity();
|
|
10
|
-
let rl = ReadLine.createInterface({
|
|
11
|
-
input: process.stdin,
|
|
12
|
-
output: process.stdout
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
rl.question('Username: ', (accountName) => {
|
|
16
|
-
rl.question('Password: ', (password) => {
|
|
17
|
-
doLogin(accountName, password);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
function doLogin(accountName, password, authCode, captcha) {
|
|
22
|
-
community.login({
|
|
23
|
-
accountName: accountName,
|
|
24
|
-
password: password,
|
|
25
|
-
authCode: authCode,
|
|
26
|
-
captcha: captcha
|
|
27
|
-
}, (err, sessionID, cookies, steamguard) => {
|
|
28
|
-
if (err) {
|
|
29
|
-
if (err.message == 'SteamGuardMobile') {
|
|
30
|
-
console.log('This account already has two-factor authentication enabled.');
|
|
31
|
-
process.exit();
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (err.message == 'SteamGuard') {
|
|
36
|
-
console.log(`An email has been sent to your address at ${err.emaildomain}`);
|
|
37
|
-
rl.question('Steam Guard Code: ', (code) => {
|
|
38
|
-
doLogin(accountName, password, code);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (err.message == 'CAPTCHA') {
|
|
45
|
-
console.log(err.captchaurl);
|
|
46
|
-
rl.question('CAPTCHA: ', (captchaInput) => {
|
|
47
|
-
doLogin(accountName, password, authCode, captchaInput);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
console.log(err);
|
|
54
|
-
process.exit();
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
console.log('Logged on!');
|
|
59
|
-
community.enableTwoFactor((err, response) => {
|
|
60
|
-
if (err) {
|
|
61
|
-
if (err.eresult == EResult.Fail) {
|
|
62
|
-
console.log('Error: Failed to enable two-factor authentication. Do you have a phone number attached to your account?');
|
|
63
|
-
process.exit();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (err.eresult == EResult.RateLimitExceeded) {
|
|
68
|
-
console.log('Error: RateLimitExceeded. Try again later.');
|
|
69
|
-
process.exit();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
console.log(err);
|
|
74
|
-
process.exit();
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (response.status != EResult.OK) {
|
|
79
|
-
console.log(`Error: Status ${response.status}`);
|
|
80
|
-
process.exit();
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
let filename = `twofactor_${community.steamID.getSteamID64()}.json`;
|
|
85
|
-
console.log(`Writing secrets to ${filename}`);
|
|
86
|
-
console.log(`Revocation code: ${response.revocation_code}`);
|
|
87
|
-
FS.writeFileSync(filename, JSON.stringify(response, null, '\t'));
|
|
88
|
-
|
|
89
|
-
promptActivationCode(response);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function promptActivationCode(response) {
|
|
95
|
-
rl.question('SMS Code: ', (smsCode) => {
|
|
96
|
-
community.finalizeTwoFactor(response.shared_secret, smsCode, (err) => {
|
|
97
|
-
if (err) {
|
|
98
|
-
if (err.message == 'Invalid activation code') {
|
|
99
|
-
console.log(err);
|
|
100
|
-
promptActivationCode(response);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
console.log(err);
|
|
105
|
-
} else {
|
|
106
|
-
console.log('Two-factor authentication enabled!');
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
process.exit();
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
}
|
|
1
|
+
// If you aren't running this script inside of the repository, replace the following line with:
|
|
2
|
+
// const SteamCommunity = require('steamcommunity');
|
|
3
|
+
const SteamCommunity = require('../index.js');
|
|
4
|
+
const ReadLine = require('readline');
|
|
5
|
+
const FS = require('fs');
|
|
6
|
+
|
|
7
|
+
const EResult = SteamCommunity.EResult;
|
|
8
|
+
|
|
9
|
+
let community = new SteamCommunity();
|
|
10
|
+
let rl = ReadLine.createInterface({
|
|
11
|
+
input: process.stdin,
|
|
12
|
+
output: process.stdout
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
rl.question('Username: ', (accountName) => {
|
|
16
|
+
rl.question('Password: ', (password) => {
|
|
17
|
+
doLogin(accountName, password);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
function doLogin(accountName, password, authCode, captcha) {
|
|
22
|
+
community.login({
|
|
23
|
+
accountName: accountName,
|
|
24
|
+
password: password,
|
|
25
|
+
authCode: authCode,
|
|
26
|
+
captcha: captcha
|
|
27
|
+
}, (err, sessionID, cookies, steamguard) => {
|
|
28
|
+
if (err) {
|
|
29
|
+
if (err.message == 'SteamGuardMobile') {
|
|
30
|
+
console.log('This account already has two-factor authentication enabled.');
|
|
31
|
+
process.exit();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (err.message == 'SteamGuard') {
|
|
36
|
+
console.log(`An email has been sent to your address at ${err.emaildomain}`);
|
|
37
|
+
rl.question('Steam Guard Code: ', (code) => {
|
|
38
|
+
doLogin(accountName, password, code);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (err.message == 'CAPTCHA') {
|
|
45
|
+
console.log(err.captchaurl);
|
|
46
|
+
rl.question('CAPTCHA: ', (captchaInput) => {
|
|
47
|
+
doLogin(accountName, password, authCode, captchaInput);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
console.log(err);
|
|
54
|
+
process.exit();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
console.log('Logged on!');
|
|
59
|
+
community.enableTwoFactor((err, response) => {
|
|
60
|
+
if (err) {
|
|
61
|
+
if (err.eresult == EResult.Fail) {
|
|
62
|
+
console.log('Error: Failed to enable two-factor authentication. Do you have a phone number attached to your account?');
|
|
63
|
+
process.exit();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (err.eresult == EResult.RateLimitExceeded) {
|
|
68
|
+
console.log('Error: RateLimitExceeded. Try again later.');
|
|
69
|
+
process.exit();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
console.log(err);
|
|
74
|
+
process.exit();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (response.status != EResult.OK) {
|
|
79
|
+
console.log(`Error: Status ${response.status}`);
|
|
80
|
+
process.exit();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let filename = `twofactor_${community.steamID.getSteamID64()}.json`;
|
|
85
|
+
console.log(`Writing secrets to ${filename}`);
|
|
86
|
+
console.log(`Revocation code: ${response.revocation_code}`);
|
|
87
|
+
FS.writeFileSync(filename, JSON.stringify(response, null, '\t'));
|
|
88
|
+
|
|
89
|
+
promptActivationCode(response);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function promptActivationCode(response) {
|
|
95
|
+
rl.question('SMS Code: ', (smsCode) => {
|
|
96
|
+
community.finalizeTwoFactor(response.shared_secret, smsCode, (err) => {
|
|
97
|
+
if (err) {
|
|
98
|
+
if (err.message == 'Invalid activation code') {
|
|
99
|
+
console.log(err);
|
|
100
|
+
promptActivationCode(response);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
console.log(err);
|
|
105
|
+
} else {
|
|
106
|
+
console.log('Two-factor authentication enabled!');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
process.exit();
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|