steamcommunity 3.46.1 → 3.47.0

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.
Files changed (44) hide show
  1. package/classes/CConfirmation.js +37 -37
  2. package/classes/CEconItem.js +120 -120
  3. package/classes/CMarketItem.js +189 -189
  4. package/classes/CMarketSearchResult.js +89 -89
  5. package/classes/CSteamGroup.js +155 -155
  6. package/classes/CSteamUser.js +225 -217
  7. package/components/chat.js +283 -283
  8. package/components/confirmations.js +428 -428
  9. package/components/groups.js +798 -732
  10. package/components/help.js +64 -64
  11. package/components/helpers.js +128 -108
  12. package/components/http.js +150 -150
  13. package/components/inventoryhistory.js +173 -173
  14. package/components/market.js +387 -387
  15. package/components/profile.js +475 -475
  16. package/components/twofactor.js +152 -152
  17. package/components/users.js +831 -767
  18. package/components/webapi.js +118 -118
  19. package/examples/edit-group-announcement.js +118 -118
  20. package/package.json +9 -2
  21. package/resources/EChatState.js +14 -14
  22. package/resources/EConfirmationType.js +12 -12
  23. package/resources/EFriendRelationship.js +23 -23
  24. package/resources/EPersonaState.js +23 -23
  25. package/resources/EPersonaStateFlag.js +32 -32
  26. package/resources/EResult.js +254 -254
  27. package/resources/ESharedFileType.js +13 -13
  28. package/.editorconfig +0 -13
  29. package/.github/FUNDING.yml +0 -2
  30. package/.idea/.name +0 -1
  31. package/.idea/codeStyleSettings.xml +0 -13
  32. package/.idea/codeStyles/Project.xml +0 -15
  33. package/.idea/codeStyles/codeStyleConfig.xml +0 -6
  34. package/.idea/copyright/profiles_settings.xml +0 -3
  35. package/.idea/encodings.xml +0 -6
  36. package/.idea/inspectionProfiles/Project_Default.xml +0 -11
  37. package/.idea/jsLibraryMappings.xml +0 -6
  38. package/.idea/misc.xml +0 -6
  39. package/.idea/modules.xml +0 -9
  40. package/.idea/node-steamcommunity.iml +0 -8
  41. package/.idea/steamcommunity.iml +0 -10
  42. package/.idea/vcs.xml +0 -7
  43. package/.idea/watcherTasks.xml +0 -4
  44. package/CONTRIBUTING.md +0 -36
@@ -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
+ };
@@ -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(15).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
- };
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(15).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
+ };