@mintlify/cli 4.0.1434 → 4.0.1437
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/bin/cli.js +10 -4
- package/bin/mintTest.js +96 -0
- package/bin/mintTestNav.js +35 -0
- package/bin/mintTestTree.js +94 -0
- package/bin/mintTestUi.js +610 -0
- package/bin/status.js +11 -4
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +10 -9
- package/src/cli.tsx +15 -9
- package/src/mintTest.tsx +102 -0
- package/src/mintTestNav.ts +31 -0
- package/src/mintTestTree.ts +134 -0
- package/src/mintTestUi.tsx +988 -0
- package/src/status.tsx +11 -4
package/src/status.tsx
CHANGED
|
@@ -14,20 +14,27 @@ const StatusResponseSchema = z.object({
|
|
|
14
14
|
subdomains: z.array(z.string()).default([]),
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
export async function
|
|
17
|
+
export async function getCliStatus(
|
|
18
|
+
accessToken: string
|
|
19
|
+
): Promise<z.infer<typeof StatusResponseSchema> | null> {
|
|
18
20
|
try {
|
|
19
21
|
const res = await fetch(`${API_URL}/api/cli/status`, {
|
|
20
22
|
headers: { Authorization: `Bearer ${accessToken}` },
|
|
21
23
|
});
|
|
22
|
-
if (!res.ok) return
|
|
24
|
+
if (!res.ok) return null;
|
|
23
25
|
const json = await res.json().catch(() => null);
|
|
24
26
|
const parsed = StatusResponseSchema.safeParse(json);
|
|
25
|
-
return parsed.success ? parsed.data
|
|
27
|
+
return parsed.success ? parsed.data : null;
|
|
26
28
|
} catch {
|
|
27
|
-
return
|
|
29
|
+
return null;
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
export async function getCliSubdomains(accessToken: string): Promise<string[]> {
|
|
34
|
+
const status = await getCliStatus(accessToken);
|
|
35
|
+
return status?.subdomains ?? [];
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
export async function status(): Promise<void> {
|
|
32
39
|
const accessToken = await getAccessToken();
|
|
33
40
|
|