| 179 | } |
| 180 | |
| 181 | export async function imageVersions(name: string, version: string, authToken: string, url: string): Promise<string[]> { |
| 182 | try { |
| 183 | const res = await getAxiosInstance(url, authToken).get<string[]>( |
| 184 | `info/images/${encodeURIComponent(name)}?version=${encodeURIComponent(version)}` |
| 185 | ); |
| 186 | return res.data; |
| 187 | } catch (e) { |
| 188 | throw errorHandle(e, 'Failed to get image:'); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | export function splitEndpoints(endpointStr: string): string[] { |
| 193 | return endpointStr.split(',').map((e) => e.trim()); |