(appId: string, issueId: string, note: string)
| 15 | * @return the created Note |
| 16 | */ |
| 17 | export async function createNote(appId: string, issueId: string, note: string): Promise<Note> { |
| 18 | const requestProjectNumber = parseProjectNumber(appId); |
| 19 | logger.debug( |
| 20 | `[crashlytics] createNote called with appId: ${appId}, issueId: ${issueId}, note: ${note}`, |
| 21 | ); |
| 22 | try { |
| 23 | const response = await CRASHLYTICS_API_CLIENT.request<NoteRequest, Note>({ |
| 24 | method: "POST", |
| 25 | headers: { |
| 26 | "Content-Type": "application/json", |
| 27 | }, |
| 28 | path: `/projects/${requestProjectNumber}/apps/${appId}/issues/${issueId}/notes`, |
| 29 | body: { body: note }, |
| 30 | timeout: TIMEOUT, |
| 31 | }); |
| 32 | |
| 33 | return response.body; |
| 34 | } catch (err: unknown) { |
| 35 | throw new FirebaseError(`Failed to create note for issue ${issueId}, app ${appId}`, { |
| 36 | original: getError(err), |
| 37 | }); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Delete a Crashlytics note from an issue. |
no test coverage detected
searching dependent graphs…