libroadcast-cli 1.11.0 → 1.11.1

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.
@@ -107,11 +107,15 @@ const checkTokenScopes = async (modRequired) => {
107
107
  "Content-Type": "text/plain",
108
108
  },
109
109
  body: exports.LICHESS_TOKEN,
110
+ bodySerializer: (body) => body,
110
111
  })
111
112
  .then((response) => response.data)
112
- .then((data) => data?.[exports.LICHESS_TOKEN].scopes?.split(","))
113
+ .then((data) => {
114
+ let scopes = data?.[exports.LICHESS_TOKEN]?.scopes;
115
+ return scopes ? scopes.split(",") : [];
116
+ })
113
117
  .then((scopes) => {
114
- const missingScopes = requiredScopes.filter((scope) => !scopes?.includes(scope));
118
+ const missingScopes = requiredScopes.filter((scope) => !scopes.includes(scope));
115
119
  if (missingScopes.length > 0) {
116
120
  console.error(colors_1.default.red(`Error: Missing required token scopes: ${missingScopes.join(", ")}`));
117
121
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libroadcast-cli",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "CLI to help with broadcast maintenance on Lichess",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [