noblox-asset.js 7.4.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 (272) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
  3. package/.github/workflows/doc-publish.yml +33 -0
  4. package/.github/workflows/npmpublish.yml +72 -0
  5. package/.github/workflows/run-tests.yml +49 -0
  6. package/CODE_OF_CONDUCT.md +76 -0
  7. package/LICENSE +21 -0
  8. package/README.md +182 -0
  9. package/eslint.config.mjs +34 -0
  10. package/examples/cleanPlayers.js +130 -0
  11. package/examples/cleanWall.js +110 -0
  12. package/examples/revertRanks.js +100 -0
  13. package/examples/savePlayers.js +119 -0
  14. package/examples/saveWall.js +96 -0
  15. package/img/moderatedThumbnails/moderatedThumbnail_100x100.png +0 -0
  16. package/img/moderatedThumbnails/moderatedThumbnail_110x110.png +0 -0
  17. package/img/moderatedThumbnails/moderatedThumbnail_140x140.png +0 -0
  18. package/img/moderatedThumbnails/moderatedThumbnail_150x150.png +0 -0
  19. package/img/moderatedThumbnails/moderatedThumbnail_150x200.png +0 -0
  20. package/img/moderatedThumbnails/moderatedThumbnail_180x180.png +0 -0
  21. package/img/moderatedThumbnails/moderatedThumbnail_250x250.png +0 -0
  22. package/img/moderatedThumbnails/moderatedThumbnail_30x30.png +0 -0
  23. package/img/moderatedThumbnails/moderatedThumbnail_352x352.png +0 -0
  24. package/img/moderatedThumbnails/moderatedThumbnail_420x420.png +0 -0
  25. package/img/moderatedThumbnails/moderatedThumbnail_48x48.png +0 -0
  26. package/img/moderatedThumbnails/moderatedThumbnail_50x50.png +0 -0
  27. package/img/moderatedThumbnails/moderatedThumbnail_60x60.png +0 -0
  28. package/img/moderatedThumbnails/moderatedThumbnail_720x720.png +0 -0
  29. package/img/moderatedThumbnails/moderatedThumbnail_75x75.png +0 -0
  30. package/img/noblox-js-small.png +0 -0
  31. package/img/noblox-js.png +0 -0
  32. package/img/thumbnailSizes.png +0 -0
  33. package/jsDocsConfig.json +55 -0
  34. package/lib/accountinformation/getUserSocialLinks.js +40 -0
  35. package/lib/accountsettings/block.js +53 -0
  36. package/lib/accountsettings/unblock.js +53 -0
  37. package/lib/asset/deleteFromInventory.js +56 -0
  38. package/lib/asset/getGamePassProductInfo.js +50 -0
  39. package/lib/asset/getProductInfo.js +46 -0
  40. package/lib/asset/uploadAnimation.js +103 -0
  41. package/lib/asset/uploadItem.js +83 -0
  42. package/lib/asset/uploadModel.js +90 -0
  43. package/lib/avatar/avatarRules.js +39 -0
  44. package/lib/avatar/currentlyWearing.js +33 -0
  45. package/lib/avatar/getAvatar.js +36 -0
  46. package/lib/avatar/getCurrentAvatar.js +38 -0
  47. package/lib/avatar/getRecentItems.js +36 -0
  48. package/lib/avatar/outfitDetails.js +33 -0
  49. package/lib/avatar/outfits.js +38 -0
  50. package/lib/avatar/redrawAvatar.js +47 -0
  51. package/lib/avatar/removeAssetId.js +51 -0
  52. package/lib/avatar/setAvatarBodyColors.js +61 -0
  53. package/lib/avatar/setAvatarScales.js +61 -0
  54. package/lib/avatar/setPlayerAvatarType.js +51 -0
  55. package/lib/avatar/setWearingAssets.js +51 -0
  56. package/lib/avatar/wearAssetId.js +51 -0
  57. package/lib/badges/getAwardedTimestamps.js +49 -0
  58. package/lib/badges/getBadgeInfo.js +44 -0
  59. package/lib/badges/getGameBadges.js +63 -0
  60. package/lib/badges/getPlayerBadges.js +28 -0
  61. package/lib/badges/updateBadgeInfo.js +75 -0
  62. package/lib/cache/add.js +14 -0
  63. package/lib/cache/addIf.js +26 -0
  64. package/lib/cache/clear.js +8 -0
  65. package/lib/cache/get.js +28 -0
  66. package/lib/cache/index.js +17 -0
  67. package/lib/cache/new.js +12 -0
  68. package/lib/cache/wrap.js +25 -0
  69. package/lib/chat/addUsersToConversation.js +58 -0
  70. package/lib/chat/chatSettings.js +34 -0
  71. package/lib/chat/getChatMessages.js +41 -0
  72. package/lib/chat/getConversations.js +44 -0
  73. package/lib/chat/getRolloutSettings.js +36 -0
  74. package/lib/chat/getUnreadConversationCount.js +34 -0
  75. package/lib/chat/getUnreadMessages.js +39 -0
  76. package/lib/chat/getUserConversations.js +38 -0
  77. package/lib/chat/markChatAsRead.js +53 -0
  78. package/lib/chat/markChatAsSeen.js +51 -0
  79. package/lib/chat/multiGetLatestMessages.js +38 -0
  80. package/lib/chat/onNewConversation.js +50 -0
  81. package/lib/chat/onNewMessage.js +53 -0
  82. package/lib/chat/onNewMessageBySelf.js +50 -0
  83. package/lib/chat/onUserOnline.js +50 -0
  84. package/lib/chat/onUserTyping.js +54 -0
  85. package/lib/chat/removeFromGroupConversation.js +59 -0
  86. package/lib/chat/renameGroupConversation.js +58 -0
  87. package/lib/chat/sendChatMessage.js +58 -0
  88. package/lib/chat/setChatUserTyping.js +58 -0
  89. package/lib/chat/start121Conversation.js +51 -0
  90. package/lib/chat/startCloudEditConversation.js +51 -0
  91. package/lib/chat/startGroupConversation.js +59 -0
  92. package/lib/client/onNotification.js +86 -0
  93. package/lib/client/setAPIKey.js +18 -0
  94. package/lib/client/setCookie.js +38 -0
  95. package/lib/datastores/deleteDatastoreEntry.js +56 -0
  96. package/lib/datastores/getDatastoreEntry.js +88 -0
  97. package/lib/datastores/getDatastoreEntryVersions.js +73 -0
  98. package/lib/datastores/getDatastoreKeys.js +63 -0
  99. package/lib/datastores/getDatastores.js +62 -0
  100. package/lib/datastores/incrementDatastoreEntry.js +83 -0
  101. package/lib/datastores/setDatastoreEntry.js +80 -0
  102. package/lib/develop/canManage.js +42 -0
  103. package/lib/develop/configureItem.js +210 -0
  104. package/lib/develop/updateUniverse.js +52 -0
  105. package/lib/develop/updateUniverseAccess.js +54 -0
  106. package/lib/economy/getGroupFunds.js +42 -0
  107. package/lib/economy/getGroupPayoutEligibility.js +55 -0
  108. package/lib/economy/getGroupRevenueSummary.js +42 -0
  109. package/lib/economy/getGroupTransactions.js +32 -0
  110. package/lib/economy/getResaleData.js +48 -0
  111. package/lib/economy/getResellers.js +35 -0
  112. package/lib/economy/getUserFunds.js +43 -0
  113. package/lib/economy/getUserTransactions.js +34 -0
  114. package/lib/economy/onGroupTransaction.js +74 -0
  115. package/lib/friends/acceptFriendRequest.js +54 -0
  116. package/lib/friends/declineAllFriendRequests.js +52 -0
  117. package/lib/friends/declineFriendRequest.js +54 -0
  118. package/lib/friends/getFollowerCount.js +35 -0
  119. package/lib/friends/getFollowers.js +56 -0
  120. package/lib/friends/getFollowingCount.js +35 -0
  121. package/lib/friends/getFollowings.js +56 -0
  122. package/lib/friends/getFriendCount.js +35 -0
  123. package/lib/friends/getFriendRequests.js +51 -0
  124. package/lib/friends/getFriends.js +48 -0
  125. package/lib/friends/onFriendRequest.js +58 -0
  126. package/lib/friends/removeFriend.js +53 -0
  127. package/lib/friends/sendFriendRequest.js +54 -0
  128. package/lib/friends/unfollow.js +53 -0
  129. package/lib/games/addDeveloperProduct.js +53 -0
  130. package/lib/games/configureGamePass.js +126 -0
  131. package/lib/games/getDeveloperProducts.js +44 -0
  132. package/lib/games/getGameInstances.js +31 -0
  133. package/lib/games/getGamePasses.js +39 -0
  134. package/lib/games/getGameRevenue.js +48 -0
  135. package/lib/games/getGameSocialLinks.js +42 -0
  136. package/lib/games/getGroupGames.js +30 -0
  137. package/lib/games/getPlaceInfo.js +47 -0
  138. package/lib/games/getUniverseInfo.js +50 -0
  139. package/lib/games/publishToTopic.js +52 -0
  140. package/lib/games/sendUserNotification.js +65 -0
  141. package/lib/games/updateDeveloperProduct.js +56 -0
  142. package/lib/groups/banFromGroup.js +47 -0
  143. package/lib/groups/changeRank.js +59 -0
  144. package/lib/groups/deleteWallPost.js +59 -0
  145. package/lib/groups/deleteWallPostsByUser.js +55 -0
  146. package/lib/groups/demote.js +25 -0
  147. package/lib/groups/exile.js +55 -0
  148. package/lib/groups/getAuditLog.js +64 -0
  149. package/lib/groups/getGroup.js +50 -0
  150. package/lib/groups/getGroupBans.js +37 -0
  151. package/lib/groups/getGroupSocialLinks.js +41 -0
  152. package/lib/groups/getGroups.js +82 -0
  153. package/lib/groups/getJoinRequest.js +47 -0
  154. package/lib/groups/getJoinRequests.js +53 -0
  155. package/lib/groups/getPlayers.js +103 -0
  156. package/lib/groups/getRankInGroup.js +45 -0
  157. package/lib/groups/getRankNameInGroup.js +44 -0
  158. package/lib/groups/getRole.js +64 -0
  159. package/lib/groups/getRolePermissions.js +48 -0
  160. package/lib/groups/getRoles.js +53 -0
  161. package/lib/groups/getShout.js +47 -0
  162. package/lib/groups/getWall.js +56 -0
  163. package/lib/groups/groupPayout.js +103 -0
  164. package/lib/groups/handleJoinRequest.js +57 -0
  165. package/lib/groups/handleJoinRequests.js +61 -0
  166. package/lib/groups/leaveGroup.js +56 -0
  167. package/lib/groups/onAuditLog.js +62 -0
  168. package/lib/groups/onJoinRequest.js +63 -0
  169. package/lib/groups/onJoinRequestHandle.js +105 -0
  170. package/lib/groups/onShout.js +57 -0
  171. package/lib/groups/onWallPost.js +58 -0
  172. package/lib/groups/promote.js +25 -0
  173. package/lib/groups/searchGroups.js +32 -0
  174. package/lib/groups/setGroupDescription.js +58 -0
  175. package/lib/groups/setGroupName.js +59 -0
  176. package/lib/groups/setRank.js +74 -0
  177. package/lib/groups/setRoleInfo.js +84 -0
  178. package/lib/groups/shout.js +58 -0
  179. package/lib/groups/unbanFromGroup.js +41 -0
  180. package/lib/index.js +212 -0
  181. package/lib/internal/levelOneCopy.js +16 -0
  182. package/lib/internal/queue.js +61 -0
  183. package/lib/internal/timeout.js +30 -0
  184. package/lib/internal/wrap.js +78 -0
  185. package/lib/inventory/getCollectibles.js +31 -0
  186. package/lib/inventory/getInventory.js +32 -0
  187. package/lib/inventory/getInventoryById.js +31 -0
  188. package/lib/inventory/getOwnership.js +47 -0
  189. package/lib/inventory/getUAIDs.js +47 -0
  190. package/lib/itemconfiguration/getGroupAssets.js +32 -0
  191. package/lib/options.js +26 -0
  192. package/lib/party/onPartyDeleted.js +53 -0
  193. package/lib/party/onPartyInvite.js +53 -0
  194. package/lib/party/onPartyJoinedGame.js +53 -0
  195. package/lib/party/onPartyLeftGame.js +53 -0
  196. package/lib/party/onPartySelfJoined.js +53 -0
  197. package/lib/party/onPartySelfLeft.js +53 -0
  198. package/lib/party/onPartyUserJoined.js +53 -0
  199. package/lib/party/onPartyUserLeft.js +53 -0
  200. package/lib/premiumfeatures/getPremium.js +46 -0
  201. package/lib/presence/getPresences.js +60 -0
  202. package/lib/privatemessages/getMessages.js +55 -0
  203. package/lib/privatemessages/message.js +75 -0
  204. package/lib/privatemessages/onMessage.js +89 -0
  205. package/lib/thumbnails/getLogo.js +56 -0
  206. package/lib/thumbnails/getPlayerThumbnail.js +120 -0
  207. package/lib/thumbnails/getThumbnails.js +92 -0
  208. package/lib/trades/acceptTrade.js +52 -0
  209. package/lib/trades/canTradeWith.js +43 -0
  210. package/lib/trades/counterTrade.js +78 -0
  211. package/lib/trades/declineTrade.js +52 -0
  212. package/lib/trades/getTradeInfo.js +47 -0
  213. package/lib/trades/getTrades.js +37 -0
  214. package/lib/trades/sendTrade.js +76 -0
  215. package/lib/users/getBlurb.js +37 -0
  216. package/lib/users/getIdFromUsername.js +56 -0
  217. package/lib/users/getPlayerInfo.js +128 -0
  218. package/lib/users/getUserInfo.js +35 -0
  219. package/lib/users/getUsernameFromId.js +45 -0
  220. package/lib/users/getUsernameHistory.js +42 -0
  221. package/lib/users/onBlurbChange.js +46 -0
  222. package/lib/users/searchUsers.js +41 -0
  223. package/lib/util/apiError.js +50 -0
  224. package/lib/util/clearSession.js +32 -0
  225. package/lib/util/generalRequest.js +61 -0
  226. package/lib/util/getAction.js +45 -0
  227. package/lib/util/getAuthenticatedUser.js +41 -0
  228. package/lib/util/getCurrentUser.js +58 -0
  229. package/lib/util/getGeneralToken.js +52 -0
  230. package/lib/util/getHash.js +29 -0
  231. package/lib/util/getInputs.js +37 -0
  232. package/lib/util/getPageResults.js +86 -0
  233. package/lib/util/getSenderUserId.js +30 -0
  234. package/lib/util/getSession.js +38 -0
  235. package/lib/util/getVerification.js +60 -0
  236. package/lib/util/getVerificationInputs.js +31 -0
  237. package/lib/util/http.js +138 -0
  238. package/lib/util/jar.js +25 -0
  239. package/lib/util/refreshCookie.js +52 -0
  240. package/lib/util/relog.js +81 -0
  241. package/lib/util/setOptions.js +54 -0
  242. package/lib/util/shortPoll.js +102 -0
  243. package/package.json +76 -0
  244. package/postinstall.mjs +1 -0
  245. package/settings.json +115 -0
  246. package/test/accountinformation.test.js +27 -0
  247. package/test/accountsettings.test.js +27 -0
  248. package/test/asset.test.js +81 -0
  249. package/test/assets/Great-White-Shark-Fin.rbxm +0 -0
  250. package/test/assets/KeyframeSequence.rbxm +0 -0
  251. package/test/avatar.test.js +164 -0
  252. package/test/badges.test.js +96 -0
  253. package/test/chat.test.js +104 -0
  254. package/test/datastore.test.js +105 -0
  255. package/test/develop.test.js +53 -0
  256. package/test/economy.test.js +143 -0
  257. package/test/friends.test.js +146 -0
  258. package/test/games.test.js +229 -0
  259. package/test/groups.test.js +405 -0
  260. package/test/inventory.test.js +98 -0
  261. package/test/itemconfiguration.test.js +24 -0
  262. package/test/premiumfeatures.test.js +17 -0
  263. package/test/presence.test.js +25 -0
  264. package/test/privatemessages.test.js +33 -0
  265. package/test/thumbnails.test.js +53 -0
  266. package/test/users.test.js +110 -0
  267. package/tutorials/Authentication.md +75 -0
  268. package/tutorials/Event Emitters.md +26 -0
  269. package/tutorials/Promises.md +86 -0
  270. package/tutorials/VPS Authentication.md +72 -0
  271. package/typings/index.d.ts +2639 -0
  272. package/typings/jsDocs.ts +1987 -0
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: "[BUG]"
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Before posting a bug, be sure that someone else has not posted it already and it is an actual bug with noblox.js and not other frameworks like discord.js
11
+
12
+ **Describe the bug**
13
+ A clear and concise description of what the bug is.
14
+
15
+ **To Reproduce**
16
+ Steps to reproduce the behavior:
17
+ 1. Go to '...'
18
+ 2. Click on '....'
19
+ 3. Scroll down to '....'
20
+ 4. See error
21
+
22
+ **Expected behavior**
23
+ A clear and concise description of what you expected to happen.
24
+
25
+ **Error messages**
26
+ If applicable, add error messages to help explain your problem.
27
+
28
+ **Additional context**
29
+ Add any other context about the problem here.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ## Before posting a feature request, make sure that it hasn't been suggested before, is a feasible idea, and can benefit everyone.
11
+
12
+ **Is your feature request related to a problem? Please describe.**
13
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
14
+
15
+ **Describe the solution you'd like**
16
+ A clear and concise description of what you want to happen.
17
+
18
+ **Describe alternatives you've considered**
19
+ A clear and concise description of any alternative solutions or features you've considered.
20
+
21
+ **Additional context**
22
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,33 @@
1
+ name: Publish docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout code
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Set up node
16
+ uses: actions/setup-node@v4
17
+ with:
18
+ node-version: 24
19
+
20
+ - name: Install yarn
21
+ run: npm install -g yarn
22
+
23
+ - name: Build docs
24
+ run: |
25
+ yarn install
26
+ yarn docs
27
+
28
+ - name: Deploy
29
+ uses: peaceiris/actions-gh-pages@v3
30
+ with:
31
+ deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
32
+ publish_dir: ./docs
33
+ cname: noblox.js.org
@@ -0,0 +1,72 @@
1
+ name: Test & Publish
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+ - next
8
+
9
+ push:
10
+ branches:
11
+ - master
12
+ - next
13
+
14
+ permissions:
15
+ contents: write
16
+ packages: write
17
+ id-token: write
18
+ issues: write
19
+
20
+ jobs:
21
+ test:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up node
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: 24
31
+
32
+ - name: Install yarn
33
+ run: npm install -g yarn
34
+
35
+ - name: Install dependencies
36
+ run: yarn install
37
+
38
+ - name: Lint lib/
39
+ run: yarn lint
40
+
41
+ publish-npm:
42
+ needs: test
43
+ if: github.event_name == 'push'
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - name: Checkout code
47
+ uses: actions/checkout@v4
48
+
49
+ - name: Set up node
50
+ uses: actions/setup-node@v4
51
+ with:
52
+ node-version: 24
53
+
54
+ - name: Install yarn
55
+ run: npm install -g yarn
56
+
57
+ - name: Install dependencies
58
+ run: yarn install --frozen-lockfile
59
+
60
+ - name: Cache node modules
61
+ uses: actions/cache@v4
62
+ with:
63
+ path: node_modules
64
+ key: yarn-deps-${{ hashFiles('yarn.lock') }}
65
+ restore-keys: |
66
+ yarn-deps-${{ hashFiles('yarn.lock') }}
67
+
68
+ - name: Create Release
69
+ run: npx semantic-release@25.0.3
70
+ env:
71
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72
+
@@ -0,0 +1,49 @@
1
+ name: Run tests
2
+
3
+ on:
4
+ workflow_dispatch
5
+
6
+
7
+ jobs:
8
+ test:
9
+ permissions:
10
+ id-token: write
11
+
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Set up node
18
+ uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 24
21
+
22
+ - name: Enable Corepack
23
+ run: corepack enable
24
+
25
+ - name: Install dependencies
26
+ run: yarn install --frozen-lockfile
27
+
28
+ - name: Lint lib/
29
+ run: yarn lint
30
+
31
+ - id: auth
32
+ name: Generate ID Token
33
+ uses: google-github-actions/auth@v2
34
+ with:
35
+ token_format: id_token
36
+ workload_identity_provider: ${{ vars.workload_identity_provider }}
37
+ service_account: ${{ vars.service_account }}
38
+ id_token_audience: "https://${{ vars.forwarder_hostname }}"
39
+ id_token_include_email: true
40
+
41
+ - name: Run tests
42
+ env:
43
+ API_KEY: ${{ secrets.API_KEY }}
44
+ COOKIE: ${{ secrets.COOKIE }}
45
+ COOKIE_2: ${{ secrets.COOKIE_2 }}
46
+ FORWARDER_HOSTNAME: ${{ vars.forwarder_hostname }}
47
+ ID_TOKEN: ${{ steps.auth.outputs.id_token }}
48
+ run: yarn test
49
+
@@ -0,0 +1,76 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at noblox@mit.edu. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Joshua Lanese <froastj@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,182 @@
1
+ <h1 align="center">
2
+ <img src="https://raw.githubusercontent.com/noblox/noblox.js/master/img/noblox-js.png" alt="noblox.js" width="400"/>
3
+ <br>
4
+ </h1>
5
+
6
+ <h4 align="center">A Node.js wrapper for interacting with the Roblox API; forked from <a href="https://github.com/sentanos/roblox-js">roblox-js</a>.</h4>
7
+
8
+ <p align="center">
9
+ <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-blue.svg?style=flat-square" alt="JavaScript Style Guide"/></a>
10
+ <a href="https://discord.gg/R5GVSyTVGv"><img src="https://img.shields.io/badge/discord-noblox.js-blue.svg?style=flat-square" alt="noblox.js Discord"/></a>
11
+ <a href="https://npmjs.org/noblox.js"><img src="https://img.shields.io/npm/v/noblox.js.svg?style=flat-square" alt="NPM package"/>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="#about">About</a> •
16
+ <a href="#prerequisites">Prerequisites</a> •
17
+ <a href="#installation">Installation</a> •
18
+ <a href="#quickstart">Quickstart</a> •
19
+ <a href="#documentation">Documentation</a> •
20
+ <a href="#common-issues">Common Issues</a> •
21
+ <a href="https://www.youtube.com/playlist?list=PLEW4K4VqMUb_VMA3Yp9LI4gReRyVWGTnU">YouTube Series</a> •
22
+ <a href="#credits">Credits</a> •
23
+ <a href="#license">License</a>
24
+ </p>
25
+
26
+ ---
27
+
28
+ # ⚠️ Deprecation Notice
29
+ As of 29 March 2026, noblox.js is no longer maintained. This library is deprecated and will not receive further updates, including bug fixes or support for new Roblox API changes.
30
+ We have a few recommendations for alternatives:
31
+ - If you only need OpenCloud endpoints, [relatiocc/opencloud](https://github.com/relatiocc/opencloud)
32
+ - For a more fully featured library, written in typescript: [rozod](https://rozod.alrovi.com/)
33
+
34
+ Existing versions will remain available on npm, but may break as the Roblox API evolves.
35
+ Noblox.js and noblox.js-server are now deprecated, effective immediately. You should not create new work using these libraries, and where possible you should move off them to other ones.
36
+
37
+ Thank you for being a part of our community, and I hope that the library was useful to you.
38
+
39
+
40
+ ---
41
+ ## About
42
+
43
+ `noblox.js` is an open-source Roblox API wrapper written in JavaScript (with TypeScript compatibility) as a fork from sentanos's <a href="https://github.com/sentanos/roblox-js"> roblox-js module</a>.
44
+
45
+ This NPM package enables operations froms the [Roblox website](https://www.roblox.com) to be executed via NodeJS; many individuals leverage `noblox.js` along side [Roblox's HTTPService](http://wiki.roblox.com/index.php?title=API:Class/HttpService) to create in-game scripts that interact with the website, i.e. promote users, shout events, and so on, or to create Discord utilities to manage their community.
46
+
47
+ If you are looking for more information on how to create something like this, check out [our sister library, `noblox.js-server`](https://github.com/noblox/noblox.js-server) or [our YouTube series](https://www.youtube.com/playlist?list=PLEW4K4VqMUb_VMA3Yp9LI4gReRyVWGTnU). Keep in mind that these resources may not always be up to date, so it is **highly** encouraged that you learn to use the `noblox.js` library directly.
48
+
49
+
50
+ Note: We use the semantic release plugin. You should treat npm as the source of truth regarding package versions - the package.json version in this repository will not be up to date.
51
+ ---
52
+
53
+ ## Prerequisites
54
+
55
+ - [**Node.js®**](https://nodejs.org/en/download/current/) v18.18 or later
56
+
57
+ ---
58
+
59
+ ## Installation
60
+
61
+ With node.js installed simply run:
62
+ ```bash
63
+ # Run this to install noblox.js locally to your repository.
64
+ $ npm install noblox.js
65
+
66
+ # Alternatively, if you are using yarn:
67
+ $ yarn add noblox.js
68
+
69
+ # To use noblox.js anywhere, run this code to install the package globally:
70
+ $ npm install noblox.js -g
71
+ ```
72
+ That's it!
73
+
74
+ ---
75
+
76
+ ## Documentation
77
+
78
+ You can locate the [`noblox.js` documentation here](https://noblox.js.org/); keep in mind some internal or legacy methods may not be documented.
79
+
80
+ ### Legend
81
+ You may notice our documentation utilizes emojis in every function description; they have meanings!
82
+
83
+ | Icon | Description |
84
+ | ---- | ----------- |
85
+ | 🔐 | Authentication through `setCookie()` is required to use this method.<sup id="a1">[1](#f1)</sup>
86
+ | 🔓 | Authentication through `setCookie()` is required in **some** use-cases; dependent on the target's privacy settings.
87
+ | ✅ | No authentication is required to use this method.
88
+
89
+ <b id="f1">[1](#a1)</b> : Extended permissions may be required such as edit permissions or account ownership.
90
+
91
+ ---
92
+
93
+ ## Quickstart
94
+
95
+ 1) [Install `noblox.js`.](#installation)
96
+
97
+ 2) Retrieve your `.ROBLOSECURITY` cookie. Instructions on how to do that can be found [here](https://noblox.js.org/tutorial-Authentication.html).
98
+
99
+ 3) Write your code.
100
+
101
+ _Using `async/await` syntax:_
102
+ ```js
103
+ const noblox = require('noblox.js')
104
+ async function startApp () {
105
+ // You MUST call setCookie() before using any authenticated methods [marked by 🔐]
106
+ // Replace the parameter in setCookie() with your .ROBLOSECURITY cookie.
107
+ const currentUser = await noblox.setCookie('_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_6E6F626C6F782E6A73')
108
+ console.log(`Logged in as ${currentUser.UserName} [${currentUser.UserID}]`)
109
+
110
+ // Do everything else, calling functions and the like.
111
+ const groupInfo = await noblox.getGroup(9997719)
112
+ console.log(groupInfo)
113
+ }
114
+ startApp()
115
+ ```
116
+
117
+ You are now using noblox.js!
118
+
119
+ ### [More examples can be found here.](https://github.com/noblox/noblox.js/tree/master/examples)
120
+
121
+ **Promises are fundamental to this library**; if you are unfamiliar with JavaScript promises, we recommend you check out [our tutorial here](https://noblox.js.org/tutorial-Promises.html), and [Daniel Shiffman's JavaScript series](https://www.youtube.com/watch?v=QO4NXhWo_NM&list=PLRqwX-V7Uu6YgpA3Oht-7B4NBQwFVe3pr&index=12).
122
+
123
+ ---
124
+
125
+ ## Hiding Your Cookie
126
+
127
+ It is bad practice to store your `.ROBLOSECURITY` cookie inside your codebase; it is too easy to accidentally screenshot or push this private key to GitHub. We recommend using a [package such as `dotenv`](https://www.npmjs.com/package/dotenv) to store your private information in environmental variables.
128
+
129
+ We recommend using a secondary account for botting purposes.
130
+
131
+ Consult their documentation or [follow this video](https://www.youtube.com/watch?v=17UVejOw3zA).
132
+
133
+ ---
134
+
135
+ ### Invalidating A Cookie
136
+
137
+ In the event of accidentally exposing your `.ROBLOSECURITY` cookie, do not panic. Go to [`Account Settings` > `Security`](https://www.roblox.com/my/account#!/security), select `Sign out of all other sessions`, then log out of your account. This should invalidate your `.ROBLOSECURITY` cookie.
138
+
139
+
140
+ ---
141
+
142
+ ## Common Issues
143
+
144
+ > **Error: You are not logged in.**
145
+
146
+ You may be calling a function before `setCookie()` is completed; make sure that you are awaiting `setCookie()` before initializing any event listeners or function calls.
147
+
148
+ `noblox.js` is a promise based library, this enables you to run operations concurrently; however if you are not awaiting your promises, this means while `setCookie()` is validating your cookie, _your other functions will continue to run_- ~30ms is a **long time** at the computer scale.
149
+
150
+ **Promises are fundamental to this library**; if you are unfamiliar with JavaScript promises, we recommend you check out [our tutorial here](https://noblox.js.org/tutorial-Promises.html), and [Daniel Shiffman's JavaScript series](https://www.youtube.com/watch?v=QO4NXhWo_NM&list=PLRqwX-V7Uu6YgpA3Oht-7B4NBQwFVe3pr&index=12).
151
+
152
+ > **Error: 400 The roleset is invalid or does not exist.**
153
+
154
+ You likely are using a `rankId` (0 - 255) instead of a `rolesetId` (>255); a `rolesetId` is a unique identifier for a role which you can find by calling [`getRoles(groupId)`](https://noblox.js.org/global.html#getRoles).
155
+
156
+ Roblox's naming scheme is a fickle beast; similarly, a `developerProductId` is _different_ than a `productId` (which appears on the public facing dashboard); use [`getDeveloperProducts(placeId)`](https://noblox.js.org/global.html#getDeveloperProducts) to see the `developerProductId`.
157
+
158
+
159
+
160
+ > **Error: Initialization failed: 401 Authorization has been denied for this request.**
161
+
162
+ First, see the steps for `Error: You are not logged in`.
163
+
164
+ If this is unresolved, are you sure the bot has permissions to access this resource? Can you do this operation manually on the website through the bot account?
165
+
166
+ At the end of the day, a 'bot' is a user account, it cannot magically bypass privacy restrictions or group permissions.
167
+
168
+ ---
169
+
170
+ ## Credits
171
+ * [suufi](https://github.com/suufi) - Lead maintainer
172
+ * [sentanos](https://github.com/sentanos) - We wouldn't exist without him. 😀
173
+ * [Neztore](https://github.com/Neztore) - Library maintenance and review
174
+ * [alanbixby](https://github.com/alanbixby) - Library maintenance
175
+ * [popeeyy](https://github.com/popeeyy) - Creation of the documentation.
176
+ * [edward](https://github.com/edwrddd) - Helping with the creation of the documentation.
177
+
178
+ ---
179
+
180
+ ## License
181
+
182
+ [MIT](https://github.com/noblox/noblox.js/blob/master/LICENSE)
@@ -0,0 +1,34 @@
1
+ import jest from "eslint-plugin-jest";
2
+ import globals from "globals";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import js from "@eslint/js";
6
+ import { FlatCompat } from "@eslint/eslintrc";
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ const compat = new FlatCompat({
11
+ baseDirectory: __dirname,
12
+ recommendedConfig: js.configs.recommended,
13
+ allConfig: js.configs.all
14
+ });
15
+
16
+ export default [...compat.extends("standard", "plugin:jest/recommended"), {
17
+ plugins: {
18
+ jest,
19
+ },
20
+
21
+ languageOptions: {
22
+ globals: {
23
+ ...globals.commonjs,
24
+ ...globals.node,
25
+ Atomics: "readonly",
26
+ SharedArrayBuffer: "readonly",
27
+ },
28
+
29
+ ecmaVersion: 2018,
30
+ sourceType: "commonjs",
31
+ },
32
+
33
+ rules: {},
34
+ }];
@@ -0,0 +1,130 @@
1
+ /**
2
+ * About:
3
+ * Exiles group members with optional filtering.
4
+ *
5
+ * NOTE: By default, this will exile all players in the rolesets provided. Change the body of shouldExile to alter this behaviour.
6
+ */
7
+
8
+ // Settings
9
+ const cookie = process.env.COOKIE || '' // Roblox account .ROBLOSECURITY cookie
10
+ const options = {
11
+ group: 0, // Group ID
12
+ roleset: [1, 2, 3], // Array of roleset IDs - NOTE: This is not the same as role number
13
+ limit: -1, // Search limit - NOTE: When <= 0 there is no limit
14
+ exileLimit: -1, // Exile limit - NOTE: When <= 0 there is no limit
15
+ sortOrder: 'Asc' // Sort order: "Asc" or "Desc"
16
+ }
17
+
18
+ function shouldExile (player) {
19
+ /*
20
+ if (player.username === "Bob") {
21
+ return true // Exile Bob
22
+ } else if (player.username.toLowerCase().includes("bot")) {
23
+ return true // Exile users with username containing "bot"
24
+ } else if (player.userId > 1000000000) {
25
+ return true // Exile users with userId over 1 billion
26
+ }
27
+
28
+ return false
29
+ */
30
+
31
+ return true // Exile all players found
32
+ }
33
+
34
+ // Dependencies
35
+ const noblox = require('noblox.js')
36
+ const logUpdate = require('log-update')
37
+
38
+ const players = {
39
+ passed: 0,
40
+ exiled: 0,
41
+ failed: 0
42
+ }
43
+
44
+ noblox.setCookie(cookie)
45
+ .then(async () => {
46
+ console.time('Time taken')
47
+
48
+ const getRolesOptions = {
49
+ group: options.group
50
+ }
51
+
52
+ const groupRoles = await noblox.getRoles(getRolesOptions)
53
+ const targetRoles = []
54
+
55
+ for (const role of groupRoles) {
56
+ if (options.roleset.includes(role.id)) {
57
+ targetRoles.push(role)
58
+ }
59
+
60
+ if (targetRoles.length === options.roleset.length) {
61
+ break
62
+ }
63
+ }
64
+
65
+ if (targetRoles.length === 0) {
66
+ console.error('No roles matching the roleset IDs were found.')
67
+
68
+ return
69
+ }
70
+
71
+ options.roleset = targetRoles.map((role) => {
72
+ return role.id
73
+ })
74
+
75
+ let totalPlayers = 0
76
+
77
+ for (const role of targetRoles) {
78
+ totalPlayers += role.memberCount
79
+ }
80
+
81
+ if (options.limit > 0) {
82
+ totalPlayers = Math.min(options.limit, totalPlayers)
83
+ }
84
+
85
+ if (totalPlayers >= 10000) {
86
+ console.log(`Fetching ${totalPlayers} players, this will take a while...`)
87
+ } else if (totalPlayers >= 2000) {
88
+ console.log(`Fetching ${totalPlayers} players, this may take a while...`)
89
+ } else {
90
+ console.log(`Fetching ${totalPlayers} players...`)
91
+ }
92
+
93
+ const getPlayersOptions = {
94
+ group: options.group,
95
+ limit: 100,
96
+ sortOrder: options.sortOrder,
97
+ rolesetId: options.roleset
98
+ }
99
+
100
+ const groupPlayers = await noblox.getPlayers(getPlayersOptions)
101
+
102
+ const logUpdater = setInterval(() => {
103
+ logUpdate(`Got ${groupPlayers.length} players, exiling...\nPassed: ${players.passed}\nExiled: ${players.exiled}\nFailed: ${players.failed}`)
104
+
105
+ if (players.passed + players.exiled + players.failed === groupPlayers.length) {
106
+ clearInterval(logUpdater)
107
+
108
+ console.timeEnd('Time taken')
109
+ }
110
+ }, 100)
111
+
112
+ groupPlayers.forEach((player) => {
113
+ if (shouldExile(player)) {
114
+ const exileOptions = {
115
+ group: options.group,
116
+ target: player.userId
117
+ }
118
+
119
+ noblox.exile(exileOptions)
120
+ .then(() => {
121
+ players.exiled++
122
+ })
123
+ .catch(() => {
124
+ players.failed++
125
+ })
126
+ } else {
127
+ players.passed++
128
+ }
129
+ })
130
+ })