@angular/fire 18.0.1 → 19.0.0-canary.6b1b0ca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/analytics/analytics.module.d.ts +2 -2
- package/analytics/firebase.d.ts +3 -3
- package/analytics/screen-tracking.service.d.ts +1 -1
- package/auth/rxfire.d.ts +2 -2
- package/compat/database/database.d.ts +1 -1
- package/compat/firestore/firestore.d.ts +1 -1
- package/compat/storage/pipes/storageUrl.pipe.d.ts +2 -2
- package/compat/storage/storage.d.ts +1 -1
- package/compat/storage/storage.module.d.ts +1 -1
- package/data-connect/data-connect.d.ts +9 -0
- package/data-connect/data-connect.module.d.ts +13 -0
- package/data-connect/firebase.d.ts +12 -0
- package/{vertexai-preview → data-connect}/index.d.ts +1 -1
- package/data-connect/package.json +3 -0
- package/data-connect/public_api.d.ts +3 -0
- package/database/rxfire.d.ts +4 -4
- package/docs/install-and-setup.md +10 -5
- package/docs/vertexai.md +3 -3
- package/fesm2022/angular-fire-analytics.mjs +25 -52
- package/fesm2022/angular-fire-analytics.mjs.map +1 -1
- package/fesm2022/angular-fire-app-check.mjs +4 -4
- package/fesm2022/angular-fire-app-check.mjs.map +1 -1
- package/fesm2022/angular-fire-app.mjs +4 -4
- package/fesm2022/angular-fire-app.mjs.map +1 -1
- package/fesm2022/angular-fire-auth-guard.mjs +7 -7
- package/fesm2022/angular-fire-auth-guard.mjs.map +1 -1
- package/fesm2022/angular-fire-auth.mjs +6 -6
- package/fesm2022/angular-fire-auth.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-analytics.mjs +15 -15
- package/fesm2022/angular-fire-compat-analytics.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-auth-guard.mjs +7 -7
- package/fesm2022/angular-fire-compat-auth-guard.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-auth.mjs +10 -9
- package/fesm2022/angular-fire-compat-auth.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-database.mjs +20 -19
- package/fesm2022/angular-fire-compat-database.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-firestore.mjs +25 -24
- package/fesm2022/angular-fire-compat-firestore.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-functions.mjs +7 -7
- package/fesm2022/angular-fire-compat-functions.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-messaging.mjs +7 -7
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-performance.mjs +10 -10
- package/fesm2022/angular-fire-compat-performance.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-remote-config.mjs +10 -9
- package/fesm2022/angular-fire-compat-remote-config.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-storage.mjs +20 -18
- package/fesm2022/angular-fire-compat-storage.mjs.map +1 -1
- package/fesm2022/angular-fire-compat.mjs +4 -4
- package/fesm2022/angular-fire-compat.mjs.map +1 -1
- package/fesm2022/angular-fire-data-connect.mjs +100 -0
- package/fesm2022/angular-fire-data-connect.mjs.map +1 -0
- package/fesm2022/angular-fire-database.mjs +8 -8
- package/fesm2022/angular-fire-database.mjs.map +1 -1
- package/fesm2022/angular-fire-firestore-lite.mjs +11 -10
- package/fesm2022/angular-fire-firestore-lite.mjs.map +1 -1
- package/fesm2022/angular-fire-firestore.mjs +14 -13
- package/fesm2022/angular-fire-firestore.mjs.map +1 -1
- package/fesm2022/angular-fire-functions.mjs +4 -4
- package/fesm2022/angular-fire-functions.mjs.map +1 -1
- package/fesm2022/angular-fire-messaging.mjs +15 -42
- package/fesm2022/angular-fire-messaging.mjs.map +1 -1
- package/fesm2022/angular-fire-performance.mjs +6 -6
- package/fesm2022/angular-fire-performance.mjs.map +1 -1
- package/fesm2022/angular-fire-remote-config.mjs +20 -47
- package/fesm2022/angular-fire-remote-config.mjs.map +1 -1
- package/fesm2022/angular-fire-storage.mjs +4 -4
- package/fesm2022/angular-fire-storage.mjs.map +1 -1
- package/fesm2022/{angular-fire-vertexai-preview.mjs → angular-fire-vertexai.mjs} +8 -8
- package/fesm2022/angular-fire-vertexai.mjs.map +1 -0
- package/fesm2022/angular-fire.mjs +38 -102
- package/fesm2022/angular-fire.mjs.map +1 -1
- package/firestore/firebase.d.ts +2 -1
- package/firestore/lite/firebase.d.ts +2 -1
- package/firestore/lite/rxfire.d.ts +4 -4
- package/firestore/rxfire.d.ts +7 -7
- package/messaging/firebase.d.ts +2 -2
- package/messaging/messaging.module.d.ts +2 -2
- package/package.json +21 -76
- package/performance/rxfire.d.ts +2 -2
- package/publish.sh +1 -0
- package/remote-config/firebase.d.ts +2 -2
- package/remote-config/remote-config.module.d.ts +2 -2
- package/remote-config/rxfire.d.ts +5 -5
- package/schematics/add/index.js +1 -13
- package/schematics/deploy/actions.js +138 -394
- package/schematics/deploy/builder.js +139 -61
- package/schematics/setup/index.js +94 -64
- package/schematics/update/index.js +1 -7
- package/schematics/update/v7/index.js +1 -67
- package/schematics/versions.json +2 -3
- package/vertexai/firebase.d.ts +4 -0
- package/vertexai/index.d.ts +5 -0
- package/vertexai/package.json +3 -0
- package/{vertexai-preview → vertexai}/vertexai.d.ts +1 -1
- package/{vertexai-preview → vertexai}/vertexai.module.d.ts +1 -1
- package/zones.d.ts +1 -11
- package/analytics/is-analytics-supported-factory.d.ts +0 -4
- package/analytics/overrides.d.ts +0 -1
- package/esm2022/analytics/analytics.mjs +0 -16
- package/esm2022/analytics/analytics.module.mjs +0 -101
- package/esm2022/analytics/angular-fire-analytics.mjs +0 -5
- package/esm2022/analytics/firebase.mjs +0 -17
- package/esm2022/analytics/is-analytics-supported-factory.mjs +0 -16
- package/esm2022/analytics/overrides.mjs +0 -3
- package/esm2022/analytics/public_api.mjs +0 -6
- package/esm2022/analytics/screen-tracking.service.mjs +0 -148
- package/esm2022/analytics/user-tracking.service.mjs +0 -44
- package/esm2022/angular-fire.mjs +0 -5
- package/esm2022/app/angular-fire-app.mjs +0 -5
- package/esm2022/app/app.mjs +0 -15
- package/esm2022/app/app.module.mjs +0 -91
- package/esm2022/app/firebase.mjs +0 -13
- package/esm2022/app/public_api.mjs +0 -4
- package/esm2022/app-check/angular-fire-app-check.mjs +0 -5
- package/esm2022/app-check/app-check.mjs +0 -10
- package/esm2022/app-check/app-check.module.mjs +0 -80
- package/esm2022/app-check/firebase.mjs +0 -10
- package/esm2022/app-check/public_api.mjs +0 -5
- package/esm2022/auth/angular-fire-auth.mjs +0 -5
- package/esm2022/auth/auth.mjs +0 -16
- package/esm2022/auth/auth.module.mjs +0 -73
- package/esm2022/auth/firebase.mjs +0 -59
- package/esm2022/auth/public_api.mjs +0 -5
- package/esm2022/auth/rxfire.mjs +0 -7
- package/esm2022/auth-guard/angular-fire-auth-guard.mjs +0 -5
- package/esm2022/auth-guard/auth-guard.mjs +0 -53
- package/esm2022/auth-guard/auth-guard.module.mjs +0 -20
- package/esm2022/auth-guard/public_api.mjs +0 -3
- package/esm2022/compat/analytics/analytics.mjs +0 -160
- package/esm2022/compat/analytics/analytics.module.mjs +0 -35
- package/esm2022/compat/analytics/angular-fire-compat-analytics.mjs +0 -5
- package/esm2022/compat/analytics/base.mjs +0 -11
- package/esm2022/compat/analytics/public_api.mjs +0 -5
- package/esm2022/compat/analytics/screen-tracking.service.mjs +0 -49
- package/esm2022/compat/analytics/user-tracking.service.mjs +0 -53
- package/esm2022/compat/angular-fire-compat.mjs +0 -5
- package/esm2022/compat/auth/angular-fire-compat-auth.mjs +0 -5
- package/esm2022/compat/auth/auth.mjs +0 -161
- package/esm2022/compat/auth/auth.module.mjs +0 -20
- package/esm2022/compat/auth/base.mjs +0 -39
- package/esm2022/compat/auth/public_api.mjs +0 -4
- package/esm2022/compat/auth-guard/angular-fire-compat-auth-guard.mjs +0 -5
- package/esm2022/compat/auth-guard/auth-guard.mjs +0 -53
- package/esm2022/compat/auth-guard/auth-guard.module.mjs +0 -20
- package/esm2022/compat/auth-guard/public_api.mjs +0 -3
- package/esm2022/compat/cache.mjs +0 -33
- package/esm2022/compat/database/angular-fire-compat-database.mjs +0 -5
- package/esm2022/compat/database/database.mjs +0 -119
- package/esm2022/compat/database/database.module.mjs +0 -20
- package/esm2022/compat/database/interfaces.mjs +0 -2
- package/esm2022/compat/database/list/audit-trail.mjs +0 -47
- package/esm2022/compat/database/list/changes.mjs +0 -85
- package/esm2022/compat/database/list/create-reference.mjs +0 -44
- package/esm2022/compat/database/list/data-operation.mjs +0 -11
- package/esm2022/compat/database/list/remove.mjs +0 -16
- package/esm2022/compat/database/list/snapshot-changes.mjs +0 -7
- package/esm2022/compat/database/list/state-changes.mjs +0 -9
- package/esm2022/compat/database/list/utils.mjs +0 -8
- package/esm2022/compat/database/object/create-reference.mjs +0 -19
- package/esm2022/compat/database/object/snapshot-changes.mjs +0 -7
- package/esm2022/compat/database/observable/fromRef.mjs +0 -48
- package/esm2022/compat/database/public_api.mjs +0 -9
- package/esm2022/compat/database/utils.mjs +0 -36
- package/esm2022/compat/firebase.app.mjs +0 -6
- package/esm2022/compat/firebase.app.module.mjs +0 -71
- package/esm2022/compat/firestore/angular-fire-compat-firestore.mjs +0 -5
- package/esm2022/compat/firestore/collection/changes.mjs +0 -108
- package/esm2022/compat/firestore/collection/collection.mjs +0 -123
- package/esm2022/compat/firestore/collection-group/collection-group.mjs +0 -86
- package/esm2022/compat/firestore/document/document.mjs +0 -87
- package/esm2022/compat/firestore/firestore.mjs +0 -257
- package/esm2022/compat/firestore/firestore.module.mjs +0 -32
- package/esm2022/compat/firestore/interfaces.mjs +0 -2
- package/esm2022/compat/firestore/observable/fromRef.mjs +0 -40
- package/esm2022/compat/firestore/public_api.mjs +0 -9
- package/esm2022/compat/functions/angular-fire-compat-functions.mjs +0 -5
- package/esm2022/compat/functions/base.mjs +0 -8
- package/esm2022/compat/functions/functions.mjs +0 -69
- package/esm2022/compat/functions/functions.module.mjs +0 -20
- package/esm2022/compat/functions/public_api.mjs +0 -4
- package/esm2022/compat/messaging/angular-fire-compat-messaging.mjs +0 -5
- package/esm2022/compat/messaging/base.mjs +0 -9
- package/esm2022/compat/messaging/messaging.mjs +0 -81
- package/esm2022/compat/messaging/messaging.module.mjs +0 -20
- package/esm2022/compat/messaging/public_api.mjs +0 -3
- package/esm2022/compat/performance/angular-fire-compat-performance.mjs +0 -5
- package/esm2022/compat/performance/base.mjs +0 -9
- package/esm2022/compat/performance/performance.mjs +0 -105
- package/esm2022/compat/performance/performance.module.mjs +0 -27
- package/esm2022/compat/performance/performance.service.mjs +0 -28
- package/esm2022/compat/performance/public_api.mjs +0 -4
- package/esm2022/compat/proxy.mjs +0 -58
- package/esm2022/compat/public_api.mjs +0 -5
- package/esm2022/compat/remote-config/angular-fire-compat-remote-config.mjs +0 -5
- package/esm2022/compat/remote-config/base.mjs +0 -20
- package/esm2022/compat/remote-config/interfaces.mjs +0 -2
- package/esm2022/compat/remote-config/public_api.mjs +0 -3
- package/esm2022/compat/remote-config/remote-config.mjs +0 -206
- package/esm2022/compat/remote-config/remote-config.module.mjs +0 -20
- package/esm2022/compat/storage/angular-fire-compat-storage.mjs +0 -5
- package/esm2022/compat/storage/interfaces.mjs +0 -2
- package/esm2022/compat/storage/observable/fromTask.mjs +0 -36
- package/esm2022/compat/storage/pipes/storageUrl.pipe.mjs +0 -56
- package/esm2022/compat/storage/public_api.mjs +0 -7
- package/esm2022/compat/storage/ref.mjs +0 -28
- package/esm2022/compat/storage/storage.mjs +0 -95
- package/esm2022/compat/storage/storage.module.mjs +0 -22
- package/esm2022/compat/storage/task.mjs +0 -21
- package/esm2022/core.mjs +0 -43
- package/esm2022/database/angular-fire-database.mjs +0 -5
- package/esm2022/database/database.mjs +0 -16
- package/esm2022/database/database.module.mjs +0 -76
- package/esm2022/database/firebase.mjs +0 -44
- package/esm2022/database/public_api.mjs +0 -5
- package/esm2022/database/rxfire.mjs +0 -13
- package/esm2022/firestore/angular-fire-firestore.mjs +0 -5
- package/esm2022/firestore/firebase.mjs +0 -73
- package/esm2022/firestore/firestore.mjs +0 -16
- package/esm2022/firestore/firestore.module.mjs +0 -76
- package/esm2022/firestore/lite/angular-fire-firestore-lite.mjs +0 -5
- package/esm2022/firestore/lite/firebase.mjs +0 -48
- package/esm2022/firestore/lite/lite.mjs +0 -16
- package/esm2022/firestore/lite/lite.module.mjs +0 -75
- package/esm2022/firestore/lite/public_api.mjs +0 -5
- package/esm2022/firestore/lite/rxfire.mjs +0 -12
- package/esm2022/firestore/public_api.mjs +0 -5
- package/esm2022/firestore/rxfire.mjs +0 -15
- package/esm2022/functions/angular-fire-functions.mjs +0 -5
- package/esm2022/functions/firebase.mjs +0 -9
- package/esm2022/functions/functions.mjs +0 -16
- package/esm2022/functions/functions.module.mjs +0 -76
- package/esm2022/functions/public_api.mjs +0 -5
- package/esm2022/functions/rxfire.mjs +0 -5
- package/esm2022/messaging/angular-fire-messaging.mjs +0 -5
- package/esm2022/messaging/firebase.mjs +0 -10
- package/esm2022/messaging/is-messaging-supported-factory.mjs +0 -16
- package/esm2022/messaging/messaging.mjs +0 -16
- package/esm2022/messaging/messaging.module.mjs +0 -93
- package/esm2022/messaging/overrides.mjs +0 -3
- package/esm2022/messaging/public_api.mjs +0 -4
- package/esm2022/performance/angular-fire-performance.mjs +0 -5
- package/esm2022/performance/firebase.mjs +0 -8
- package/esm2022/performance/performance.mjs +0 -16
- package/esm2022/performance/performance.module.mjs +0 -83
- package/esm2022/performance/public_api.mjs +0 -5
- package/esm2022/performance/rxfire.mjs +0 -8
- package/esm2022/public_api.mjs +0 -3
- package/esm2022/remote-config/angular-fire-remote-config.mjs +0 -5
- package/esm2022/remote-config/firebase.mjs +0 -17
- package/esm2022/remote-config/is-remote-config-supported-factory.mjs +0 -16
- package/esm2022/remote-config/overrides.mjs +0 -3
- package/esm2022/remote-config/public_api.mjs +0 -5
- package/esm2022/remote-config/remote-config.mjs +0 -16
- package/esm2022/remote-config/remote-config.module.mjs +0 -93
- package/esm2022/remote-config/rxfire.mjs +0 -9
- package/esm2022/storage/angular-fire-storage.mjs +0 -5
- package/esm2022/storage/firebase.mjs +0 -20
- package/esm2022/storage/public_api.mjs +0 -5
- package/esm2022/storage/rxfire.mjs +0 -6
- package/esm2022/storage/storage.mjs +0 -16
- package/esm2022/storage/storage.module.mjs +0 -76
- package/esm2022/vertexai-preview/angular-fire-vertexai-preview.mjs +0 -5
- package/esm2022/vertexai-preview/firebase.mjs +0 -7
- package/esm2022/vertexai-preview/public_api.mjs +0 -4
- package/esm2022/vertexai-preview/vertexai.mjs +0 -16
- package/esm2022/vertexai-preview/vertexai.module.mjs +0 -73
- package/esm2022/zones.mjs +0 -194
- package/fesm2022/angular-fire-vertexai-preview.mjs.map +0 -1
- package/messaging/is-messaging-supported-factory.d.ts +0 -4
- package/messaging/overrides.d.ts +0 -1
- package/remote-config/is-remote-config-supported-factory.d.ts +0 -4
- package/remote-config/overrides.d.ts +0 -1
- package/schematics/common.js +0 -81
- package/schematics/deploy/functions-templates.js +0 -57
- package/schematics/firebaseTools.js +0 -78
- package/schematics/interfaces.js +0 -16
- package/schematics/setup/prompts.js +0 -195
- package/schematics/utils.js +0 -189
- package/vertexai-preview/firebase.d.ts +0 -4
- package/vertexai-preview/package.json +0 -3
- /package/{vertexai-preview → vertexai}/public_api.d.ts +0 -0
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.appPrompt = exports.projectPrompt = exports.userPrompt = exports.featuresPrompt = exports.searchApps = exports.searchProjects = void 0;
|
|
36
|
-
const child_process_1 = require("child_process");
|
|
37
|
-
const fuzzy = __importStar(require("fuzzy"));
|
|
38
|
-
const inquirer = __importStar(require("inquirer"));
|
|
39
|
-
const firebaseTools_1 = require("../firebaseTools");
|
|
40
|
-
const interfaces_1 = require("../interfaces");
|
|
41
|
-
const utils_1 = require("../utils");
|
|
42
|
-
inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
|
|
43
|
-
const NEW_OPTION = '~~angularfire-new~~';
|
|
44
|
-
const isProject = (elem) => {
|
|
45
|
-
return elem.original === undefined;
|
|
46
|
-
};
|
|
47
|
-
const isApp = (elem) => {
|
|
48
|
-
return elem.original === undefined;
|
|
49
|
-
};
|
|
50
|
-
const searchProjects = (projects) => (_, input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
projects.unshift({
|
|
52
|
-
projectId: NEW_OPTION,
|
|
53
|
-
displayName: '[CREATE NEW PROJECT]'
|
|
54
|
-
});
|
|
55
|
-
return fuzzy.filter(input, projects, {
|
|
56
|
-
extract(el) {
|
|
57
|
-
return `${el.projectId} ${el.displayName}`;
|
|
58
|
-
}
|
|
59
|
-
}).map((result) => {
|
|
60
|
-
let original;
|
|
61
|
-
if (isProject(result)) {
|
|
62
|
-
original = result;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
original = result.original;
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
name: original.displayName,
|
|
69
|
-
title: original.displayName,
|
|
70
|
-
value: original.projectId
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
exports.searchProjects = searchProjects;
|
|
75
|
-
const searchApps = (apps) => (_, input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
|
-
apps.unshift({
|
|
77
|
-
appId: NEW_OPTION,
|
|
78
|
-
displayName: '[CREATE NEW APP]',
|
|
79
|
-
});
|
|
80
|
-
return fuzzy.filter(input, apps, {
|
|
81
|
-
extract(el) {
|
|
82
|
-
return el.displayName;
|
|
83
|
-
}
|
|
84
|
-
}).map((result) => {
|
|
85
|
-
let original;
|
|
86
|
-
if (isApp(result)) {
|
|
87
|
-
original = result;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
original = result.original;
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
name: original.displayName,
|
|
94
|
-
title: original.displayName,
|
|
95
|
-
value: (0, utils_1.shortAppId)(original),
|
|
96
|
-
};
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
exports.searchApps = searchApps;
|
|
100
|
-
const autocomplete = (questions) => inquirer.prompt(questions);
|
|
101
|
-
const featuresPrompt = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
-
const { features } = yield inquirer.prompt({
|
|
103
|
-
type: 'checkbox',
|
|
104
|
-
name: 'features',
|
|
105
|
-
choices: interfaces_1.featureOptions,
|
|
106
|
-
message: 'What features would you like to setup?',
|
|
107
|
-
default: [],
|
|
108
|
-
});
|
|
109
|
-
return features;
|
|
110
|
-
});
|
|
111
|
-
exports.featuresPrompt = featuresPrompt;
|
|
112
|
-
const userPrompt = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
113
|
-
var _a;
|
|
114
|
-
const firebaseTools = yield (0, firebaseTools_1.getFirebaseTools)();
|
|
115
|
-
let loginList = yield firebaseTools.login.list();
|
|
116
|
-
if (!Array.isArray(loginList) || loginList.length === 0) {
|
|
117
|
-
(0, child_process_1.spawnSync)('firebase login', { shell: true, cwd: options.projectRoot, stdio: 'inherit' });
|
|
118
|
-
return yield firebaseTools.login(options);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
const defaultUser = yield firebaseTools.login(options);
|
|
122
|
-
const choices = loginList.map(({ user }) => ({ name: user.email, value: user }));
|
|
123
|
-
const newChoice = { name: '[Login in with another account]', value: NEW_OPTION };
|
|
124
|
-
const { user } = yield inquirer.prompt({
|
|
125
|
-
type: 'list',
|
|
126
|
-
name: 'user',
|
|
127
|
-
choices: [newChoice].concat(choices),
|
|
128
|
-
message: 'Which Firebase account would you like to use?',
|
|
129
|
-
default: (_a = choices.find(it => it.value.email === defaultUser.email)) === null || _a === void 0 ? void 0 : _a.value,
|
|
130
|
-
});
|
|
131
|
-
if (user === NEW_OPTION) {
|
|
132
|
-
(0, child_process_1.spawnSync)('firebase login:add', { shell: true, cwd: options.projectRoot, stdio: 'inherit' });
|
|
133
|
-
loginList = yield firebaseTools.login.list();
|
|
134
|
-
if (!Array.isArray(loginList)) {
|
|
135
|
-
throw new Error("firebase login:list did not respond as expected");
|
|
136
|
-
}
|
|
137
|
-
const priorEmails = choices.map(it => it.name);
|
|
138
|
-
const newLogin = loginList.find(it => !priorEmails.includes(it.user.email));
|
|
139
|
-
if (!newLogin) {
|
|
140
|
-
throw new Error("Did not find a new user.");
|
|
141
|
-
}
|
|
142
|
-
return newLogin.user;
|
|
143
|
-
}
|
|
144
|
-
return user;
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
exports.userPrompt = userPrompt;
|
|
148
|
-
const projectPrompt = (defaultProject, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
149
|
-
const firebaseTools = yield (0, firebaseTools_1.getFirebaseTools)();
|
|
150
|
-
const projects = yield firebaseTools.projects.list(options);
|
|
151
|
-
const { projectId } = yield autocomplete({
|
|
152
|
-
type: 'autocomplete',
|
|
153
|
-
name: 'projectId',
|
|
154
|
-
source: (0, exports.searchProjects)(projects),
|
|
155
|
-
message: 'Please select a project:',
|
|
156
|
-
default: defaultProject,
|
|
157
|
-
});
|
|
158
|
-
if (projectId === NEW_OPTION) {
|
|
159
|
-
const { projectId } = yield inquirer.prompt({
|
|
160
|
-
type: 'input',
|
|
161
|
-
name: 'projectId',
|
|
162
|
-
message: `Please specify a unique project id (cannot be modified afterward) [6-30 characters]:`,
|
|
163
|
-
});
|
|
164
|
-
const { displayName } = yield inquirer.prompt({
|
|
165
|
-
type: 'input',
|
|
166
|
-
name: 'displayName',
|
|
167
|
-
message: 'What would you like to call your project?',
|
|
168
|
-
default: projectId,
|
|
169
|
-
});
|
|
170
|
-
return yield firebaseTools.projects.create(projectId, { account: options.account, displayName, nonInteractive: true });
|
|
171
|
-
}
|
|
172
|
-
return (projects).find(it => it.projectId === projectId);
|
|
173
|
-
});
|
|
174
|
-
exports.projectPrompt = projectPrompt;
|
|
175
|
-
const appPrompt = (_b, defaultAppId_1, options_1) => __awaiter(void 0, [_b, defaultAppId_1, options_1], void 0, function* ({ projectId: project }, defaultAppId, options) {
|
|
176
|
-
const firebaseTools = yield (0, firebaseTools_1.getFirebaseTools)();
|
|
177
|
-
const apps = yield firebaseTools.apps.list('web', Object.assign(Object.assign({}, options), { project }));
|
|
178
|
-
const { appId } = yield autocomplete({
|
|
179
|
-
type: 'autocomplete',
|
|
180
|
-
name: 'appId',
|
|
181
|
-
source: (0, exports.searchApps)(apps),
|
|
182
|
-
message: 'Please select an app:',
|
|
183
|
-
default: defaultAppId,
|
|
184
|
-
});
|
|
185
|
-
if (appId === NEW_OPTION) {
|
|
186
|
-
const { displayName } = yield inquirer.prompt({
|
|
187
|
-
type: 'input',
|
|
188
|
-
name: 'displayName',
|
|
189
|
-
message: 'What would you like to call your app?',
|
|
190
|
-
});
|
|
191
|
-
return yield firebaseTools.apps.create('web', displayName, Object.assign(Object.assign({}, options), { nonInteractive: true, project }));
|
|
192
|
-
}
|
|
193
|
-
return (apps).find(it => (0, utils_1.shortAppId)(it) === appId);
|
|
194
|
-
});
|
|
195
|
-
exports.appPrompt = appPrompt;
|
package/schematics/utils.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addIgnoreFiles = exports.featureToRules = exports.addFixesToServer = exports.getFirebaseProjectNameFromFs = exports.getFirebaseProjectNameFromHost = exports.getProject = exports.getWorkspace = exports.shortAppId = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
7
|
-
const utility_1 = require("@schematics/angular/utility");
|
|
8
|
-
const common_1 = require("./common");
|
|
9
|
-
const shortAppId = (app) => { var _a; return (_a = app === null || app === void 0 ? void 0 : app.appId) === null || _a === void 0 ? void 0 : _a.split('/').pop(); };
|
|
10
|
-
exports.shortAppId = shortAppId;
|
|
11
|
-
function getWorkspace(host) {
|
|
12
|
-
const path = '/angular.json';
|
|
13
|
-
const configBuffer = path && host.read(path);
|
|
14
|
-
if (!configBuffer) {
|
|
15
|
-
throw new schematics_1.SchematicsException(`Could not find angular.json`);
|
|
16
|
-
}
|
|
17
|
-
const { parse } = require('jsonc-parser');
|
|
18
|
-
const workspace = parse(configBuffer.toString());
|
|
19
|
-
if (!workspace) {
|
|
20
|
-
throw new schematics_1.SchematicsException('Could not parse angular.json');
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
path,
|
|
24
|
-
workspace
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
exports.getWorkspace = getWorkspace;
|
|
28
|
-
const getProject = (options, host) => {
|
|
29
|
-
const { workspace } = getWorkspace(host);
|
|
30
|
-
const projectName = options.project || workspace.defaultProject;
|
|
31
|
-
if (!projectName) {
|
|
32
|
-
throw new schematics_1.SchematicsException('No Angular project selected and no default project in the workspace');
|
|
33
|
-
}
|
|
34
|
-
const project = workspace.projects[projectName];
|
|
35
|
-
if (!project) {
|
|
36
|
-
throw new schematics_1.SchematicsException('The specified Angular project is not defined in this workspace');
|
|
37
|
-
}
|
|
38
|
-
if (project.projectType !== 'application') {
|
|
39
|
-
throw new schematics_1.SchematicsException(`Deploy requires an Angular project type of "application" in angular.json`);
|
|
40
|
-
}
|
|
41
|
-
return { project, projectName };
|
|
42
|
-
};
|
|
43
|
-
exports.getProject = getProject;
|
|
44
|
-
function getFirebaseProjectNameFromHost(host, target) {
|
|
45
|
-
const buffer = host.read('/.firebaserc');
|
|
46
|
-
if (!buffer) {
|
|
47
|
-
return [undefined, undefined];
|
|
48
|
-
}
|
|
49
|
-
const rc = JSON.parse(buffer.toString());
|
|
50
|
-
return projectFromRc(rc, target);
|
|
51
|
-
}
|
|
52
|
-
exports.getFirebaseProjectNameFromHost = getFirebaseProjectNameFromHost;
|
|
53
|
-
function getFirebaseProjectNameFromFs(root, target) {
|
|
54
|
-
const path = (0, path_1.join)(root, '.firebaserc');
|
|
55
|
-
try {
|
|
56
|
-
const buffer = (0, fs_1.readFileSync)(path);
|
|
57
|
-
const rc = JSON.parse(buffer.toString());
|
|
58
|
-
return projectFromRc(rc, target);
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
return [undefined, undefined];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.getFirebaseProjectNameFromFs = getFirebaseProjectNameFromFs;
|
|
65
|
-
const projectFromRc = (rc, target) => {
|
|
66
|
-
var _a, _b, _c, _d, _e;
|
|
67
|
-
const defaultProject = (_a = rc.projects) === null || _a === void 0 ? void 0 : _a.default;
|
|
68
|
-
const project = Object.keys(rc.targets || {}).find(project => { var _a, _b, _c; return !!((_c = (_b = (_a = rc.targets) === null || _a === void 0 ? void 0 : _a[project]) === null || _b === void 0 ? void 0 : _b.hosting) === null || _c === void 0 ? void 0 : _c[target]); });
|
|
69
|
-
const site = project && ((_e = (_d = (_c = (_b = rc.targets) === null || _b === void 0 ? void 0 : _b[project]) === null || _c === void 0 ? void 0 : _c.hosting) === null || _d === void 0 ? void 0 : _d[target]) === null || _e === void 0 ? void 0 : _e[0]);
|
|
70
|
-
return [project || defaultProject, site];
|
|
71
|
-
};
|
|
72
|
-
function addFixesToServer(host) {
|
|
73
|
-
const serverPath = `/server.ts`;
|
|
74
|
-
if (!host.exists(serverPath)) {
|
|
75
|
-
return host;
|
|
76
|
-
}
|
|
77
|
-
const text = host.read(serverPath);
|
|
78
|
-
if (text === null) {
|
|
79
|
-
throw new schematics_1.SchematicsException(`File ${serverPath} does not exist.`);
|
|
80
|
-
}
|
|
81
|
-
const sourceText = text.toString('utf-8');
|
|
82
|
-
const addZonePatch = !sourceText.includes('import \'zone.js/dist/zone-patch-rxjs\';');
|
|
83
|
-
if (addZonePatch) {
|
|
84
|
-
(0, common_1.overwriteIfExists)(host, serverPath, sourceText.replace('import \'zone.js/dist/zone-node\';', `import 'zone.js/dist/zone-node';
|
|
85
|
-
${addZonePatch ? 'import \'zone.js/dist/zone-patch-rxjs\';' : ''}`));
|
|
86
|
-
}
|
|
87
|
-
return host;
|
|
88
|
-
}
|
|
89
|
-
exports.addFixesToServer = addFixesToServer;
|
|
90
|
-
function featureToRules(features, projectName) {
|
|
91
|
-
return features.map(feature => {
|
|
92
|
-
switch (feature) {
|
|
93
|
-
case 2:
|
|
94
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
95
|
-
external('initializeAppCheck', '@angular/fire/app-check');
|
|
96
|
-
external('ReCaptchaEnterpriseProvider', '@angular/fire/app-check');
|
|
97
|
-
return code `${external('provideAppCheck', '@angular/fire/app-check')}(() => {
|
|
98
|
-
// TODO get a reCAPTCHA Enterprise here https://console.cloud.google.com/security/recaptcha?project=_
|
|
99
|
-
const provider = new ReCaptchaEnterpriseProvider(/* reCAPTCHA Enterprise site key */);
|
|
100
|
-
return initializeAppCheck(undefined, { provider, isTokenAutoRefreshEnabled: true });
|
|
101
|
-
})`;
|
|
102
|
-
});
|
|
103
|
-
case 1:
|
|
104
|
-
return (0, schematics_1.chain)([
|
|
105
|
-
(0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
106
|
-
external('getAnalytics', '@angular/fire/analytics');
|
|
107
|
-
return code `${external('provideAnalytics', '@angular/fire/analytics')}(() => getAnalytics())`;
|
|
108
|
-
}),
|
|
109
|
-
(0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
110
|
-
return code `${external('ScreenTrackingService', '@angular/fire/analytics')}`;
|
|
111
|
-
}),
|
|
112
|
-
...(features.includes(0) ? [
|
|
113
|
-
(0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
114
|
-
return code `${external('UserTrackingService', '@angular/fire/analytics')}`;
|
|
115
|
-
})
|
|
116
|
-
] : []),
|
|
117
|
-
]);
|
|
118
|
-
case 0:
|
|
119
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
120
|
-
external('getAuth', '@angular/fire/auth');
|
|
121
|
-
return code `${external('provideAuth', '@angular/fire/auth')}(() => getAuth())`;
|
|
122
|
-
});
|
|
123
|
-
case 3:
|
|
124
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
125
|
-
external('getDatabase', '@angular/fire/database');
|
|
126
|
-
return code `${external('provideDatabase', '@angular/fire/database')}(() => getDatabase())`;
|
|
127
|
-
});
|
|
128
|
-
case 7:
|
|
129
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
130
|
-
external('getFirestore', '@angular/fire/firestore');
|
|
131
|
-
return code `${external('provideFirestore', '@angular/fire/firestore')}(() => getFirestore())`;
|
|
132
|
-
});
|
|
133
|
-
case 4:
|
|
134
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
135
|
-
external('getFunctions', '@angular/fire/functions');
|
|
136
|
-
return code `${external('provideFunctions', '@angular/fire/functions')}(() => getFunctions())`;
|
|
137
|
-
});
|
|
138
|
-
case 5:
|
|
139
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
140
|
-
external('getMessaging', '@angular/fire/messaging');
|
|
141
|
-
return code `${external('provideMessaging', '@angular/fire/messaging')}(() => getMessaging())`;
|
|
142
|
-
});
|
|
143
|
-
case 6:
|
|
144
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
145
|
-
external('getPerformance', '@angular/fire/performance');
|
|
146
|
-
return code `${external('providePerformance', '@angular/fire/performance')}(() => getPerformance())`;
|
|
147
|
-
});
|
|
148
|
-
case 8:
|
|
149
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
150
|
-
external('getStorage', '@angular/fire/storage');
|
|
151
|
-
return code `${external('provideStorage', '@angular/fire/storage')}(() => getStorage())`;
|
|
152
|
-
});
|
|
153
|
-
case 9:
|
|
154
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
155
|
-
external('getRemoteConfig', '@angular/fire/remote-config');
|
|
156
|
-
return code `${external('provideRemoteConfig', '@angular/fire/remote-config')}(() => getRemoteConfig())`;
|
|
157
|
-
});
|
|
158
|
-
case 10:
|
|
159
|
-
return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => {
|
|
160
|
-
external('getVertexAI', '@angular/fire/vertexai-preview');
|
|
161
|
-
return code `${external('provideVertexAI', '@angular/fire/vertexai-preview')}(() => getVertexAI())`;
|
|
162
|
-
});
|
|
163
|
-
default:
|
|
164
|
-
return undefined;
|
|
165
|
-
}
|
|
166
|
-
}).filter((it) => !!it);
|
|
167
|
-
}
|
|
168
|
-
exports.featureToRules = featureToRules;
|
|
169
|
-
const addIgnoreFiles = (host) => {
|
|
170
|
-
const path = '/.gitignore';
|
|
171
|
-
if (!host.exists(path)) {
|
|
172
|
-
return host;
|
|
173
|
-
}
|
|
174
|
-
const buffer = host.read(path);
|
|
175
|
-
if (!buffer) {
|
|
176
|
-
return host;
|
|
177
|
-
}
|
|
178
|
-
const content = buffer.toString();
|
|
179
|
-
if (!content.includes('# Firebase')) {
|
|
180
|
-
(0, common_1.overwriteIfExists)(host, path, content.concat(`
|
|
181
|
-
# Firebase
|
|
182
|
-
.firebase
|
|
183
|
-
*-debug.log
|
|
184
|
-
.runtimeconfig.json
|
|
185
|
-
`));
|
|
186
|
-
}
|
|
187
|
-
return host;
|
|
188
|
-
};
|
|
189
|
-
exports.addIgnoreFiles = addIgnoreFiles;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from 'firebase/vertexai-preview';
|
|
2
|
-
import { getVertexAI as _getVertexAI, getGenerativeModel as _getGenerativeModel } from 'firebase/vertexai-preview';
|
|
3
|
-
export declare const getVertexAI: typeof _getVertexAI;
|
|
4
|
-
export declare const getGenerativeModel: typeof _getGenerativeModel;
|
|
File without changes
|