( cid: string | undefined, authToken: string, url: string )
| 160 | } |
| 161 | |
| 162 | export async function ipfsCID_validate( |
| 163 | cid: string | undefined, |
| 164 | authToken: string, |
| 165 | url: string |
| 166 | ): Promise<ValidateDataType> { |
| 167 | assert(cid, 'IPFS CID is required'); |
| 168 | try { |
| 169 | const res = await getAxiosInstance(url, authToken).post<ValidateDataType>(`ipfs/deployment-id/${cid}/validate`); |
| 170 | |
| 171 | if (res.status === 500) { |
| 172 | throw new Error((res.data as unknown as {message: string}).message); |
| 173 | } |
| 174 | |
| 175 | return res.data; |
| 176 | } catch (e) { |
| 177 | throw errorHandle(e, 'Failed to validate IPFS CID:'); |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | export async function imageVersions(name: string, version: string, authToken: string, url: string): Promise<string[]> { |
| 182 | try { |
no test coverage detected