( projectId: string, config: Config, service?: string, location?: string, )
| 20 | |
| 21 | /** Picks exactly one SQL Connect service based on flags. */ |
| 22 | export async function pickOneService( |
| 23 | projectId: string, |
| 24 | config: Config, |
| 25 | service?: string, |
| 26 | location?: string, |
| 27 | ): Promise<ServiceInfo> { |
| 28 | const services = await pickServices(projectId, config, service, location); |
| 29 | if (services.length > 1) { |
| 30 | const serviceIds = services.map( |
| 31 | (i) => `${i.dataConnectYaml.location}:${i.dataConnectYaml.serviceId}`, |
| 32 | ); |
| 33 | throw new FirebaseError( |
| 34 | `Multiple services matched. Please specify a service and location. Matched services: ${serviceIds.join( |
| 35 | ", ", |
| 36 | )}`, |
| 37 | ); |
| 38 | } |
| 39 | return services[0]; |
| 40 | } |
| 41 | |
| 42 | /** Picks SQL Connect services based on flags. */ |
| 43 | export async function pickServices( |
no test coverage detected
searching dependent graphs…