steamutils 1.0.0 → 1.0.2

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 (2) hide show
  1. package/index.js +45 -4
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -1860,8 +1860,15 @@ class SteamUser {
1860
1860
  }
1861
1861
  }
1862
1862
 
1863
- async getClientJsToken() {
1864
- let result = (await this._httpRequest('chat/clientjstoken')).data
1863
+ async getClientJsToken(retry = null) {
1864
+ let result = (await this._httpRequest('chat/clientjstoken'))?.data
1865
+ if (!result) {
1866
+ if (retry !== null && retry !== undefined && retry >= 0) {
1867
+ return await this.getClientJsToken(retry - 1)
1868
+ } else {
1869
+ return null
1870
+ }
1871
+ }
1865
1872
 
1866
1873
  const dataExample = {
1867
1874
  logged_in: true,
@@ -2874,11 +2881,45 @@ class SteamUser {
2874
2881
  }
2875
2882
 
2876
2883
  async getOwnedAppsID() {
2877
- let response = await this._httpRequest(`https://store.steampowered.com/dynamicstore/userdata/?id=${this._miniprofile_user}`)
2878
- return response?.data?.rgOwnedApps
2884
+ let response = await this.getDynamicStoreUserData()
2885
+ return response?.rgOwnedApps
2879
2886
  const resultExample = [730, 223750,]
2880
2887
  }
2881
2888
 
2889
+ async getDynamicStoreUserData() {
2890
+ let response = await this._httpRequest(`https://store.steampowered.com/dynamicstore/userdata/?id=${this._miniprofile_user}`)
2891
+ return response?.data
2892
+ const responseExample = {
2893
+ rgWishlist: [],
2894
+ rgOwnedPackages: [303386, 347132,],
2895
+ rgOwnedApps: [730, 107600,],
2896
+ rgFollowedApps: [],
2897
+ rgMasterSubApps: [],
2898
+ rgPackagesInCart: [],
2899
+ rgAppsInCart: [],
2900
+ rgRecommendedTags: [{tagid: 5055, name: "eSports"},{tagid: 19, name: "Action"}],
2901
+ rgIgnoredApps: [],
2902
+ rgIgnoredPackages: [],
2903
+ rgCurators: [],
2904
+ rgCuratorsIgnored: [],
2905
+ rgCurations: [],
2906
+ bShowFilteredUserReviewScores: true,
2907
+ rgCreatorsFollowed: [],
2908
+ rgCreatorsIgnored: [],
2909
+ rgExcludedTags: [],
2910
+ rgExcludedContentDescriptorIDs: [3, 4],
2911
+ rgAutoGrantApps: [],
2912
+ rgRecommendedApps: [1782210, 1273710,],
2913
+ rgPreferredPlatforms: [],
2914
+ rgPrimaryLanguage: 0,
2915
+ rgSecondaryLanguages: [],
2916
+ bAllowAppImpressions: true,
2917
+ nCartLineItemCount: 0,
2918
+ nRemainingCartDiscount: 0,
2919
+ nTotalCartDiscount: 0
2920
+ }
2921
+ }
2922
+
2882
2923
  async getListGroupInvitable(userSteamID) {
2883
2924
  const result = await this._httpRequestAjax(`${this.getSteamUserProfileURL(userSteamID)}/ajaxgroupinvite?new_profile=1`)
2884
2925
  const $ = result._$()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "dependencies": {
5
5
  "axios": "^1.3.4",
6
6
  "cheerio": "^1.0.0-rc.12",
@@ -9,6 +9,7 @@
9
9
  "moment": "^2.29.4",
10
10
  "node-bignumber": "^1.2.2",
11
11
  "steamid": "^2.0.0",
12
+ "url-parse": "^1.5.10",
12
13
  "xml-js": "^1.6.11",
13
14
  "xml2js": "^0.4.23"
14
15
  },