Comparing version 4.12.0 to 5.0.0
@@ -1,69 +0,64 @@ | ||
# v4.9.0 (Thu Sep 23 2021) | ||
# v5.0.0 (Tue Feb 01 2022) | ||
#### 💥 Breaking Change | ||
- Bump eslint-plugin-jest from 24.5.2 to 25.0.5 [#445](https://github.com/noblox/noblox.js/pull/445) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
#### 🚀 Enhancement | ||
- Bump auto from 10.31.0 to 10.32.0 [#424](https://github.com/noblox/noblox.js/pull/424) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump @auto-it/conventional-commits from 10.31.0 to 10.32.0 [#425](https://github.com/noblox/noblox.js/pull/425) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@Neztore](https://github.com/Neztore)) | ||
- Bump jest from 27.1.1 to 27.2.1 [#427](https://github.com/noblox/noblox.js/pull/427) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@Neztore](https://github.com/Neztore)) | ||
- Bump jest from 27.0.6 to 27.1.0 [#421](https://github.com/noblox/noblox.js/pull/421) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Add uploadAnimation & getGroupAssets [#394](https://github.com/noblox/noblox.js/pull/394) ([@popeeyy](https://github.com/popeeyy) [@Neztore](https://github.com/Neztore) [@suufi](https://github.com/suufi)) | ||
- Implement searchGroups [#404](https://github.com/noblox/noblox.js/pull/404) ([@Neztore](https://github.com/Neztore) [@suufi](https://github.com/suufi)) | ||
- Bump entities from 2.2.0 to 3.0.1 [#408](https://github.com/noblox/noblox.js/pull/408) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint-plugin-import from 2.23.4 to 2.24.0 [#407](https://github.com/noblox/noblox.js/pull/407) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Add onJoinRequest, re-document onJoinRequestHandle, fix uncatchable errors [#504](https://github.com/noblox/noblox.js/pull/504) ([@Neztore](https://github.com/Neztore) [@suufi](https://github.com/suufi) suufi@mit.edu) | ||
- Bump eslint-plugin-jest from 25.3.4 to 25.7.0 [#510](https://github.com/noblox/noblox.js/pull/510) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint-plugin-promise from 5.1.1 to 5.2.0 [#476](https://github.com/noblox/noblox.js/pull/476) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@Neztore](https://github.com/Neztore)) | ||
- Implement getGamePasses and fix getResellers jar param [#418](https://github.com/noblox/noblox.js/pull/418) ([@alanbixby](https://github.com/alanbixby) [@suufi](https://github.com/suufi) [@Neztore](https://github.com/Neztore)) | ||
- Bump eslint-plugin-jest from 25.2.4 to 25.3.2 [#489](https://github.com/noblox/noblox.js/pull/489) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump jest from 27.3.1 to 27.4.5 [#486](https://github.com/noblox/noblox.js/pull/486) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Implement onGroupTransaction [#451](https://github.com/noblox/noblox.js/pull/451) ([@suufi](https://github.com/suufi) [@Neztore](https://github.com/Neztore)) | ||
- Dependency updates [#463](https://github.com/noblox/noblox.js/pull/463) ([@Neztore](https://github.com/Neztore)) | ||
- Bump eslint-plugin-jest from 24.4.2 to 24.5.2 [#441](https://github.com/noblox/noblox.js/pull/441) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
#### 🐛 Bug Fix | ||
- Fix overloaded jar in CSRF and wss based methods [#419](https://github.com/noblox/noblox.js/pull/419) ([@alanbixby](https://github.com/alanbixby) [@suufi](https://github.com/suufi) [@Neztore](https://github.com/Neztore)) | ||
- Bump eslint-plugin-jest from 24.4.0 to 24.4.2 [#426](https://github.com/noblox/noblox.js/pull/426) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@Neztore](https://github.com/Neztore)) | ||
- Bump tmpl from 1.0.4 to 1.0.5 [#428](https://github.com/noblox/noblox.js/pull/428) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@Neztore](https://github.com/Neztore)) | ||
- Bump nth-check from 2.0.0 to 2.0.1 [#430](https://github.com/noblox/noblox.js/pull/430) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@Neztore](https://github.com/Neztore)) | ||
- Bump jest from 27.1.0 to 27.1.1 [#422](https://github.com/noblox/noblox.js/pull/422) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@suufi](https://github.com/suufi)) | ||
- Fix configureItem part 2 [#415](https://github.com/noblox/noblox.js/pull/415) ([@policetonyR](https://github.com/policetonyR) [@alanbixby](https://github.com/alanbixby) [@suufi](https://github.com/suufi)) | ||
- Bump eslint-plugin-import from 2.24.1 to 2.24.2 [#420](https://github.com/noblox/noblox.js/pull/420) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint-plugin-import from 2.24.0 to 2.24.1 [#416](https://github.com/noblox/noblox.js/pull/416) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@suufi](https://github.com/suufi)) | ||
- Fix typo that is causing errors [#413](https://github.com/noblox/noblox.js/pull/413) ([@policetonyR](https://github.com/policetonyR) [@suufi](https://github.com/suufi)) | ||
- Bump path-parse from 1.0.6 to 1.0.7 [#410](https://github.com/noblox/noblox.js/pull/410) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Typings updates - Add displayName [#393](https://github.com/noblox/noblox.js/pull/393) ([@Neztore](https://github.com/Neztore) [@alanbixby](https://github.com/alanbixby)) | ||
- Implement auto release [#405](https://github.com/noblox/noblox.js/pull/405) ([@suufi](https://github.com/suufi)) | ||
- Implement updateUniverseAccess() [#396](https://github.com/noblox/noblox.js/pull/396) ([@alanbixby](https://github.com/alanbixby)) | ||
- Deprecate the follow method & update test functions [#391](https://github.com/noblox/noblox.js/pull/391) ([@suufi](https://github.com/suufi)) | ||
- Fix minor spelling mistake on the Docs. [#388](https://github.com/noblox/noblox.js/pull/388) ([@BillyH-0167](https://github.com/BillyH-0167) [@Neztore](https://github.com/Neztore)) | ||
- Simplify jar overloading by permitting string inputs [#376](https://github.com/noblox/noblox.js/pull/376) ([@alanbixby](https://github.com/alanbixby) [@Neztore](https://github.com/Neztore)) | ||
- Fix clear shout optional parameter [#386](https://github.com/noblox/noblox.js/pull/386) ([@alanbixby](https://github.com/alanbixby)) | ||
- Implement resale endpoints [#367](https://github.com/noblox/noblox.js/pull/367) ([@alanbixby](https://github.com/alanbixby) [@suufi](https://github.com/suufi)) | ||
- Document deleteFromInventory, configureItem parameters [#370](https://github.com/noblox/noblox.js/pull/370) ([@alanbixby](https://github.com/alanbixby) [@suufi](https://github.com/suufi)) | ||
- Add displayNames support to getPlayerInfo() [#372](https://github.com/noblox/noblox.js/pull/372) ([@alanbixby](https://github.com/alanbixby) [@suufi](https://github.com/suufi)) | ||
- Fix onGroupTransaction and make getPageResults use bluebird [#500](https://github.com/noblox/noblox.js/pull/500) ([@Neztore](https://github.com/Neztore) [@suufi](https://github.com/suufi)) | ||
- Use version 14+ of node [#525](https://github.com/noblox/noblox.js/pull/525) ([@suufi](https://github.com/suufi)) | ||
- Update dependencies & regenerate yarn.lock [#524](https://github.com/noblox/noblox.js/pull/524) (suufi@mit.edu [@suufi](https://github.com/suufi)) | ||
- Bump auto from 10.32.5 to 10.32.6 [#515](https://github.com/noblox/noblox.js/pull/515) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump @auto-it/conventional-commits from 10.32.5 to 10.32.6 [#514](https://github.com/noblox/noblox.js/pull/514) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Fix categories [#508](https://github.com/noblox/noblox.js/pull/508) ([@policetonyR](https://github.com/policetonyR)) | ||
- Implement getPlayerBadges paginations [#481](https://github.com/noblox/noblox.js/pull/481) ([@labalityowo](https://github.com/labalityowo) [@Neztore](https://github.com/Neztore)) | ||
- Fix documentation spelling (Colours -> Colors) [#507](https://github.com/noblox/noblox.js/pull/507) ([@policetonyR](https://github.com/policetonyR)) | ||
- Bump eslint-plugin-import from 2.25.3 to 2.25.4 [#494](https://github.com/noblox/noblox.js/pull/494) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint-plugin-jest from 25.3.2 to 25.3.4 [#495](https://github.com/noblox/noblox.js/pull/495) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump jest from 27.4.5 to 27.4.7 [#498](https://github.com/noblox/noblox.js/pull/498) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- fixed savePlayers.js example [#499](https://github.com/noblox/noblox.js/pull/499) ([@jcook0](https://github.com/jcook0) [@Neztore](https://github.com/Neztore)) | ||
- add presenceType to FriendEntry [#490](https://github.com/noblox/noblox.js/pull/490) ([@policetonyR](https://github.com/policetonyR)) | ||
- Bumped the getGroupTransactions url to v2 [#466](https://github.com/noblox/noblox.js/pull/466) ([@firsttobebear](https://github.com/firsttobebear) [@Neztore](https://github.com/Neztore) suufi@mit.edu) | ||
- Update typescript typing for Friends [#478](https://github.com/noblox/noblox.js/pull/478) ([@labalityowo](https://github.com/labalityowo) [@Neztore](https://github.com/Neztore)) | ||
- Fix searchGroups() docs, closes #462 [#464](https://github.com/noblox/noblox.js/pull/464) ([@alanbixby](https://github.com/alanbixby) [@Neztore](https://github.com/Neztore) [@suufi](https://github.com/suufi)) | ||
- Bump @auto-it/conventional-commits from 10.32.2 to 10.32.5 [#484](https://github.com/noblox/noblox.js/pull/484) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump auto from 10.32.2 to 10.32.5 [#485](https://github.com/noblox/noblox.js/pull/485) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint-plugin-promise from 5.1.0 to 5.1.1 [#453](https://github.com/noblox/noblox.js/pull/453) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump auto from 10.32.0 to 10.32.2 [#454](https://github.com/noblox/noblox.js/pull/454) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump @auto-it/conventional-commits from 10.32.0 to 10.32.2 [#455](https://github.com/noblox/noblox.js/pull/455) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint-plugin-jest from 25.0.5 to 25.0.6 [#447](https://github.com/noblox/noblox.js/pull/447) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
#### ⚠️ Pushed to `master` | ||
- Try GITHUB_TOKEN ([@Neztore](https://github.com/Neztore)) | ||
- Rename GitHub token env. variable ([@suufi](https://github.com/suufi)) | ||
- Use node v14+ ([@suufi](https://github.com/suufi)) | ||
- Run when tokens are available and pushed to master (suufi@mit.edu) | ||
- Use ADMIN_TOKEN for branch protection (suufi@mit.edu) | ||
#### 🏠 Internal | ||
- Use GH_TOKEN instead of GITHUB_TOKEN for auto [#414](https://github.com/noblox/noblox.js/pull/414) ([@suufi](https://github.com/suufi)) | ||
#### 🔩 Dependency Updates | ||
- Bump figlet from 1.5.0 to 1.5.2 [#409](https://github.com/noblox/noblox.js/pull/409) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@suufi](https://github.com/suufi)) | ||
- Bump @auto-it/conventional-commits from 10.30.0 to 10.31.0 [#411](https://github.com/noblox/noblox.js/pull/411) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump auto from 10.30.0 to 10.31.0 [#412](https://github.com/noblox/noblox.js/pull/412) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint from 7.31.0 to 7.32.0 [#401](https://github.com/noblox/noblox.js/pull/401) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@alanbixby](https://github.com/alanbixby)) | ||
- Bump chalk from 4.1.1 to 4.1.2 [#402](https://github.com/noblox/noblox.js/pull/402) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint-plugin-jest from 24.3.7 to 24.4.0 [#395](https://github.com/noblox/noblox.js/pull/395) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint from 7.30.0 to 7.31.0 [#389](https://github.com/noblox/noblox.js/pull/389) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint-plugin-jest from 24.3.6 to 24.3.7 [#392](https://github.com/noblox/noblox.js/pull/392) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint from 7.29.0 to 7.30.0 [#378](https://github.com/noblox/noblox.js/pull/378) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump jest from 27.0.5 to 27.0.6 [#374](https://github.com/noblox/noblox.js/pull/374) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump jest from 27.0.4 to 27.0.5 [#369](https://github.com/noblox/noblox.js/pull/369) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump eslint from 7.28.0 to 7.29.0 [#368](https://github.com/noblox/noblox.js/pull/368) ([@dependabot[bot]](https://github.com/dependabot[bot])) | ||
- Bump dotenv from 10.0.0 to 11.0.0 [#502](https://github.com/noblox/noblox.js/pull/502) ([@dependabot[bot]](https://github.com/dependabot[bot]) [@Neztore](https://github.com/Neztore)) | ||
#### Authors: 7 | ||
#### Authors: 9 | ||
- [@dependabot[bot]](https://github.com/dependabot[bot]) | ||
- [@Neztore](https://github.com/Neztore) | ||
- [@firsttobebear](https://github.com/firsttobebear) | ||
- [@jcook0](https://github.com/jcook0) | ||
- [@suufi](https://github.com/suufi) | ||
- Alan Bixby ([@alanbixby](https://github.com/alanbixby)) | ||
- BillyH ([@BillyH-0167](https://github.com/BillyH-0167)) | ||
- popeeyy ([@popeeyy](https://github.com/popeeyy)) | ||
- Josh ([@Neztore](https://github.com/Neztore)) | ||
- labalityowo ([@labalityowo](https://github.com/labalityowo)) | ||
- suufi (suufi@mit.edu) | ||
- Tony ([@policetonyR](https://github.com/policetonyR)) |
@@ -96,3 +96,4 @@ /** | ||
limit: 100, | ||
sortOrder: options.sortOrder | ||
sortOrder: options.sortOrder, | ||
rolesetId: options.roleset | ||
} | ||
@@ -99,0 +100,0 @@ |
@@ -101,3 +101,4 @@ /** | ||
limit: 100, | ||
sortOrder: options.sortOrder | ||
sortOrder: options.sortOrder, | ||
rolesetId: options.roleset | ||
} | ||
@@ -104,0 +105,0 @@ |
@@ -12,3 +12,3 @@ // Includes | ||
* 🔐 Removes an asset from the authenticated user's inventory; throws an error if the item is not owned. | ||
* @category Asset | ||
* @category Assets | ||
* @alias deleteFromInventory | ||
@@ -59,2 +59,3 @@ * @param {number} assetId - The id of the asset. | ||
}) | ||
.catch(error => reject(error)) | ||
}) | ||
@@ -61,0 +62,0 @@ } |
@@ -47,2 +47,3 @@ // Includes | ||
}) | ||
.catch(error => reject(error)) | ||
}) | ||
@@ -49,0 +50,0 @@ } |
@@ -6,3 +6,3 @@ // Includes | ||
exports.required = ['assetId'] | ||
exports.optional = ['limit', 'cursor'] | ||
exports.optional = ['limit', 'jar'] | ||
@@ -18,2 +18,3 @@ // Docs | ||
* @example const noblox = require("noblox.js") | ||
* // Login using your cookie | ||
* const resellers = await noblox.getResellers(20573078) | ||
@@ -26,3 +27,4 @@ **/ | ||
url: `//economy.roblox.com/v1/assets/${assetId}/resellers`, | ||
limit: limit | ||
limit, | ||
jar | ||
}) | ||
@@ -29,0 +31,0 @@ } |
@@ -77,2 +77,3 @@ // Includes | ||
}) | ||
.catch(error => reject(error)) | ||
}) | ||
@@ -79,0 +80,0 @@ } |
@@ -38,3 +38,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -41,0 +41,0 @@ } |
@@ -45,3 +45,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -48,0 +48,0 @@ } |
@@ -21,3 +21,3 @@ const http = require('../util/http.js').func | ||
* // Login using your cookie | ||
* noblox.setAvatarBodyColours(125, 125, 125, 125, 125, 125) | ||
* noblox.setAvatarBodyColors(125, 125, 125, 125, 125, 125) | ||
**/ | ||
@@ -50,3 +50,3 @@ | ||
} else { | ||
throw new Error('Set body colours failed') | ||
throw new Error('Set body colors failed') | ||
} | ||
@@ -53,0 +53,0 @@ }) |
@@ -45,3 +45,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -48,0 +48,0 @@ } |
// Includes | ||
const addIf = require('./addIf.js') | ||
const options = require('../options.js') | ||
const promise = require('../internal/promise.js') | ||
@@ -11,3 +10,3 @@ // Define | ||
if (group.expire > 0 || group.permanent) { | ||
return promise(function (resolve, reject) { | ||
return new Promise(function (resolve, reject) { | ||
addIf(cache, type, index, { | ||
@@ -14,0 +13,0 @@ done: resolve, |
@@ -51,3 +51,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -54,0 +54,0 @@ } |
@@ -52,3 +52,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -55,0 +55,0 @@ } |
@@ -47,3 +47,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -50,0 +50,0 @@ } |
@@ -47,3 +47,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -50,0 +50,0 @@ } |
@@ -51,3 +51,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -54,0 +54,0 @@ } |
@@ -52,3 +52,3 @@ const http = require('../util/http.js').func | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -55,0 +55,0 @@ } |
@@ -84,3 +84,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -87,0 +87,0 @@ } |
@@ -44,2 +44,3 @@ // Includes | ||
}) | ||
.catch(error => reject(error)) | ||
}) | ||
@@ -46,0 +47,0 @@ } |
@@ -47,2 +47,3 @@ // Includes | ||
}) | ||
.catch(error => reject(error)) | ||
}) | ||
@@ -49,0 +50,0 @@ } |
@@ -46,3 +46,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -49,0 +49,0 @@ } |
@@ -49,3 +49,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -52,0 +52,0 @@ } |
@@ -48,3 +48,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -51,0 +51,0 @@ } |
// Includes | ||
const http = require('../util/http.js').func | ||
const Promise = require('bluebird') | ||
@@ -48,3 +47,3 @@ exports.required = ['group'] | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -51,0 +50,0 @@ } |
@@ -44,3 +44,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -47,0 +47,0 @@ } |
@@ -1,5 +0,5 @@ | ||
const http = require('../util/http.js').func | ||
const getPageResults = require('../util/getPageResults.js').func | ||
exports.required = ['group'] | ||
exports.optional = ['transactionType', 'limit', 'cursor', 'jar'] | ||
exports.optional = ['transactionType', 'limit', 'sortOrder', 'jar'] | ||
@@ -12,6 +12,6 @@ // Docs | ||
* @param {number} group - The id of the group. | ||
* @param {("Sale" | "Purchase" | "AffiliateSale" | "DevEx" | "GroupPayout" | "AdImpressionPayout")} transactionType - The transaction type. | ||
* @param {Limit=} limit - The maximum results per a page. | ||
* @param {string=} cursor - The cursor for the next page. | ||
* @returns {Promise<TransactionPage>} | ||
* @param {("Sale" | "Purchase" | "AffiliateSale" | "DevEx" | "GroupPayout" | "AdImpressionPayout")} [transactionType=Sale] - The transaction type. | ||
* @param {number} limit - The number of transactions being fetched in total. | ||
* @param {SortOrder=} [sortOrder=Asc] - The cursor for the next page. | ||
* @returns {Promise<TransactionItem[]>} | ||
* @example const noblox = require("noblox.js") | ||
@@ -22,35 +22,13 @@ * // Login using your cookie | ||
function getTransactions (group, transactionType, limit, cursor, jar) { | ||
return new Promise((resolve, reject) => { | ||
const httpOpt = { | ||
url: `https://economy.roblox.com/v1/groups/${group}/transactions?limit=${limit}&transactionType=${transactionType}&cursor=${cursor}`, | ||
options: { | ||
method: 'GET', | ||
resolveWithFullResponse: true, | ||
jar: jar | ||
} | ||
} | ||
return http(httpOpt) | ||
.then(function (res) { | ||
const responseData = JSON.parse(res.body) | ||
if (res.statusCode !== 200) { | ||
let error = 'An unknown error has occurred.' | ||
if (responseData && responseData.errors) { | ||
error = responseData.errors.map((e) => e.message).join('\n') | ||
} | ||
reject(new Error(error)) | ||
} else { | ||
resolve(responseData) | ||
} | ||
}) | ||
}) | ||
} | ||
// Define | ||
exports.func = function (args) { | ||
const transactionType = args.transactionType || 'Sale' | ||
const limit = args.limit || 100 | ||
const cursor = args.cursor || '' | ||
return getTransactions(args.group, transactionType, limit, cursor) | ||
return getPageResults({ | ||
jar: args.jar, | ||
url: `//economy.roblox.com/v2/groups/${args.group}/transactions`, | ||
query: { | ||
transactionType: args.transactionType || 'Sale' | ||
}, | ||
sortOrder: args.sortOrder || 'Asc', | ||
limit: args.limit | ||
}) | ||
} |
// Includes | ||
const http = require('../util/http.js').func | ||
const Promise = require('bluebird') | ||
@@ -46,3 +45,3 @@ // Args | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -49,0 +48,0 @@ } |
// Includes | ||
const http = require('../util/http.js').func | ||
const Promise = require('bluebird') | ||
@@ -49,2 +48,3 @@ // Args | ||
}) | ||
.catch(error => reject(error)) | ||
}) | ||
@@ -51,0 +51,0 @@ } |
@@ -47,3 +47,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -75,3 +75,3 @@ } | ||
}) | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -78,0 +78,0 @@ } |
// Dependencies | ||
const entities = require('entities') | ||
const Promise = require('bluebird') | ||
@@ -5,0 +4,0 @@ // Includes |
@@ -43,3 +43,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -46,0 +46,0 @@ } |
@@ -47,3 +47,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -50,0 +50,0 @@ } |
// Includes | ||
const http = require('../util/http.js').func | ||
const Promise = require('bluebird') | ||
@@ -5,0 +4,0 @@ // Args |
const http = require('../util/http.js').func | ||
const Promise = require('bluebird') | ||
@@ -45,3 +44,3 @@ exports.required = ['group'] | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -48,0 +47,0 @@ } |
@@ -57,3 +57,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -60,0 +60,0 @@ } |
@@ -49,3 +49,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -52,0 +52,0 @@ } |
@@ -1,4 +0,1 @@ | ||
// Dependencies | ||
const Promise = require('bluebird') | ||
// Includes | ||
@@ -9,2 +6,3 @@ const settings = require('../../settings.json') | ||
const handleJoinRequest = require('./handleJoinRequest.js').func | ||
const promiseTimeout = require('../internal/timeout') | ||
@@ -17,3 +15,11 @@ // Args | ||
/** | ||
* 🔐 An event for when someone is added to the join requests. | ||
* 🔐 An event for when someone is added to the join requests, which allows you to handle the join request as part of a | ||
* screening process. Emits all join requests and waits until all of them have been resolved by firing the handle event | ||
* with the request and either true or false. You can also pass a third argument callback to handle to execute once the | ||
* join request has been handled. | ||
* Once all requests on a page have been resolved, the next page is collected. Make sure that all join requests are handled in some way. | ||
* Because this function has to wait for input, it does handle timeouts but does them within the function as opposed to within shortPoll. | ||
* | ||
* The use of this function is generally pretty complex. If it is not as working as you expect, you may actually be wanting | ||
* to use `onJoinRequest`. | ||
* @category Group | ||
@@ -25,5 +31,18 @@ * @alias onJoinRequestHandle | ||
* // Login using your cookie | ||
* noblox.onJoinRequestHandle().on("data", function(data) { | ||
* console.log("New request!", data) | ||
* }) | ||
* | ||
* var blacklist = [1, 261] | ||
* var evt = noblox.onJoinRequestHandle(18) | ||
* evt.on('data', function (request) { | ||
* noblox.getIdFromUsername(request.username).then(function (id) { | ||
* for (var i = 0; i < blacklist.length; i++) { | ||
* if (blacklist[i] === id) { | ||
* evt.emit('handle', request, false); | ||
* return; | ||
* } | ||
* } | ||
* evt.emit('handle', request, true, function () { | ||
* console.log(`Welcome ${id} to the group`) | ||
* }); | ||
*}); | ||
*}); | ||
**/ | ||
@@ -33,3 +52,3 @@ | ||
const requests = [] | ||
const res = await getJoinRequests({ jar, group, cursor, limit: 100 }).timeout(settings.event.timeout) | ||
const res = await promiseTimeout(getJoinRequests({ jar, group, cursor, limit: 100 }), settings.event.timeout) | ||
requests.push.apply(requests, res.data) | ||
@@ -36,0 +55,0 @@ if (res.nextPageCursor) { |
@@ -14,4 +14,4 @@ // Includes | ||
* @param {string} keyword - The keyword or search term to search by. | ||
* @param {boolean} [false] prioritizeExactMatch - Whether or not to prioritize the exact match for the keyword | ||
* @param {number} [100] - The maximum number of groups to return. Supply 0 to apply no limit, returning all results. | ||
* @param {boolean} [prioritizeExactMatch=false] - Whether or not to prioritize the exact match for the keyword | ||
* @param {number} [limit=100] - The maximum number of groups to return. Supply 0 to apply no limit, returning all results. | ||
* Note: This may significantly increase the time to execute and return potentially thousands of results. | ||
@@ -18,0 +18,0 @@ * @returns {Promise<GroupSearchItem[]>} |
@@ -55,3 +55,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -58,0 +58,0 @@ } |
@@ -54,3 +54,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -57,0 +57,0 @@ } |
// Includes | ||
const promise = require('./promise.js') | ||
const options = require('../options.js') | ||
@@ -41,3 +40,3 @@ | ||
} else { | ||
item = promise(run(delay - diff)) | ||
item = new Promise(run(delay - diff)) | ||
} | ||
@@ -49,7 +48,7 @@ jobs.push(item) | ||
const job = jobs[jobs.length - 1].then(function () { | ||
const item = promise(run(delay)) | ||
const item = new Promise(run(delay)) | ||
item.then(next).catch(deactivate) | ||
return item | ||
}).catch(function (err) { | ||
const item = handler && handler(err) ? func() : promise(run(delay)) | ||
const item = handler && handler(err) ? func() : new Promise(run(delay)) | ||
item.then(next).catch(deactivate) | ||
@@ -56,0 +55,0 @@ return item |
@@ -48,3 +48,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -51,0 +51,0 @@ } |
@@ -42,3 +42,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -45,0 +45,0 @@ } |
@@ -71,3 +71,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -74,0 +74,0 @@ } |
@@ -48,3 +48,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -51,0 +51,0 @@ } |
@@ -46,3 +46,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -49,0 +49,0 @@ } |
@@ -69,3 +69,3 @@ // Includes | ||
} | ||
}) | ||
}).catch(error => reject(error)) | ||
}) | ||
@@ -72,0 +72,0 @@ } |
@@ -16,4 +16,3 @@ // Includes | ||
* @param {string=} assetType - The asset type for the collectibles you're trying to get. | ||
* @param {Limit=} [limit=10] - The amount of results per request. | ||
* @param {string=} cursor - The cursor for the previous or next page. | ||
* @param {number} [limit=10] - The amount of results per request. | ||
* @returns {Promise<Collectibles>} | ||
@@ -20,0 +19,0 @@ * @example const noblox = require("noblox.js") |
// Includes | ||
const http = require('../util/http.js').func | ||
const Promise = require('bluebird') | ||
@@ -5,0 +4,0 @@ // Args |
// Includes | ||
const http = require('../util/http.js').func | ||
const Promise = require('bluebird') | ||
// Args | ||
@@ -6,0 +4,0 @@ exports.required = [] |
// Includes | ||
const http = require('../util/http').func | ||
const getPageResults = require('../util/getPageResults.js').func | ||
// Args | ||
exports.required = ['userId'] | ||
exports.optional = ['limit', 'cursor', 'sortOrder'] | ||
exports.optional = ['limit', 'sortOrder', 'jar'] | ||
@@ -14,53 +14,16 @@ // Docs | ||
* @param {number} userId - The id of the user whose badges are being fetched. | ||
* @param {Limit=} [limit=10] - The amount of badges being returned each request. | ||
* @param {string=} cursor - The cursor of the previous or next page. | ||
* @param {number} [limit=10] - The amount of badges being returned each request. | ||
* @param {SortOrder=} [sortOrder=Asc] - The order that the data will be returned in (Asc or Desc) | ||
* @returns {Promise<Array<PlayerBadges>>} | ||
* @example const noblox = require("noblox.js") | ||
* let badges = noblox.getPlayerBadges(123456, 10, "1684988462_1_29fbf93fdfb5b3f74d205ec09681c970", "Asc") | ||
* let badges = noblox.getPlayerBadges(123456, 10, "Asc") | ||
**/ | ||
// Define | ||
const playerBadges = (userId, limit, cursor, sortOrder) => { | ||
return http({ | ||
url: `https://badges.roblox.com/v1/users/${userId}/badges?limit=${limit}&cursor=${cursor}&sortOrder=${sortOrder}`, | ||
options: { | ||
resolveWithFullResponse: true, | ||
method: 'GET' | ||
} | ||
}).then(res => { | ||
if (res.statusCode === 200) { | ||
const json = JSON.parse(res.body) | ||
const out = [] | ||
for (const badge of json.data) { | ||
const modifiedBadge = { ...badge } | ||
modifiedBadge.updated = new Date(badge.updated) | ||
modifiedBadge.created = new Date(badge.created) | ||
out.push(modifiedBadge) | ||
} | ||
return out | ||
} else { | ||
throw new Error('User is invalid or does not exist.') | ||
} | ||
exports.func = async (args) => { | ||
return getPageResults({ | ||
jar: args.jar, | ||
url: `//badges.roblox.com/v1/users/${args.userId}/badges`, | ||
sortOrder: args.sortOrder, | ||
limit: args.limit | ||
}) | ||
} | ||
exports.func = async (args) => { | ||
if (isNaN(args.userId)) { | ||
throw new Error('The provided User ID is not a number.') | ||
} | ||
if (args.limit) { | ||
if (![10, 25, 50, 100].includes(args.limit)) { | ||
throw new Error('The allowed values are: 10, 25, 50 and 100.') | ||
} | ||
} | ||
if (args.sortOrder) { | ||
if (args.sortOrder.toLowerCase() !== 'asc' && args.sortOrder.toLowerCase() !== 'desc') { | ||
throw new Error('Invalid sort order type.') | ||
} | ||
} | ||
const limit = args.limit || 10 | ||
const sortOrder = args.sortOrder || 'Asc' | ||
const cursor = args.cursor || '' | ||
return playerBadges(args.userId, limit, cursor, sortOrder) | ||
} |
@@ -1,6 +0,6 @@ | ||
const http = require('../util/http.js').func | ||
const getPageResults = require('../util/getPageResults.js').func | ||
const getCurrentUser = require('../util/getCurrentUser.js').func | ||
exports.required = [] | ||
exports.optional = ['transactionType', 'limit', 'cursor', 'jar'] | ||
exports.optional = ['transactionType', 'limit', 'sortOrder', 'jar'] | ||
@@ -13,5 +13,5 @@ // Docs | ||
* @param {("Sale" | "Purchase" | "AffiliateSale" | "DevEx" | "GroupPayout" | "AdImpressionPayout")} [transactionType=Sale] - The type of transactions being fetched. | ||
* @param {Limit=} [limit=100] - The number of transactions being fetched each request. | [10, 25, 50, 100] | ||
* @param {string=} cursor - The previous or next page cursor. | ||
* @returns {Promise<TransactionPage>} | ||
* @param {number} limit - The number of transactions being fetched in total. | ||
* @param {SortOrder=} [sortOrder=Asc] - The cursor for the next page. | ||
* @returns {Promise<TransactionItem[]>} | ||
* @example const noblox = require("noblox.js") | ||
@@ -22,37 +22,15 @@ * // Login using your cookie | ||
function getTransactions (userId, transactionType, limit, cursor, jar) { | ||
return new Promise((resolve, reject) => { | ||
const httpOpt = { | ||
url: `https://economy.roblox.com/v2/users/${userId}/transactions?limit=${limit}&transactionType=${transactionType}&cursor=${cursor}`, | ||
options: { | ||
method: 'GET', | ||
resolveWithFullResponse: true, | ||
jar: jar | ||
} | ||
} | ||
return http(httpOpt) | ||
.then(function (res) { | ||
const responseData = JSON.parse(res.body) | ||
if (res.statusCode !== 200) { | ||
let error = 'An unknown error has occurred.' | ||
if (responseData && responseData.errors) { | ||
error = responseData.errors.map((e) => e.message).join('\n') | ||
} | ||
reject(new Error(error)) | ||
} else { | ||
resolve(responseData) | ||
} | ||
}) | ||
}) | ||
} | ||
// Define | ||
exports.func = async function (args) { | ||
const jar = args.jar | ||
const transactionType = args.transactionType || 'Sale' | ||
const limit = args.limit || 100 | ||
const cursor = args.cursor || '' | ||
const currentUser = await getCurrentUser({ jar: jar }) | ||
return getTransactions(currentUser.UserID, transactionType, limit, cursor) | ||
// return getTransactions(currentUser.UserID, transactionType, limit, cursor) | ||
return getPageResults({ | ||
jar: args.jar, | ||
url: `//economy.roblox.com/v2/users/${currentUser.UserID}/transactions`, | ||
query: { | ||
transactionType: args.transactionType || 'Sale' | ||
}, | ||
sortOrder: args.sortOrder || 'Asc', | ||
limit: args.limit | ||
}) | ||
} |
@@ -69,2 +69,3 @@ // Includes | ||
}) | ||
.catch(error => reject(error)) | ||
}) | ||
@@ -71,0 +72,0 @@ } |
@@ -6,2 +6,3 @@ // Dependencies | ||
const settings = require('../../settings.json') | ||
const promiseTimeout = require('../internal/timeout') | ||
@@ -25,3 +26,4 @@ // Args | ||
* @alias shortPoll | ||
* @param {function} getLatest - The function to use to get the latest. | ||
* @param {function} getLatest - The function to use to get the latest. Should return an object with key 'data' - an array containing output data, | ||
* and the new 'latest' value. | ||
* @returns {Promise<GetLatestResponse>} | ||
@@ -47,3 +49,3 @@ **/ | ||
if (timeout > 0) { | ||
promise = promise.timeout(timeout) | ||
promise = promiseTimeout(promise, timeout) | ||
} | ||
@@ -50,0 +52,0 @@ return promise.then(function (response) { |
@@ -1,4 +0,1 @@ | ||
// Dependencies | ||
const Promise = require('bluebird') | ||
// Includes | ||
@@ -5,0 +2,0 @@ const settings = require('../../settings.json') |
{ | ||
"name": "noblox.js", | ||
"version": "4.12.0", | ||
"version": "5.0.0", | ||
"description": "A Node.js wrapper for Roblox. (original from sentanos)", | ||
@@ -23,3 +23,2 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"bluebird": "^3.5.4", | ||
"chalk": "^4.0.0", | ||
@@ -47,15 +46,14 @@ "cheerio": "^1.0.0-rc.10", | ||
"auto": "^10.30.0", | ||
"better-docs": "^2.3.2", | ||
"dotenv": "^10.0.0", | ||
"better-docs": "2.7.1", | ||
"dotenv": "15.0.0", | ||
"eslint": "^7.28.0", | ||
"eslint-config-standard": "^16.0.3", | ||
"eslint-plugin-import": "^2.23.4", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint-plugin-import": "^2.25.3", | ||
"eslint-plugin-jest": "26.0.0", | ||
"eslint-plugin-node": "^11.0.0", | ||
"eslint-plugin-promise": "^5.1.0", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"jest": "^27.0.4", | ||
"jsdoc": "^3.6.6", | ||
"jest": "^27.3.1", | ||
"jsdoc": "3.6.10", | ||
"progress": "^2.0.0", | ||
"standard": "^16.0.0" | ||
"standard": "^16.0.4" | ||
}, | ||
@@ -83,3 +81,6 @@ "jest": { | ||
"onlyPublishWithReleaseLabel": true | ||
}, | ||
"engines": { | ||
"node": ">=14.14.0" | ||
} | ||
} |
@@ -21,4 +21,6 @@ { | ||
"onJoinRequestHandle": 10000, | ||
"onJoinRequest": 10000, | ||
"onShout": 10000, | ||
"onBlurbChange": 10000 | ||
"onBlurbChange": 10000, | ||
"onGroupTransaction": 60000 | ||
}, | ||
@@ -25,0 +27,0 @@ |
@@ -1,2 +0,2 @@ | ||
const { addDeveloperProduct, checkDeveloperProductName, configureGamePass, getDeveloperProducts, getGameBadges, getGameInstances, getGameSocialLinks, getPlaceInfo, updateDeveloperProduct, setCookie } = require('../lib') | ||
const { addDeveloperProduct, checkDeveloperProductName, configureGamePass, getDeveloperProducts, getGameBadges, getGameInstances, getGamePasses, getGameSocialLinks, getPlaceInfo, updateDeveloperProduct, setCookie } = require('../lib') | ||
@@ -84,2 +84,18 @@ beforeAll(() => { | ||
it('getGamePasses() should return an array of game passes, given universeId', () => { | ||
return getGamePasses(2615802125).then((res) => { | ||
return expect(res).toEqual( | ||
expect.arrayContaining([ | ||
expect.objectContaining({ | ||
id: expect.any(Number), | ||
name: expect.any(String), | ||
displayName: expect.any(String), | ||
productId: expect.any(Number), | ||
price: expect.any(Number) | ||
}) | ||
]) | ||
) | ||
}) | ||
}) | ||
it('getGameSocialLinks() should return social link information of a game, given universeId', () => { | ||
@@ -86,0 +102,0 @@ return getGameSocialLinks(2615802125).then((res) => { |
@@ -39,2 +39,4 @@ // types/Types | ||
onJoinRequestHandle: number; | ||
/** The poll time in milliseconds to check for new join requests. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */ | ||
onJoinRequest: number; | ||
/** The poll time in milliseconds to check for a new shout message. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. (Default: 10000) */ | ||
@@ -44,2 +46,4 @@ onShout: number; | ||
onBlurbChange: number; | ||
/** The poll time in milliseconds to check for new transaction log entries. A lower number will detect changes much quicker but will stress the network, a higher one does the opposite. This endpoint has a low rate limit. (Default: 30000) */ | ||
onGroupTransaction: number; | ||
} | ||
@@ -856,2 +860,13 @@ | ||
/** | ||
* @typedef | ||
*/ | ||
type GamePassData = { | ||
id: number; | ||
name: string; | ||
displayName: string; | ||
productId?: number; | ||
price?: number; | ||
} | ||
/// Group | ||
@@ -1106,2 +1121,4 @@ | ||
type TransactionItem = { | ||
id: number; | ||
transactionType?: string; | ||
created: Date; | ||
@@ -1117,11 +1134,2 @@ isPending: boolean; | ||
*/ | ||
type TransactionPage = { | ||
data: Array<TransactionItem>; | ||
nextPageCursor?: string; | ||
previousPageCursor?: string; | ||
} | ||
/** | ||
* @typedef | ||
*/ | ||
type GroupJoinRequester = { | ||
@@ -1272,2 +1280,3 @@ userId: number; | ||
isOnline?: boolean; | ||
presenceType: UserPresenceType; | ||
isDeleted: boolean; | ||
@@ -1274,0 +1283,0 @@ id: number; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
619820
7
15
235
14127
1
- Removedbluebird@^3.5.4