| 450 | } |
| 451 | |
| 452 | export function customEnvironmentId(context: VercelContext, slug: string): string | undefined { |
| 453 | const response = vercelApi( |
| 454 | context, |
| 455 | `/v9/projects/${encodeURIComponent(context.project)}/custom-environments`, |
| 456 | `List ${context.project} custom environments` |
| 457 | ); |
| 458 | const match = records(response.environments).find( |
| 459 | environment => stringValue(environment, 'slug') === slug |
| 460 | ); |
| 461 | return match ? stringValue(match, 'id') : undefined; |
| 462 | } |
| 463 | |
| 464 | // Vercel decrypts encrypted values one record at a time (the list endpoint does |
| 465 | // not), and never returns sensitive values. |
| 466 | export async function decryptedEnvValues( |