| 45 | } |
| 46 | |
| 47 | export async function suggestSkills( |
| 48 | dependencies: string[], |
| 49 | accessToken?: string |
| 50 | ): Promise<SuggestResponse> { |
| 51 | const headers: Record<string, string> = { "Content-Type": "application/json" }; |
| 52 | if (accessToken) { |
| 53 | headers["Authorization"] = `Bearer ${accessToken}`; |
| 54 | } |
| 55 | const response = await fetch(`${baseUrl}/api/v2/skills/suggest`, { |
| 56 | method: "POST", |
| 57 | headers, |
| 58 | body: JSON.stringify({ dependencies }), |
| 59 | }); |
| 60 | return (await response.json()) as SuggestResponse; |
| 61 | } |
| 62 | |
| 63 | export async function downloadSkill(project: string, skillName: string): Promise<DownloadResponse> { |
| 64 | const skillData = await getSkill(project, skillName); |