You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate setCookie from /mobileapi/userinfo to /v1/users/authenticated; add getUserFunds method (#824)
* feat(breaking)!: add getUserFunds(); migrate setCookie() from getCurrentUser() to getAuthenticatedUser(); polyfill and deprecate getCurrentUser() + add console warnings for getCurrentUser usage
BREAKING CHANGE: getCurrentUser's /mobileinfo api endpoint is being deprecated by Roblox on August 27th (https://devforum.roblox.com/t/official-list-of-deprecated-web-endpoints/62889/66), setCookie will now have a new response type
* misc: promisify secondary calls, remove github PR hyperlink, fix setOptions typing
* lint: apply linting rules
console.warn('[DEPRECATED]: getCurrentUser() is deprecated by Roblox; use getAuthenticatedUser(), getPremium(), getThumbnails(), or getUserFunds() instead!')
27
+
console.warn(' > Opt out of these warnings using noblox.setOptions({ show_deprecation_warnings: false })')
DEPRECATION_WARNING: '[DEPRECATED]: noblox.getCurrentUser() is deprecated; use getAuthenticatedUser(), getPremium(), getThumbnails(), or getUserFunds() instead!'
35
47
}
36
-
constjson=JSON.parse(res.body)
48
+
37
49
if(!option){
38
50
returnjson
39
51
}
52
+
53
+
// Support queried rgequests `getCurrentUser('UserID') -> only UserID`
* altering the settings.json file. Objects passed to this function should match the format of the settings.json file.
7
7
* Unknown keys, or malformed options will be rejected with an error.
8
8
* @category Utility
9
-
* @param {NobloxOptions} newOptions - The new options to set, structured as per [settings.json](https://github.com/noblox/noblox.js/blob/master/settings.json)
9
+
* @param {Partial<NobloxOptions>} newOptions - The new options to set, structured as per [settings.json](https://github.com/noblox/noblox.js/blob/master/settings.json)
Copy file name to clipboardexpand all lines: settings.json
+3
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,7 @@
1
1
{
2
+
"show_deprecation_warnings": true,
3
+
"show_deprecation_warnings_desc": "Prints console warnings for functions that are being polyfilled by newer methods due to upstream Roblox API changes",
4
+
2
5
"session_only": true,
3
6
"session_only_desc": "Minimizes data usage and speed up requests by only saving session cookies, disable if you need other cookies to be saved as well.",
Copy file name to clipboardexpand all lines: typings/index.d.ts
+11-4
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,9 @@ declare module "noblox.js" {
17
17
* NobloxOptions for setOptions, based from settings.json
18
18
*/
19
19
interfaceNobloxOptions{
20
+
/** Prints console warnings for functions that are being polyfilled by newer methods due to upstream Roblox API changes */
21
+
show_deprecation_warnings: boolean;
22
+
20
23
/** Minimizes data usage and speed up requests by only saving session cookies, disable if you need other cookies to be saved as well. (Default: true) */
* 🔐 Allows the user to login with a provided cookie string, bypassing the username/password captcha issues.
1671
1673
* By default, the provided cookie will be validated by making a HTTP request. To disable this behaviour, pass false as the second optional parameter (shouldValidate).
Copy file name to clipboardexpand all lines: typings/jsDocs.ts
+4-2
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ type CookieJar = {
14
14
* NobloxOptions for setOptions, based from settings.json
15
15
*/
16
16
typeNobloxOptions={
17
+
/** Prints console warnings for functions that are being polyfilled by newer methods due to upstream Roblox API changes */
18
+
show_deprecation_warnings: boolean;
19
+
17
20
/** Minimizes data usage and speed up requests by only saving session cookies, disable if you need other cookies to be saved as well. (Default: true) */
0 commit comments