MCPcopy
hub / github.com/angular/angularfire / appPrompt

Function appPrompt

src/schematics/setup/prompts.ts:155–175  ·  view source on GitHub ↗
({ projectId: project }: FirebaseProject, defaultAppId: string|undefined, options: any)

Source from the content-addressed store, hash-verified

153};
154
155export const appPrompt = async ({ projectId: project }: FirebaseProject, defaultAppId: string|undefined, options: any) => {
156 const firebaseTools = await getFirebaseTools();
157 const apps = await firebaseTools.apps.list('web', { ...options, project });
158 const { appId } = await autocomplete({
159 type: 'autocomplete',
160 name: 'appId',
161 source: searchApps(apps),
162 message: 'Please select an app:',
163 default: defaultAppId,
164 });
165 if (appId === NEW_OPTION) {
166 const { displayName } = await inquirer.prompt({
167 type: 'input',
168 name: 'displayName',
169 message: 'What would you like to call your app?',
170 }) as { displayName: string };
171 return await firebaseTools.apps.create('web', displayName, { ...options, nonInteractive: true, project });
172 }
173 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
174 return (apps).find(it => shortAppId(it) === appId)!;
175};

Callers 1

ngAddSetupProjectFunction · 0.90

Calls 5

getFirebaseToolsFunction · 0.90
shortAppIdFunction · 0.90
autocompleteFunction · 0.85
searchAppsFunction · 0.85
listMethod · 0.65

Tested by

no test coverage detected