ticketlens 0.38.22 → 0.38.23

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,6 +1,6 @@
1
1
  {
2
2
  "name": "ticketlens",
3
- "version": "0.38.22",
3
+ "version": "0.38.23",
4
4
  "description": "Jira CLI for developers — fetch ticket context, triage your queue, and stop tab-switching. Zero dependencies, all local.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -23,6 +23,22 @@ export async function testConnections({
23
23
  for (const name of names) {
24
24
  const profile = config.profiles[name];
25
25
  const profileCreds = creds[name] || {};
26
+
27
+ if (!profileCreds.apiToken && !profileCreds.pat) {
28
+ // No point attempting a network call with no credentials — but still
29
+ // drive the session through spin()/failed()/footer() so callers that
30
+ // render `stream` live (e.g. onboarding.mjs's "Test connections" menu
31
+ // item, which discards this function's return value and relies
32
+ // entirely on stream output for user feedback) don't go silent.
33
+ const session = createSession({ baseUrl: profile.baseUrl, profileName: name, email: profile.email || undefined }, { stream });
34
+ const hint = `Run \`ticketlens config --profile=${name}\` to add an API token or PAT.`;
35
+ session.spin('Testing connection...');
36
+ session.failed();
37
+ session.footer('No credentials stored.', 'error', hint);
38
+ results.push({ name, ok: false, error: 'No credentials stored.', hint });
39
+ continue;
40
+ }
41
+
26
42
  const conn = {
27
43
  baseUrl: profile.baseUrl,
28
44
  auth: profile.auth,
@@ -131,6 +131,14 @@ export async function checkConnectivity({
131
131
  };
132
132
  }
133
133
  const creds = loadCredentialsFn(configDir)[profile.name] || {};
134
+ if (!creds.apiToken && !creds.pat) {
135
+ return {
136
+ id: 'connectivity', label: 'Tracker connectivity', ok: false,
137
+ message: `Profile "${profile.name}" has no credentials stored.`,
138
+ hint: `Run \`ticketlens config --profile=${profile.name}\` to add an API token or PAT.`,
139
+ fixable: false,
140
+ };
141
+ }
134
142
  const conn = {
135
143
  baseUrl: profile.baseUrl, auth: profile.auth, email: profile.email,
136
144
  apiToken: creds.apiToken, pat: creds.pat, allowPrivateIp: profile.allowPrivateIp,