@mintlify/cli 4.0.1797 → 4.0.1798
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/__test__/feedback.test.ts +10 -18
- package/bin/cli.js +1 -1
- package/bin/feedback.js +3 -8
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/cli.tsx +1 -3
- package/src/feedback.tsx +3 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1798",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"vitest": "2.1.9",
|
|
107
107
|
"vitest-mock-process": "1.0.4"
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "25f6d9499c13bfbf4ef9754349f66aa099459954"
|
|
110
110
|
}
|
package/src/cli.tsx
CHANGED
|
@@ -732,9 +732,7 @@ export const cli = ({ packageName = 'mint' }: { packageName?: string }) => {
|
|
|
732
732
|
'$0 feedback "mint dev crashes on a missing image" --client-id 7f3a --category bug',
|
|
733
733
|
'Report a bug'
|
|
734
734
|
)
|
|
735
|
-
.epilog(
|
|
736
|
-
'Requires mint login. Never include API keys, tokens, passwords, or other secrets in the message.'
|
|
737
|
-
),
|
|
735
|
+
.epilog('Never include API keys, tokens, passwords, or other secrets in the message.'),
|
|
738
736
|
async (argv) => {
|
|
739
737
|
const sent = await feedback({
|
|
740
738
|
message: argv.message,
|
package/src/feedback.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { addLog, ErrorLog, SuccessLog } from '@mintlify/previewing';
|
|
2
2
|
|
|
3
|
-
import { authenticatedFetch } from './authenticatedFetch.js';
|
|
4
3
|
import { API_URL } from './constants.js';
|
|
5
4
|
|
|
6
5
|
export const FEEDBACK_CATEGORIES = ['bug', 'docs', 'idea'] as const;
|
|
@@ -11,21 +10,17 @@ export type FeedbackInput = {
|
|
|
11
10
|
category: (typeof FEEDBACK_CATEGORIES)[number];
|
|
12
11
|
};
|
|
13
12
|
|
|
14
|
-
const LOGIN_REQUIRED = 'not logged in. Run `mint login` first, then retry.';
|
|
15
|
-
|
|
16
13
|
export async function sendFeedback(input: FeedbackInput): Promise<string | undefined> {
|
|
17
14
|
let res: Response;
|
|
18
15
|
try {
|
|
19
|
-
res = await
|
|
16
|
+
res = await fetch(`${API_URL}/api/cli/feedback`, {
|
|
20
17
|
method: 'POST',
|
|
21
18
|
headers: { 'Content-Type': 'application/json' },
|
|
22
19
|
body: JSON.stringify({ ...input, source: 'cli' }),
|
|
23
20
|
});
|
|
24
|
-
} catch
|
|
25
|
-
|
|
26
|
-
return notLoggedIn ? LOGIN_REQUIRED : 'could not reach the server';
|
|
21
|
+
} catch {
|
|
22
|
+
return 'could not reach the server';
|
|
27
23
|
}
|
|
28
|
-
if (res.status === 401) return LOGIN_REQUIRED;
|
|
29
24
|
return res.ok ? undefined : `could not send feedback (HTTP ${res.status})`;
|
|
30
25
|
}
|
|
31
26
|
|