steamutils 1.5.2 → 1.5.3
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/index.js +9 -1
- package/package.json +1 -1
- package/remote.js +9 -0
package/index.js
CHANGED
@@ -7,7 +7,7 @@ import SteamID from "steamid";
|
|
7
7
|
import URL from "url";
|
8
8
|
import Url from "url-parse";
|
9
9
|
import qs from "qs";
|
10
|
-
import { console_log, downloadImage, getCleanObject, JSON_parse, JSON_stringify, removeSpaceKeys, secretAsBuffer, sleep } from "./utils.js";
|
10
|
+
import { approveLogin, console_log, downloadImage, getCleanObject, JSON_parse, JSON_stringify, removeSpaceKeys, secretAsBuffer, sleep } from "./utils.js";
|
11
11
|
import { Header, request } from "./axios.js";
|
12
12
|
import { getTableHasHeaders, querySelectorAll, table2json } from "./cheerio.js";
|
13
13
|
import { getJSObjectFronXML } from "./xml2json.js";
|
@@ -7846,6 +7846,14 @@ export default class SteamUser {
|
|
7846
7846
|
console.error("Error decoding QR code:", error);
|
7847
7847
|
}
|
7848
7848
|
}
|
7849
|
+
|
7850
|
+
static async approveLoginRequest(steamId, url, sharedSecret, accessToken) {
|
7851
|
+
try {
|
7852
|
+
return await approveLogin({ steamId, url, sharedSecret, accessToken });
|
7853
|
+
} catch (e) {
|
7854
|
+
console.error("approveLoginRequest Error", e);
|
7855
|
+
}
|
7856
|
+
}
|
7849
7857
|
}
|
7850
7858
|
|
7851
7859
|
SteamUser.MAX_RETRY = 10;
|
package/package.json
CHANGED
package/remote.js
CHANGED
@@ -2219,4 +2219,13 @@ export default class RemoteSteamUser {
|
|
2219
2219
|
};
|
2220
2220
|
return await doRequest(config);
|
2221
2221
|
}
|
2222
|
+
static async approveLoginRequest(steamId, url, sharedSecret, accessToken) {
|
2223
|
+
const { __params, __cookies } = formatParams([steamId, url, sharedSecret, accessToken]);
|
2224
|
+
const config = {
|
2225
|
+
method: "approveLoginRequest",
|
2226
|
+
params: __params,
|
2227
|
+
is_static: true,
|
2228
|
+
};
|
2229
|
+
return await doRequest(config);
|
2230
|
+
}
|
2222
2231
|
}
|