MCPcopy Create free account
hub / github.com/firebase/firebase-tools / askForEventArcLocation

Function askForEventArcLocation

src/extensions/askUserForEventsConfig.ts:139–159  ·  view source on GitHub ↗
(preselectedLocation?: string)

Source from the content-addressed store, hash-verified

137 * @return A string representing the EventArc location.
138 */
139export async function askForEventArcLocation(preselectedLocation?: string): Promise<string> {
140 let valid = false;
141 let location = "";
142 while (!valid) {
143 location = await select({
144 default: preselectedLocation ?? EXTENSIONS_DEFAULT_EVENT_ARC_REGION,
145 message:
146 "Which location would you like the Eventarc channel to live in? We recommend using the default option. A channel location that differs from the extension's Cloud Functions location can incur egress cost.",
147 choices: ALLOWED_EVENT_ARC_REGIONS,
148 });
149 valid = ALLOWED_EVENT_ARC_REGIONS.includes(location);
150 if (!valid) {
151 utils.logWarning(
152 `Unexpected EventArc region '${location}' was specified. Allowed regions: ${ALLOWED_EVENT_ARC_REGIONS.join(
153 ", ",
154 )}`,
155 );
156 }
157 }
158 return location;
159}

Callers 2

askForEventsConfigFunction · 0.85

Calls 1

selectFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…