codeant-cli 0.3.5 → 0.3.6

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": "codeant-cli",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Code review CLI tool",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,7 +14,7 @@ export default function Login() {
14
14
 
15
15
  useEffect(() => {
16
16
  // Check if already logged in
17
- const existingToken = getConfigValue('apiKey');
17
+ const existingToken = getConfigValue('apiKeyV2');
18
18
  if (existingToken) {
19
19
  setStatus('already_logged_in');
20
20
  setTimeout(() => exit(), 100);
@@ -48,7 +48,7 @@ export default function Login() {
48
48
  clearTimeout(timeoutId);
49
49
 
50
50
  // Save the API key
51
- setConfigValue('apiKey', token);
51
+ setConfigValue('apiKeyV2', token);
52
52
 
53
53
  setStatus('success');
54
54
  setTimeout(() => exit(), 100);
@@ -5,11 +5,11 @@ import { getConfigValue, setConfigValue } from '../utils/config.js';
5
5
  export default function Logout() {
6
6
  const { exit } = useApp();
7
7
 
8
- const wasLoggedIn = !!getConfigValue('apiKey');
8
+ const wasLoggedIn = !!getConfigValue('apiKeyV2');
9
9
 
10
10
  useEffect(() => {
11
11
  if (wasLoggedIn) {
12
- setConfigValue('apiKey', null);
12
+ setConfigValue('apiKeyV2', null);
13
13
  }
14
14
  exit();
15
15
  }, []);
@@ -31,7 +31,7 @@ export default function Review({ scanType = 'all', lastNCommits = 1, failOn = 'C
31
31
  const [fileCount, setFileCount] = useState(0);
32
32
  const [reviewMeta, setReviewMeta] = useState(null);
33
33
 
34
- const apiKey = getConfigValue('apiKey');
34
+ const apiKey = getConfigValue('apiKeyV2');
35
35
 
36
36
  useEffect(() => {
37
37
  if (!apiKey) {
@@ -87,8 +87,8 @@ export async function runReviewHeadless(options = {}) {
87
87
  } = options;
88
88
 
89
89
  // If the CLI config doesn't have an apiKey but the extension passed one, persist it
90
- if (apiKey && !getConfigValue('apiKey')) {
91
- setConfigValue('apiKey', apiKey);
90
+ if (apiKey && !getConfigValue('apiKeyV2')) {
91
+ setConfigValue('apiKeyV2', apiKey);
92
92
  }
93
93
 
94
94
  // Temporarily set env vars so fetchApi picks them up
@@ -24,7 +24,7 @@ function getClient() {
24
24
 
25
25
  /** Use the API key directly as distinct ID */
26
26
  function getDistinctId() {
27
- return process.env.CODEANT_API_TOKEN || getConfigValue('apiKey') || 'anonymous';
27
+ return process.env.CODEANT_API_TOKEN || getConfigValue('apiKeyV2') || 'anonymous';
28
28
  }
29
29
 
30
30
  /**
@@ -12,7 +12,7 @@ const fetchApi = async (endpoint, method = 'GET', body = null) => {
12
12
  };
13
13
 
14
14
  // Add auth token from config or env
15
- const token = process.env.CODEANT_API_TOKEN || getConfigValue('apiKey');
15
+ const token = process.env.CODEANT_API_TOKEN || getConfigValue('apiKeyV2');
16
16
  if (token) {
17
17
  options.headers['Authorization'] = `Bearer ${token}`;
18
18
  }