1 | |
2 | |
3 | * Update a project release file |
4 | * Update a project release file. |
5 | */ |
6 | export async function main( |
7 | auth: RT.Sentry, |
8 | project_id_or_slug: string, |
9 | version: string, |
10 | file_id: string, |
11 | body: Body |
12 | ) { |
13 | const url = new URL( |
14 | `https://${auth.region}.sentry.io/api/0/projects/${auth.organizationSlug}/${project_id_or_slug}/releases/${version}/files/${file_id}/` |
15 | ) |
16 |
|
17 | const response = await fetch(url, { |
18 | method: 'PUT', |
19 | headers: { |
20 | 'Content-Type': 'application/json', |
21 | Authorization: 'Bearer ' + auth.token |
22 | }, |
23 | body: JSON.stringify(body) |
24 | }) |
25 | if (!response.ok) { |
26 | const text = await response.text() |
27 | throw new Error(`${response.status} ${text}`) |
28 | } |
29 | return await response.json() |
30 | } |
31 |
|
32 | |
33 | |
34 | * This file was automatically generated by json-schema-to-typescript. |
35 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
36 | * and run json-schema-to-typescript to regenerate this file. |
37 | */ |
38 |
|
39 | export interface Body { |
40 | |
41 | * The new name (full path) of the file. |
42 | */ |
43 | name?: string |
44 | |
45 | * The new name of the dist. |
46 | */ |
47 | dist?: string |
48 | [k: string]: unknown |
49 | } |
50 |
|