()
| 350 | } |
| 351 | |
| 352 | private buildHeaders(): Record<string, string> { |
| 353 | const headers: Record<string, string> = { |
| 354 | 'Content-Type': 'application/json', |
| 355 | }; |
| 356 | |
| 357 | if (this.tenantId) { |
| 358 | headers['X-Scope-OrgID'] = this.tenantId; |
| 359 | } |
| 360 | |
| 361 | if (this.username && this.password) { |
| 362 | const credentials = Buffer.from(`${this.username}:${this.password}`).toString('base64'); |
| 363 | headers.Authorization = `Basic ${credentials}`; |
| 364 | } |
| 365 | |
| 366 | return headers; |
| 367 | } |
| 368 | |
| 369 | private resolveUrl(path: string): string { |
| 370 | const base = (this.baseUrl ?? '').replace(/\/+$/, ''); |
no test coverage detected