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