@sortlist/cli 0.34.0 → 0.35.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.
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@sortlist/cli",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Sortlist platform CLI — GraphQL federation client",
5
5
  "type": "module",
6
+ "engines": {
7
+ "node": ">=20"
8
+ },
6
9
  "publishConfig": {
7
10
  "access": "public"
8
11
  },
@@ -129,9 +129,22 @@ function coerceValue(raw: string, type: GraphQLInputType, flagName: string): unk
129
129
  }
130
130
 
131
131
  const typeName = unwrap(type).name;
132
- if (typeName === 'Int') return parseInt(raw, 10);
133
- if (typeName === 'Float') return parseFloat(raw);
134
- if (typeName === 'Boolean') return raw === 'true';
132
+ if (typeName === 'Int') {
133
+ const parsed = parseInt(raw, 10);
134
+ if (Number.isNaN(parsed)) throw new Error(`--${flagName} expects an integer, got "${raw}".`);
135
+ return parsed;
136
+ }
137
+ if (typeName === 'Float') {
138
+ const parsed = parseFloat(raw);
139
+ if (Number.isNaN(parsed)) throw new Error(`--${flagName} expects a number, got "${raw}".`);
140
+ return parsed;
141
+ }
142
+ if (typeName === 'Boolean') {
143
+ if (raw !== 'true' && raw !== 'false') {
144
+ throw new Error(`--${flagName} expects "true" or "false", got "${raw}".`);
145
+ }
146
+ return raw === 'true';
147
+ }
135
148
  return raw;
136
149
  }
137
150
 
@@ -131,7 +131,9 @@ async function executeQuery<T = Record<string, unknown>>(
131
131
  headers['Authorization'] = `Bearer ${creds.accessToken}`;
132
132
 
133
133
  if (verbose) {
134
- info(`[debug] JWT: ${creds.accessToken}`);
134
+ // Never print the full token — debug output ends up in pasted logs.
135
+ // `sl token` is the deliberate way to get the raw value.
136
+ info(`[debug] JWT: ...${creds.accessToken.slice(-8)}`);
135
137
  }
136
138
  }
137
139