steamcommunity 3.48.2 → 3.48.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/README.md +2 -3
- package/classes/CConfirmation.js +37 -37
- package/classes/CEconItem.js +120 -120
- package/classes/CSteamSharedFile.js +221 -221
- package/classes/CSteamUser.js +225 -225
- package/components/confirmations.js +428 -428
- package/components/groups.js +798 -798
- package/components/help.js +64 -64
- package/components/helpers.js +128 -128
- package/components/http.js +150 -150
- package/components/inventoryhistory.js +173 -173
- package/components/login.js +110 -110
- package/components/market.js +387 -387
- package/components/profile.js +475 -475
- package/components/sharedfiles.js +158 -158
- package/components/twofactor.js +152 -152
- package/components/users.js +831 -831
- package/examples/disable_twofactor.js +98 -98
- package/examples/enable_twofactor.js +143 -143
- package/index.js +466 -466
- package/package.json +44 -44
- package/resources/EChatState.js +14 -14
- package/resources/EConfirmationType.js +12 -12
- package/resources/EFriendRelationship.js +23 -23
- package/resources/EPersonaState.js +23 -23
- package/resources/EPersonaStateFlag.js +32 -32
- package/resources/EResult.js +254 -254
package/README.md
CHANGED
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
[](https://github.com/DoctorMcKay/node-steamcommunity/blob/master/LICENSE)
|
|
5
5
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=N36YVAT42CZ4G&item_name=node%2dsteamcommunity¤cy_code=USD)
|
|
6
6
|
|
|
7
|
-
This module provides an easy interface for the Steam Community website. This module can be used to simply login to
|
|
8
|
-
|
|
9
|
-
It supports Steam Guard and CAPTCHAs.
|
|
7
|
+
This module provides an easy interface for the Steam Community website. This module can be used to simply login to
|
|
8
|
+
steamcommunity.com for use with other libraries, or to interact with steamcommunity.com.
|
|
10
9
|
|
|
11
10
|
**Have a question about the module or coding in general? *Do not create a GitHub issue.* GitHub issues are for feature
|
|
12
11
|
requests and bug reports. Instead, post in the [dedicated forum](https://dev.doctormckay.com/forum/8-node-steamcommunity/).
|
package/classes/CConfirmation.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var SteamCommunity = require('../index.js');
|
|
2
|
-
|
|
3
|
-
module.exports = CConfirmation;
|
|
4
|
-
|
|
5
|
-
function CConfirmation(community, data) {
|
|
6
|
-
Object.defineProperty(this, '_community', {value: community});
|
|
7
|
-
|
|
8
|
-
this.id = data.id.toString();
|
|
9
|
-
this.type = data.type;
|
|
10
|
-
this.creator = data.creator.toString();
|
|
11
|
-
this.key = data.key;
|
|
12
|
-
this.title = data.title;
|
|
13
|
-
this.receiving = data.receiving;
|
|
14
|
-
this.sending = data.sending;
|
|
15
|
-
this.time = data.time;
|
|
16
|
-
this.timestamp = data.timestamp;
|
|
17
|
-
this.icon = data.icon;
|
|
18
|
-
this.offerID = this.type == SteamCommunity.ConfirmationType.Trade ? this.creator : null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
CConfirmation.prototype.getOfferID = function(time, key, callback) {
|
|
22
|
-
if (this.type && this.creator) {
|
|
23
|
-
if (this.type != SteamCommunity.ConfirmationType.Trade) {
|
|
24
|
-
callback(new Error('Not a trade confirmation'));
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
callback(null, this.creator);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
this._community.getConfirmationOfferID(this.id, time, key, callback);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
CConfirmation.prototype.respond = function(time, key, accept, callback) {
|
|
36
|
-
this._community.respondToConfirmation(this.id, this.key, time, key, accept, callback);
|
|
37
|
-
};
|
|
1
|
+
var SteamCommunity = require('../index.js');
|
|
2
|
+
|
|
3
|
+
module.exports = CConfirmation;
|
|
4
|
+
|
|
5
|
+
function CConfirmation(community, data) {
|
|
6
|
+
Object.defineProperty(this, '_community', {value: community});
|
|
7
|
+
|
|
8
|
+
this.id = data.id.toString();
|
|
9
|
+
this.type = data.type;
|
|
10
|
+
this.creator = data.creator.toString();
|
|
11
|
+
this.key = data.key;
|
|
12
|
+
this.title = data.title;
|
|
13
|
+
this.receiving = data.receiving;
|
|
14
|
+
this.sending = data.sending;
|
|
15
|
+
this.time = data.time;
|
|
16
|
+
this.timestamp = data.timestamp;
|
|
17
|
+
this.icon = data.icon;
|
|
18
|
+
this.offerID = this.type == SteamCommunity.ConfirmationType.Trade ? this.creator : null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
CConfirmation.prototype.getOfferID = function(time, key, callback) {
|
|
22
|
+
if (this.type && this.creator) {
|
|
23
|
+
if (this.type != SteamCommunity.ConfirmationType.Trade) {
|
|
24
|
+
callback(new Error('Not a trade confirmation'));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
callback(null, this.creator);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
this._community.getConfirmationOfferID(this.id, time, key, callback);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
CConfirmation.prototype.respond = function(time, key, accept, callback) {
|
|
36
|
+
this._community.respondToConfirmation(this.id, this.key, time, key, accept, callback);
|
|
37
|
+
};
|
package/classes/CEconItem.js
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
module.exports = CEconItem;
|
|
2
|
-
|
|
3
|
-
function CEconItem(item, description, contextID) {
|
|
4
|
-
var thing;
|
|
5
|
-
for (thing in item) {
|
|
6
|
-
if (item.hasOwnProperty(thing)) {
|
|
7
|
-
this[thing] = item[thing];
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
var isCurrency = !!(this.is_currency || this.currency) || typeof this.currencyid !== 'undefined'; // I don't want to put this on the object yet; it's nice to have the ids at the top of printed output
|
|
12
|
-
|
|
13
|
-
if (isCurrency) {
|
|
14
|
-
this.currencyid = this.id = (this.id || this.currencyid);
|
|
15
|
-
} else {
|
|
16
|
-
this.assetid = this.id = (this.id || this.assetid);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
this.instanceid = this.instanceid || '0';
|
|
20
|
-
this.amount = parseInt(this.amount, 10);
|
|
21
|
-
this.contextid = this.contextid || contextID.toString();
|
|
22
|
-
|
|
23
|
-
// Merge the description
|
|
24
|
-
if (description) {
|
|
25
|
-
// Is this a listing of descriptions?
|
|
26
|
-
if (description[this.classid + '_' + this.instanceid]) {
|
|
27
|
-
description = description[this.classid + '_' + this.instanceid];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
for (thing in description) {
|
|
31
|
-
if (description.hasOwnProperty(thing)) {
|
|
32
|
-
this[thing] = description[thing];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
this.is_currency = isCurrency;
|
|
38
|
-
this.tradable = !!this.tradable;
|
|
39
|
-
this.marketable = !!this.marketable;
|
|
40
|
-
this.commodity = !!this.commodity;
|
|
41
|
-
this.market_tradable_restriction = (this.market_tradable_restriction ? parseInt(this.market_tradable_restriction, 10) : 0);
|
|
42
|
-
this.market_marketable_restriction = (this.market_marketable_restriction ? parseInt(this.market_marketable_restriction, 10) : 0);
|
|
43
|
-
this.fraudwarnings = this.fraudwarnings || [];
|
|
44
|
-
this.descriptions = this.descriptions || [];
|
|
45
|
-
|
|
46
|
-
if (this.owner && JSON.stringify(this.owner) == '{}') {
|
|
47
|
-
this.owner = null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Restore old property names of tags
|
|
51
|
-
if (this.tags) {
|
|
52
|
-
this.tags = this.tags.map(function(tag) {
|
|
53
|
-
return {
|
|
54
|
-
"internal_name": tag.internal_name,
|
|
55
|
-
"name": tag.localized_tag_name || tag.name,
|
|
56
|
-
"category": tag.category,
|
|
57
|
-
"color": tag.color || "",
|
|
58
|
-
"category_name": tag.localized_category_name || tag.category_name
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Restore market_fee_app, if applicable
|
|
64
|
-
var match;
|
|
65
|
-
if (this.appid == 753 && this.contextid == 6 && this.market_hash_name && (match = this.market_hash_name.match(/^(\d+)\-/))) {
|
|
66
|
-
this.market_fee_app = parseInt(match[1], 10);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Restore cache_expiration, if we can (for CS:GO items)
|
|
70
|
-
if (this.appid == 730 && this.contextid == 2 && this.owner_descriptions) {
|
|
71
|
-
let description = this.owner_descriptions.find(d => d.value && d.value.indexOf('Tradable After ') == 0);
|
|
72
|
-
if (description) {
|
|
73
|
-
let date = new Date(description.value.substring(
|
|
74
|
-
if (date) {
|
|
75
|
-
this.cache_expiration = date.toISOString();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// If we have item_expiration, also set cache_expiration to the same value
|
|
81
|
-
if (this.item_expiration) {
|
|
82
|
-
this.cache_expiration = this.item_expiration;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (this.actions === "") {
|
|
86
|
-
this.actions = [];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// One wouldn't think that we need this if statement, but apparently v8 has a weird bug/quirk where deleting a
|
|
90
|
-
// property results in greatly increased memory usage. Because that makes sense.
|
|
91
|
-
if (this.currency) {
|
|
92
|
-
delete this.currency;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
CEconItem.prototype.getImageURL = function() {
|
|
97
|
-
return "https://steamcommunity-a.akamaihd.net/economy/image/" + this.icon_url + "/";
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
CEconItem.prototype.getLargeImageURL = function() {
|
|
101
|
-
if(!this.icon_url_large) {
|
|
102
|
-
return this.getImageURL();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return "https://steamcommunity-a.akamaihd.net/economy/image/" + this.icon_url_large + "/";
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
CEconItem.prototype.getTag = function(category) {
|
|
109
|
-
if (!this.tags) {
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
for (var i = 0; i < this.tags.length; i++) {
|
|
114
|
-
if (this.tags[i].category == category) {
|
|
115
|
-
return this.tags[i];
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return null;
|
|
120
|
-
};
|
|
1
|
+
module.exports = CEconItem;
|
|
2
|
+
|
|
3
|
+
function CEconItem(item, description, contextID) {
|
|
4
|
+
var thing;
|
|
5
|
+
for (thing in item) {
|
|
6
|
+
if (item.hasOwnProperty(thing)) {
|
|
7
|
+
this[thing] = item[thing];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var isCurrency = !!(this.is_currency || this.currency) || typeof this.currencyid !== 'undefined'; // I don't want to put this on the object yet; it's nice to have the ids at the top of printed output
|
|
12
|
+
|
|
13
|
+
if (isCurrency) {
|
|
14
|
+
this.currencyid = this.id = (this.id || this.currencyid);
|
|
15
|
+
} else {
|
|
16
|
+
this.assetid = this.id = (this.id || this.assetid);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
this.instanceid = this.instanceid || '0';
|
|
20
|
+
this.amount = parseInt(this.amount, 10);
|
|
21
|
+
this.contextid = this.contextid || contextID.toString();
|
|
22
|
+
|
|
23
|
+
// Merge the description
|
|
24
|
+
if (description) {
|
|
25
|
+
// Is this a listing of descriptions?
|
|
26
|
+
if (description[this.classid + '_' + this.instanceid]) {
|
|
27
|
+
description = description[this.classid + '_' + this.instanceid];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
for (thing in description) {
|
|
31
|
+
if (description.hasOwnProperty(thing)) {
|
|
32
|
+
this[thing] = description[thing];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
this.is_currency = isCurrency;
|
|
38
|
+
this.tradable = !!this.tradable;
|
|
39
|
+
this.marketable = !!this.marketable;
|
|
40
|
+
this.commodity = !!this.commodity;
|
|
41
|
+
this.market_tradable_restriction = (this.market_tradable_restriction ? parseInt(this.market_tradable_restriction, 10) : 0);
|
|
42
|
+
this.market_marketable_restriction = (this.market_marketable_restriction ? parseInt(this.market_marketable_restriction, 10) : 0);
|
|
43
|
+
this.fraudwarnings = this.fraudwarnings || [];
|
|
44
|
+
this.descriptions = this.descriptions || [];
|
|
45
|
+
|
|
46
|
+
if (this.owner && JSON.stringify(this.owner) == '{}') {
|
|
47
|
+
this.owner = null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Restore old property names of tags
|
|
51
|
+
if (this.tags) {
|
|
52
|
+
this.tags = this.tags.map(function(tag) {
|
|
53
|
+
return {
|
|
54
|
+
"internal_name": tag.internal_name,
|
|
55
|
+
"name": tag.localized_tag_name || tag.name,
|
|
56
|
+
"category": tag.category,
|
|
57
|
+
"color": tag.color || "",
|
|
58
|
+
"category_name": tag.localized_category_name || tag.category_name
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Restore market_fee_app, if applicable
|
|
64
|
+
var match;
|
|
65
|
+
if (this.appid == 753 && this.contextid == 6 && this.market_hash_name && (match = this.market_hash_name.match(/^(\d+)\-/))) {
|
|
66
|
+
this.market_fee_app = parseInt(match[1], 10);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Restore cache_expiration, if we can (for CS:GO items)
|
|
70
|
+
if (this.appid == 730 && this.contextid == 2 && this.owner_descriptions) {
|
|
71
|
+
let description = this.owner_descriptions.find(d => d.value && d.value.indexOf('Tradable/Marketable After ') == 0);
|
|
72
|
+
if (description) {
|
|
73
|
+
let date = new Date(description.value.substring(26).replace(/[,()]/g, ''));
|
|
74
|
+
if (date) {
|
|
75
|
+
this.cache_expiration = date.toISOString();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// If we have item_expiration, also set cache_expiration to the same value
|
|
81
|
+
if (this.item_expiration) {
|
|
82
|
+
this.cache_expiration = this.item_expiration;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (this.actions === "") {
|
|
86
|
+
this.actions = [];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// One wouldn't think that we need this if statement, but apparently v8 has a weird bug/quirk where deleting a
|
|
90
|
+
// property results in greatly increased memory usage. Because that makes sense.
|
|
91
|
+
if (this.currency) {
|
|
92
|
+
delete this.currency;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
CEconItem.prototype.getImageURL = function() {
|
|
97
|
+
return "https://steamcommunity-a.akamaihd.net/economy/image/" + this.icon_url + "/";
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
CEconItem.prototype.getLargeImageURL = function() {
|
|
101
|
+
if(!this.icon_url_large) {
|
|
102
|
+
return this.getImageURL();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return "https://steamcommunity-a.akamaihd.net/economy/image/" + this.icon_url_large + "/";
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
CEconItem.prototype.getTag = function(category) {
|
|
109
|
+
if (!this.tags) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
for (var i = 0; i < this.tags.length; i++) {
|
|
114
|
+
if (this.tags[i].category == category) {
|
|
115
|
+
return this.tags[i];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return null;
|
|
120
|
+
};
|