firebase-tools-with-isolate 13.11.2 → 13.16.0
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/lib/api.js +4 -2
- package/lib/apphosting/githubConnections.js +125 -37
- package/lib/apphosting/index.js +3 -8
- package/lib/auth.js +14 -15
- package/lib/bin/firebase.js +7 -5
- package/lib/commands/dataconnect-sdk-generate.js +5 -9
- package/lib/commands/dataconnect-services-list.js +1 -1
- package/lib/commands/deploy.js +10 -2
- package/lib/commands/ext-configure.js +1 -6
- package/lib/commands/ext-dev-init.js +27 -30
- package/lib/commands/ext-dev-upload.js +4 -6
- package/lib/commands/ext-info.js +3 -5
- package/lib/commands/ext-install.js +0 -5
- package/lib/commands/ext-uninstall.js +0 -5
- package/lib/commands/ext-update.js +0 -5
- package/lib/commands/firestore-backups-schedules-create.js +11 -14
- package/lib/commands/firestore-backups-schedules-list.js +1 -1
- package/lib/commands/firestore-backups-schedules-update.js +4 -3
- package/lib/commands/firestore-databases-create.js +24 -7
- package/lib/commands/firestore-databases-restore.js +4 -4
- package/lib/commands/firestore-databases-update.js +5 -6
- package/lib/commands/functions-secrets-set.js +9 -6
- package/lib/commands/help.js +2 -0
- package/lib/commands/hosting-channel-create.js +1 -1
- package/lib/commands/hosting-channel-delete.js +1 -1
- package/lib/commands/hosting-channel-deploy.js +1 -1
- package/lib/commands/hosting-clone.js +1 -2
- package/lib/commands/index.js +9 -11
- package/lib/commands/init.js +16 -12
- package/lib/commands/login.js +1 -2
- package/lib/commands/setup-emulators-dataconnect.js +22 -3
- package/lib/config.js +5 -0
- package/lib/crashlytics/buildToolsJarHelper.js +1 -1
- package/lib/dataconnect/client.js +57 -9
- package/lib/dataconnect/fileUtils.js +71 -7
- package/lib/dataconnect/filters.js +12 -1
- package/lib/dataconnect/load.js +9 -7
- package/lib/dataconnect/provisionCloudSql.js +5 -1
- package/lib/dataconnect/schemaMigration.js +21 -0
- package/lib/dataconnect/types.js +8 -1
- package/lib/deploy/dataconnect/prepare.js +16 -2
- package/lib/deploy/extensions/planner.js +52 -1
- package/lib/deploy/extensions/prepare.js +98 -23
- package/lib/deploy/extensions/release.js +6 -0
- package/lib/deploy/functions/build.js +15 -6
- package/lib/deploy/functions/deploy.js +12 -12
- package/lib/deploy/functions/params.js +5 -3
- package/lib/deploy/functions/prepare.js +8 -1
- package/lib/deploy/functions/release/index.js +4 -0
- package/lib/deploy/functions/runtimes/discovery/parsing.js +1 -1
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +46 -0
- package/lib/emulator/adminSdkConfig.test.js +16 -0
- package/lib/emulator/constants.js +8 -0
- package/lib/emulator/controller.js +14 -10
- package/lib/emulator/dataconnectEmulator.js +122 -18
- package/lib/emulator/downloadableEmulators.js +24 -25
- package/lib/emulator/env.js +3 -0
- package/lib/emulator/eventarcEmulator.js +68 -18
- package/lib/emulator/functionsEmulator.js +119 -1
- package/lib/emulator/functionsEmulatorShared.js +20 -0
- package/lib/emulator/hub.js +1 -1
- package/lib/emulator/portUtils.js +10 -0
- package/lib/emulator/pubsubEmulator.js +1 -1
- package/lib/emulator/registry.js +2 -1
- package/lib/emulator/storage/apis/shared.js +2 -1
- package/lib/emulator/storage/persistence.js +5 -13
- package/lib/emulator/storage/rfc.js +9 -0
- package/lib/emulator/storage/rules/config.js +4 -2
- package/lib/emulator/taskQueue.js +348 -0
- package/lib/emulator/tasksEmulator.js +237 -0
- package/lib/emulator/types.js +3 -0
- package/lib/experiments.js +8 -3
- package/lib/extensions/askUserForEventsConfig.js +18 -8
- package/lib/extensions/askUserForParam.js +3 -2
- package/lib/extensions/change-log.js +2 -4
- package/lib/extensions/displayExtensionInfo.js +5 -10
- package/lib/extensions/extensionsApi.js +1 -1
- package/lib/extensions/extensionsHelper.js +30 -10
- package/lib/extensions/localHelper.js +1 -1
- package/lib/extensions/provisioningHelper.js +1 -1
- package/lib/extensions/refs.js +26 -11
- package/lib/extensions/runtimes/common.js +75 -0
- package/lib/extensions/types.js +56 -1
- package/lib/extensions/updateHelper.js +1 -2
- package/lib/extensions/warnings.js +2 -7
- package/lib/firestore/api-sort.test.js +74 -0
- package/lib/firestore/api.js +8 -7
- package/lib/firestore/backupUtils.test.js +18 -0
- package/lib/firestore/pretty-print.js +21 -1
- package/lib/firestore/pretty-print.test.js +61 -0
- package/lib/firestore/util.test.js +42 -0
- package/lib/frameworks/angular/utils.js +13 -5
- package/lib/frameworks/compose/discover/mockFileSystem.js +36 -0
- package/lib/frameworks/constants.js +1 -1
- package/lib/frameworks/index.js +2 -6
- package/lib/frameworks/next/constants.js +1 -1
- package/lib/frameworks/next/index.js +35 -15
- package/lib/frameworks/next/utils.js +53 -9
- package/lib/frameworks/nuxt/index.js +3 -3
- package/lib/functions/events/v2.js +2 -1
- package/lib/gcp/cloudsql/cloudsqladmin.js +6 -1
- package/lib/gcp/devConnect.js +36 -1
- package/lib/hosting/implicitInit.js +2 -2
- package/lib/init/features/dataconnect/index.js +104 -32
- package/lib/init/features/dataconnect/sdk.js +147 -0
- package/lib/init/features/firestore/indexes.js +2 -2
- package/lib/init/features/firestore/rules.js +2 -2
- package/lib/init/features/functions/javascript.js +6 -8
- package/lib/init/features/functions/python.js +4 -6
- package/lib/init/features/functions/typescript.js +8 -10
- package/lib/init/features/hosting/github.js +43 -21
- package/lib/init/features/hosting/index.js +3 -3
- package/lib/init/features/index.js +3 -1
- package/lib/init/features/storage.js +2 -2
- package/lib/init/index.js +1 -0
- package/lib/listFiles.js +1 -1
- package/lib/management/apps.js +2 -2
- package/lib/prompt.js +22 -1
- package/lib/rc.js +1 -0
- package/lib/requireAuth.js +8 -3
- package/lib/rulesDeploy.js +14 -12
- package/lib/templates.js +23 -0
- package/lib/utils.js +2 -2
- package/package.json +25 -24
- package/schema/connector-yaml.json +36 -4
- package/schema/dataconnect-yaml.json +4 -0
- package/schema/firebase-config.json +12 -8
- package/templates/_gitignore +3 -0
- package/templates/init/dataconnect/connector.yaml +15 -2
- package/templates/init/dataconnect/dataconnect.yaml +5 -4
- package/templates/init/dataconnect/mutations.gql +45 -25
- package/templates/init/dataconnect/queries.gql +69 -36
- package/templates/init/dataconnect/schema.gql +38 -21
- package/lib/extensions/billingMigrationHelper.js +0 -61
package/lib/commands/init.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initAction = exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const fs = require("fs");
|
|
6
5
|
const os = require("os");
|
|
7
6
|
const path = require("path");
|
|
8
7
|
const command_1 = require("../command");
|
|
@@ -15,10 +14,10 @@ const requireAuth_1 = require("../requireAuth");
|
|
|
15
14
|
const fsutils = require("../fsutils");
|
|
16
15
|
const utils = require("../utils");
|
|
17
16
|
const experiments_1 = require("../experiments");
|
|
17
|
+
const templates_1 = require("../templates");
|
|
18
18
|
const homeDir = os.homedir();
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const GITIGNORE_TEMPLATE = fs.readFileSync(path.join(TEMPLATE_ROOT, "_gitignore"), "utf8");
|
|
19
|
+
const BANNER_TEXT = (0, templates_1.readTemplateSync)("banner.txt");
|
|
20
|
+
const GITIGNORE_TEMPLATE = (0, templates_1.readTemplateSync)("_gitignore");
|
|
22
21
|
function isOutside(from, to) {
|
|
23
22
|
return !!/^\.\./.exec(path.relative(from, to));
|
|
24
23
|
}
|
|
@@ -47,6 +46,7 @@ const choices = [
|
|
|
47
46
|
value: "hosting:github",
|
|
48
47
|
name: "Hosting: Set up GitHub Action deploys",
|
|
49
48
|
checked: false,
|
|
49
|
+
hidden: true,
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
value: "storage",
|
|
@@ -68,6 +68,17 @@ const choices = [
|
|
|
68
68
|
name: "Extensions: Set up an empty Extensions manifest",
|
|
69
69
|
checked: false,
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
value: "dataconnect",
|
|
73
|
+
name: "Data Connect: Set up a Firebase Data Connect service",
|
|
74
|
+
checked: false,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: "dataconnect:sdk",
|
|
78
|
+
name: "Data Connect: Set up a generated SDK for your Firebase Data Connect service",
|
|
79
|
+
checked: false,
|
|
80
|
+
hidden: true,
|
|
81
|
+
},
|
|
71
82
|
];
|
|
72
83
|
if ((0, experiments_1.isEnabled)("genkit")) {
|
|
73
84
|
choices.push({
|
|
@@ -76,13 +87,6 @@ if ((0, experiments_1.isEnabled)("genkit")) {
|
|
|
76
87
|
checked: false,
|
|
77
88
|
});
|
|
78
89
|
}
|
|
79
|
-
if ((0, experiments_1.isEnabled)("dataconnect")) {
|
|
80
|
-
choices.push({
|
|
81
|
-
value: "dataconnect",
|
|
82
|
-
name: "Data Connect: Set up a Firebase Data Connect service.",
|
|
83
|
-
checked: false,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
90
|
const featureNames = choices.map((choice) => choice.value);
|
|
87
91
|
const DESCRIPTION = `Interactively configure the current directory as a Firebase project or initialize new features in an already configured Firebase project directory.
|
|
88
92
|
|
|
@@ -163,7 +167,7 @@ function initAction(feature, options) {
|
|
|
163
167
|
name: "features",
|
|
164
168
|
message: "Which Firebase features do you want to set up for this directory? " +
|
|
165
169
|
"Press Space to select features, then Enter to confirm your choices.",
|
|
166
|
-
choices: choices,
|
|
170
|
+
choices: choices.filter((c) => !c.hidden),
|
|
167
171
|
},
|
|
168
172
|
]);
|
|
169
173
|
})
|
package/lib/commands/login.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const _ = require("lodash");
|
|
5
4
|
const clc = require("colorette");
|
|
6
5
|
const command_1 = require("../command");
|
|
7
6
|
const logger_1 = require("../logger");
|
|
@@ -40,7 +39,7 @@ exports.command = new command_1.Command("login")
|
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
const useLocalhost = (0, utils_1.isCloudEnvironment)() ? false : options.localhost;
|
|
43
|
-
const result = await auth.loginGoogle(useLocalhost,
|
|
42
|
+
const result = await auth.loginGoogle(useLocalhost, user?.email);
|
|
44
43
|
configstore_1.configstore.set("user", result.user);
|
|
45
44
|
configstore_1.configstore.set("tokens", result.tokens);
|
|
46
45
|
configstore_1.configstore.set("loginScopes", result.scopes);
|
|
@@ -2,11 +2,30 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const command_1 = require("../command");
|
|
5
|
-
const download_1 = require("../emulator/download");
|
|
6
5
|
const types_1 = require("../emulator/types");
|
|
6
|
+
const emulators_1 = require("../init/features/emulators");
|
|
7
|
+
const prompt_1 = require("../prompt");
|
|
8
|
+
const logger_1 = require("../logger");
|
|
9
|
+
const downloadableEmulators_1 = require("../emulator/downloadableEmulators");
|
|
7
10
|
const NAME = types_1.Emulators.DATACONNECT;
|
|
8
11
|
exports.command = new command_1.Command(`setup:emulators:${NAME}`)
|
|
9
12
|
.description(`downloads the ${NAME} emulator`)
|
|
10
|
-
.action(() => {
|
|
11
|
-
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
await (0, downloadableEmulators_1.downloadIfNecessary)(NAME);
|
|
15
|
+
if (!options.config) {
|
|
16
|
+
logger_1.logger.info("Not currently in a Firebase project directory. Run this command from a project directory to configure the Data Connect emulator.");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (!options.nonInteractive) {
|
|
20
|
+
const dataconnectEmulatorConfig = options.rc.getDataconnect();
|
|
21
|
+
const defaultConnectionString = dataconnectEmulatorConfig?.postgres?.localConnectionString ?? emulators_1.DEFAULT_POSTGRES_CONNECTION;
|
|
22
|
+
const localConnectionString = await (0, prompt_1.promptOnce)({
|
|
23
|
+
type: "input",
|
|
24
|
+
name: "localConnectionString",
|
|
25
|
+
message: `What is the connection string of the local Postgres instance you would like to use with the Data Connect emulator?`,
|
|
26
|
+
default: defaultConnectionString,
|
|
27
|
+
});
|
|
28
|
+
options.rc.setDataconnect(localConnectionString);
|
|
29
|
+
}
|
|
30
|
+
logger_1.logger.info("Setup complete!");
|
|
12
31
|
});
|
package/lib/config.js
CHANGED
|
@@ -53,6 +53,11 @@ class Config {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
if (this._src.dataconnect?.location ||
|
|
57
|
+
(Array.isArray(this._src.dataconnect) && this._src.dataconnect.some((c) => c?.location))) {
|
|
58
|
+
utils.logLabeledWarning("dataconnect", "'location' has been moved from 'firebase.json' to 'dataconnect.yaml'. " +
|
|
59
|
+
"Please remove 'dataconnect.location' from 'firebase.json' and add it as top level field to 'dataconnect.yaml' instead ");
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
62
|
materialize(target) {
|
|
58
63
|
const val = _.get(this._src, target);
|
|
@@ -12,7 +12,7 @@ const rimraf = require("rimraf");
|
|
|
12
12
|
const utils = require("../utils");
|
|
13
13
|
const JAR_CACHE_DIR = process.env.FIREBASE_CRASHLYTICS_BUILDTOOLS_PATH ||
|
|
14
14
|
path.join(os.homedir(), ".cache", "firebase", "crashlytics", "buildtools");
|
|
15
|
-
const JAR_VERSION = "3.0.
|
|
15
|
+
const JAR_VERSION = "3.0.2";
|
|
16
16
|
const JAR_URL = `https://dl.google.com/android/maven2/com/google/firebase/firebase-crashlytics-buildtools/${JAR_VERSION}/firebase-crashlytics-buildtools-${JAR_VERSION}.jar`;
|
|
17
17
|
async function fetchBuildtoolsJar() {
|
|
18
18
|
if (process.env.CRASHLYTICS_LOCAL_JAR) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upsertConnector = exports.listConnectors = exports.deleteConnector = exports.getConnector = exports.upsertSchema = exports.getSchema = exports.
|
|
3
|
+
exports.upsertConnector = exports.listConnectors = exports.deleteConnector = exports.getConnector = exports.deleteSchema = exports.upsertSchema = exports.getSchema = exports.deleteServiceAndChildResources = exports.createService = exports.listAllServices = exports.getService = exports.listLocations = void 0;
|
|
4
4
|
const api_1 = require("../api");
|
|
5
5
|
const apiv2_1 = require("../apiv2");
|
|
6
6
|
const operationPoller = require("../operation-poller");
|
|
7
7
|
const types = require("./types");
|
|
8
8
|
const DATACONNECT_API_VERSION = "v1alpha";
|
|
9
|
+
const PAGE_SIZE_MAX = 100;
|
|
9
10
|
const dataconnectClient = () => new apiv2_1.Client({
|
|
10
11
|
urlPrefix: (0, api_1.dataconnectOrigin)(),
|
|
11
12
|
apiVersion: DATACONNECT_API_VERSION,
|
|
@@ -16,6 +17,11 @@ async function listLocations(projectId) {
|
|
|
16
17
|
return res.body?.locations?.map((l) => l.locationId) ?? [];
|
|
17
18
|
}
|
|
18
19
|
exports.listLocations = listLocations;
|
|
20
|
+
async function getService(serviceName) {
|
|
21
|
+
const res = await dataconnectClient().get(serviceName);
|
|
22
|
+
return res.body;
|
|
23
|
+
}
|
|
24
|
+
exports.getService = getService;
|
|
19
25
|
async function listAllServices(projectId) {
|
|
20
26
|
const res = await dataconnectClient().get(`/projects/${projectId}/locations/-/services`);
|
|
21
27
|
return res.body.services ?? [];
|
|
@@ -37,8 +43,8 @@ async function createService(projectId, locationId, serviceId) {
|
|
|
37
43
|
return pollRes;
|
|
38
44
|
}
|
|
39
45
|
exports.createService = createService;
|
|
40
|
-
async function deleteService(
|
|
41
|
-
const op = await dataconnectClient().delete(
|
|
46
|
+
async function deleteService(serviceName) {
|
|
47
|
+
const op = await dataconnectClient().delete(serviceName);
|
|
42
48
|
const pollRes = await operationPoller.pollOperation({
|
|
43
49
|
apiOrigin: (0, api_1.dataconnectOrigin)(),
|
|
44
50
|
apiVersion: DATACONNECT_API_VERSION,
|
|
@@ -46,7 +52,20 @@ async function deleteService(projectId, locationId, serviceId) {
|
|
|
46
52
|
});
|
|
47
53
|
return pollRes;
|
|
48
54
|
}
|
|
49
|
-
|
|
55
|
+
async function deleteServiceAndChildResources(serviceName) {
|
|
56
|
+
const connectors = await listConnectors(serviceName);
|
|
57
|
+
await Promise.all(connectors.map(async (c) => deleteConnector(c.name)));
|
|
58
|
+
try {
|
|
59
|
+
await deleteSchema(serviceName);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
if (err.status !== 404) {
|
|
63
|
+
throw err;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
await deleteService(serviceName);
|
|
67
|
+
}
|
|
68
|
+
exports.deleteServiceAndChildResources = deleteServiceAndChildResources;
|
|
50
69
|
async function getSchema(serviceName) {
|
|
51
70
|
try {
|
|
52
71
|
const res = await dataconnectClient().get(`${serviceName}/schemas/${types.SCHEMA_ID}`);
|
|
@@ -77,19 +96,48 @@ async function upsertSchema(schema, validateOnly = false) {
|
|
|
77
96
|
});
|
|
78
97
|
}
|
|
79
98
|
exports.upsertSchema = upsertSchema;
|
|
99
|
+
async function deleteSchema(serviceName) {
|
|
100
|
+
const op = await dataconnectClient().delete(`${serviceName}/schemas/${types.SCHEMA_ID}`);
|
|
101
|
+
await operationPoller.pollOperation({
|
|
102
|
+
apiOrigin: (0, api_1.dataconnectOrigin)(),
|
|
103
|
+
apiVersion: DATACONNECT_API_VERSION,
|
|
104
|
+
operationResourceName: op.body.name,
|
|
105
|
+
});
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
exports.deleteSchema = deleteSchema;
|
|
80
109
|
async function getConnector(name) {
|
|
81
110
|
const res = await dataconnectClient().get(name);
|
|
82
111
|
return res.body;
|
|
83
112
|
}
|
|
84
113
|
exports.getConnector = getConnector;
|
|
85
114
|
async function deleteConnector(name) {
|
|
86
|
-
const
|
|
87
|
-
|
|
115
|
+
const op = await dataconnectClient().delete(name);
|
|
116
|
+
await operationPoller.pollOperation({
|
|
117
|
+
apiOrigin: (0, api_1.dataconnectOrigin)(),
|
|
118
|
+
apiVersion: DATACONNECT_API_VERSION,
|
|
119
|
+
operationResourceName: op.body.name,
|
|
120
|
+
});
|
|
121
|
+
return;
|
|
88
122
|
}
|
|
89
123
|
exports.deleteConnector = deleteConnector;
|
|
90
|
-
async function listConnectors(serviceName) {
|
|
91
|
-
const
|
|
92
|
-
|
|
124
|
+
async function listConnectors(serviceName, fields = []) {
|
|
125
|
+
const connectors = [];
|
|
126
|
+
const getNextPage = async (pageToken = "") => {
|
|
127
|
+
const res = await dataconnectClient().get(`${serviceName}/connectors`, {
|
|
128
|
+
queryParams: {
|
|
129
|
+
pageSize: PAGE_SIZE_MAX,
|
|
130
|
+
pageToken,
|
|
131
|
+
fields: fields.join(","),
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
connectors.push(...(res.body.connectors || []));
|
|
135
|
+
if (res.body.nextPageToken) {
|
|
136
|
+
await getNextPage(res.body.nextPageToken);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
await getNextPage();
|
|
140
|
+
return connectors;
|
|
93
141
|
}
|
|
94
142
|
exports.listConnectors = listConnectors;
|
|
95
143
|
async function upsertConnector(connector) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pickService = exports.readGQLFiles = exports.readConnectorYaml = exports.readDataConnectYaml = exports.readFirebaseJson = void 0;
|
|
3
|
+
exports.generateSdkYaml = exports.directoryHasPackageJson = exports.getPlatformFromFolder = exports.pickService = exports.readGQLFiles = exports.readConnectorYaml = exports.readDataConnectYaml = exports.readFirebaseJson = void 0;
|
|
4
4
|
const fs = require("fs-extra");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const error_1 = require("../error");
|
|
7
|
+
const types_1 = require("./types");
|
|
7
8
|
const utils_1 = require("../utils");
|
|
8
9
|
const load_1 = require("./load");
|
|
9
10
|
function readFirebaseJson(config) {
|
|
@@ -11,12 +12,11 @@ function readFirebaseJson(config) {
|
|
|
11
12
|
return [];
|
|
12
13
|
}
|
|
13
14
|
const validator = (cfg) => {
|
|
14
|
-
if (!cfg["source"]
|
|
15
|
-
throw new error_1.FirebaseError("Invalid firebase.json: DataConnect requires `source`
|
|
15
|
+
if (!cfg["source"]) {
|
|
16
|
+
throw new error_1.FirebaseError("Invalid firebase.json: DataConnect requires `source`");
|
|
16
17
|
}
|
|
17
18
|
return {
|
|
18
19
|
source: cfg["source"],
|
|
19
|
-
location: cfg["location"],
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
const configs = config.get("dataconnect");
|
|
@@ -27,7 +27,7 @@ function readFirebaseJson(config) {
|
|
|
27
27
|
return configs.map(validator);
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
throw new error_1.FirebaseError("Invalid firebase.json: dataconnect should be of the form { source: string
|
|
30
|
+
throw new error_1.FirebaseError("Invalid firebase.json: dataconnect should be of the form { source: string }");
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
exports.readFirebaseJson = readFirebaseJson;
|
|
@@ -38,6 +38,9 @@ async function readDataConnectYaml(sourceDirectory) {
|
|
|
38
38
|
}
|
|
39
39
|
exports.readDataConnectYaml = readDataConnectYaml;
|
|
40
40
|
function validateDataConnectYaml(unvalidated) {
|
|
41
|
+
if (!unvalidated["location"]) {
|
|
42
|
+
throw new error_1.FirebaseError("Missing required field 'location' in dataconnect.yaml");
|
|
43
|
+
}
|
|
41
44
|
return unvalidated;
|
|
42
45
|
}
|
|
43
46
|
async function readConnectorYaml(sourceDirectory) {
|
|
@@ -74,13 +77,13 @@ async function pickService(projectId, config, serviceId) {
|
|
|
74
77
|
throw new error_1.FirebaseError("No Data Connect services found in firebase.json.");
|
|
75
78
|
}
|
|
76
79
|
else if (serviceCfgs.length === 1) {
|
|
77
|
-
serviceInfo = await (0, load_1.load)(projectId,
|
|
80
|
+
serviceInfo = await (0, load_1.load)(projectId, config, serviceCfgs[0].source);
|
|
78
81
|
}
|
|
79
82
|
else {
|
|
80
83
|
if (!serviceId) {
|
|
81
84
|
throw new error_1.FirebaseError("Multiple Data Connect services found in firebase.json. Please specify a service ID to use.");
|
|
82
85
|
}
|
|
83
|
-
const infos = await Promise.all(serviceCfgs.map((c) => (0, load_1.load)(projectId,
|
|
86
|
+
const infos = await Promise.all(serviceCfgs.map((c) => (0, load_1.load)(projectId, config, c.source)));
|
|
84
87
|
const maybe = infos.find((i) => i.dataConnectYaml.serviceId === serviceId);
|
|
85
88
|
if (!maybe) {
|
|
86
89
|
throw new error_1.FirebaseError(`No service named ${serviceId} declared in firebase.json.`);
|
|
@@ -90,3 +93,64 @@ async function pickService(projectId, config, serviceId) {
|
|
|
90
93
|
return serviceInfo;
|
|
91
94
|
}
|
|
92
95
|
exports.pickService = pickService;
|
|
96
|
+
const WEB_INDICATORS = ["package.json", "package-lock.json", "node_modules"];
|
|
97
|
+
const IOS_INDICATORS = ["info.plist", "podfile", "package.swift"];
|
|
98
|
+
const ANDROID_INDICATORS = ["androidmanifest.xml", "build.gradle", "build.gradle.kts"];
|
|
99
|
+
const IOS_POSTFIX_INDICATORS = [".xcworkspace", ".xcodeproj"];
|
|
100
|
+
async function getPlatformFromFolder(dirPath) {
|
|
101
|
+
const fileNames = await fs.readdir(dirPath);
|
|
102
|
+
let hasWeb = false;
|
|
103
|
+
let hasAndroid = false;
|
|
104
|
+
let hasIOS = false;
|
|
105
|
+
for (const fileName of fileNames) {
|
|
106
|
+
const cleanedFileName = fileName.toLowerCase();
|
|
107
|
+
hasWeb || (hasWeb = WEB_INDICATORS.some((indicator) => indicator === cleanedFileName));
|
|
108
|
+
hasAndroid || (hasAndroid = ANDROID_INDICATORS.some((indicator) => indicator === cleanedFileName));
|
|
109
|
+
hasIOS || (hasIOS = IOS_INDICATORS.some((indicator) => indicator === cleanedFileName) ||
|
|
110
|
+
IOS_POSTFIX_INDICATORS.some((indicator) => cleanedFileName.endsWith(indicator)));
|
|
111
|
+
}
|
|
112
|
+
if (hasWeb && !hasAndroid && !hasIOS) {
|
|
113
|
+
return types_1.Platform.WEB;
|
|
114
|
+
}
|
|
115
|
+
else if (hasAndroid && !hasWeb && !hasIOS) {
|
|
116
|
+
return types_1.Platform.ANDROID;
|
|
117
|
+
}
|
|
118
|
+
else if (hasIOS && !hasWeb && !hasAndroid) {
|
|
119
|
+
return types_1.Platform.IOS;
|
|
120
|
+
}
|
|
121
|
+
return types_1.Platform.UNDETERMINED;
|
|
122
|
+
}
|
|
123
|
+
exports.getPlatformFromFolder = getPlatformFromFolder;
|
|
124
|
+
async function directoryHasPackageJson(dirPath) {
|
|
125
|
+
const fileNames = await fs.readdir(dirPath);
|
|
126
|
+
return fileNames.some((f) => f.toLowerCase() === "package.json");
|
|
127
|
+
}
|
|
128
|
+
exports.directoryHasPackageJson = directoryHasPackageJson;
|
|
129
|
+
function generateSdkYaml(platform, connectorYaml, connectorYamlFolder, appFolder) {
|
|
130
|
+
const relPath = path.relative(connectorYamlFolder, appFolder);
|
|
131
|
+
const outputDir = path.join(relPath, "dataconnect-generated");
|
|
132
|
+
if (!connectorYaml.generate) {
|
|
133
|
+
connectorYaml.generate = {};
|
|
134
|
+
}
|
|
135
|
+
if (platform === types_1.Platform.WEB) {
|
|
136
|
+
connectorYaml.generate.javascriptSdk = {
|
|
137
|
+
outputDir,
|
|
138
|
+
package: `@firebasegen/${connectorYaml.connectorId}`,
|
|
139
|
+
packageJsonDir: appFolder,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (platform === types_1.Platform.IOS) {
|
|
143
|
+
connectorYaml.generate.swiftSdk = {
|
|
144
|
+
outputDir,
|
|
145
|
+
package: connectorYaml.connectorId,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (platform === types_1.Platform.ANDROID) {
|
|
149
|
+
connectorYaml.generate.kotlinSdk = {
|
|
150
|
+
outputDir,
|
|
151
|
+
package: `connectors.${connectorYaml.connectorId}`,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return connectorYaml;
|
|
155
|
+
}
|
|
156
|
+
exports.generateSdkYaml = generateSdkYaml;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getResourceFilters = void 0;
|
|
3
|
+
exports.toString = exports.getResourceFilters = void 0;
|
|
4
4
|
const error_1 = require("../error");
|
|
5
5
|
function getResourceFilters(options) {
|
|
6
6
|
if (!options.only) {
|
|
@@ -43,3 +43,14 @@ function parseSelector(selector) {
|
|
|
43
43
|
}
|
|
44
44
|
return filter;
|
|
45
45
|
}
|
|
46
|
+
function toString(rf) {
|
|
47
|
+
const base = `dataconnect:${rf.serviceId}`;
|
|
48
|
+
if (rf.connectorId) {
|
|
49
|
+
return `${base}:${rf.connectorId}`;
|
|
50
|
+
}
|
|
51
|
+
if (rf.schemaOnly) {
|
|
52
|
+
return `${base}:schema`;
|
|
53
|
+
}
|
|
54
|
+
return base;
|
|
55
|
+
}
|
|
56
|
+
exports.toString = toString;
|
package/lib/dataconnect/load.js
CHANGED
|
@@ -4,16 +4,18 @@ exports.load = void 0;
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const fileUtils = require("./fileUtils");
|
|
6
6
|
const types_1 = require("./types");
|
|
7
|
-
async function load(projectId,
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
7
|
+
async function load(projectId, config, sourceDirectory) {
|
|
8
|
+
const resolvedDir = config.path(sourceDirectory);
|
|
9
|
+
const dataConnectYaml = await fileUtils.readDataConnectYaml(resolvedDir);
|
|
10
|
+
const serviceName = `projects/${projectId}/locations/${dataConnectYaml.location}/services/${dataConnectYaml.serviceId}`;
|
|
11
|
+
const schemaDir = path.join(resolvedDir, dataConnectYaml.schema.source);
|
|
11
12
|
const schemaGQLs = await fileUtils.readGQLFiles(schemaDir);
|
|
12
13
|
const connectorInfo = await Promise.all(dataConnectYaml.connectorDirs.map(async (dir) => {
|
|
13
|
-
const connectorDir = path.join(
|
|
14
|
+
const connectorDir = path.join(resolvedDir, dir);
|
|
14
15
|
const connectorYaml = await fileUtils.readConnectorYaml(connectorDir);
|
|
15
16
|
const connectorGqls = await fileUtils.readGQLFiles(connectorDir);
|
|
16
17
|
return {
|
|
18
|
+
directory: connectorDir,
|
|
17
19
|
connectorYaml,
|
|
18
20
|
connector: {
|
|
19
21
|
name: `${serviceName}/connectors/${connectorYaml.connectorId}`,
|
|
@@ -25,10 +27,10 @@ async function load(projectId, locationId, sourceDirectory) {
|
|
|
25
27
|
}));
|
|
26
28
|
return {
|
|
27
29
|
serviceName,
|
|
28
|
-
sourceDirectory,
|
|
30
|
+
sourceDirectory: resolvedDir,
|
|
29
31
|
schema: {
|
|
30
32
|
name: `${serviceName}/schemas/${types_1.SCHEMA_ID}`,
|
|
31
|
-
primaryDatasource: (0, types_1.toDatasource)(projectId,
|
|
33
|
+
primaryDatasource: (0, types_1.toDatasource)(projectId, dataConnectYaml.location, dataConnectYaml.schema.datasource),
|
|
32
34
|
source: {
|
|
33
35
|
files: schemaGQLs,
|
|
34
36
|
},
|
|
@@ -5,6 +5,7 @@ const cloudSqlAdminClient = require("../gcp/cloudsql/cloudsqladmin");
|
|
|
5
5
|
const utils = require("../utils");
|
|
6
6
|
const checkIam_1 = require("./checkIam");
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
|
+
const logger_1 = require("../logger");
|
|
8
9
|
const GOOGLE_ML_INTEGRATION_ROLE = "roles/aiplatform.user";
|
|
9
10
|
const freeTrial_1 = require("./freeTrial");
|
|
10
11
|
const error_1 = require("../error");
|
|
@@ -44,7 +45,9 @@ async function provisionCloudSql(args) {
|
|
|
44
45
|
connectionName = newInstance?.connectionName || "";
|
|
45
46
|
}
|
|
46
47
|
else {
|
|
47
|
-
silent ||
|
|
48
|
+
silent ||
|
|
49
|
+
utils.logLabeledBullet("dataconnect", "Cloud SQL instance creation started - it should be ready shortly. Database and users will be created on your next deploy.");
|
|
50
|
+
return connectionName;
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
try {
|
|
@@ -59,6 +62,7 @@ async function provisionCloudSql(args) {
|
|
|
59
62
|
silent || utils.logLabeledBullet("dataconnect", `Database ${databaseId} created.`);
|
|
60
63
|
}
|
|
61
64
|
else {
|
|
65
|
+
logger_1.logger.debug(`Unexpected error from CloudSQL: ${err}`);
|
|
62
66
|
silent || utils.logLabeledWarning("dataconnect", `Database ${databaseId} is not accessible.`);
|
|
63
67
|
}
|
|
64
68
|
}
|
|
@@ -11,10 +11,12 @@ const logger_1 = require("../logger");
|
|
|
11
11
|
const error_1 = require("../error");
|
|
12
12
|
const projectUtils_1 = require("../projectUtils");
|
|
13
13
|
const utils_1 = require("../utils");
|
|
14
|
+
const experiments = require("../experiments");
|
|
14
15
|
const errors = require("./errors");
|
|
15
16
|
async function diffSchema(schema) {
|
|
16
17
|
const { serviceName, instanceName, databaseId } = getIdentifiers(schema);
|
|
17
18
|
await ensureServiceIsConnectedToCloudSql(serviceName, instanceName, databaseId, false);
|
|
19
|
+
setCompatibleMode(schema, databaseId, instanceName);
|
|
18
20
|
try {
|
|
19
21
|
await (0, client_1.upsertSchema)(schema, true);
|
|
20
22
|
(0, utils_1.logLabeledSuccess)("dataconnect", `Database schema is up to date.`);
|
|
@@ -43,6 +45,7 @@ async function migrateSchema(args) {
|
|
|
43
45
|
const { options, schema, validateOnly } = args;
|
|
44
46
|
const { serviceName, instanceId, instanceName, databaseId } = getIdentifiers(schema);
|
|
45
47
|
await ensureServiceIsConnectedToCloudSql(serviceName, instanceName, databaseId, true);
|
|
48
|
+
setCompatibleMode(schema, databaseId, instanceName);
|
|
46
49
|
try {
|
|
47
50
|
await (0, client_1.upsertSchema)(schema, validateOnly);
|
|
48
51
|
logger_1.logger.debug(`Database schema was up to date for ${instanceId}:${databaseId}`);
|
|
@@ -79,6 +82,24 @@ async function migrateSchema(args) {
|
|
|
79
82
|
return [];
|
|
80
83
|
}
|
|
81
84
|
exports.migrateSchema = migrateSchema;
|
|
85
|
+
function setCompatibleMode(schema, databaseId, instanceName) {
|
|
86
|
+
if (experiments.isEnabled("fdccompatiblemode")) {
|
|
87
|
+
if (schema.primaryDatasource.postgresql?.schemaValidation) {
|
|
88
|
+
schema.primaryDatasource.postgresql.schemaValidation = "COMPATIBLE";
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
schema.primaryDatasource = {
|
|
92
|
+
postgresql: {
|
|
93
|
+
database: databaseId,
|
|
94
|
+
cloudSql: {
|
|
95
|
+
instance: instanceName,
|
|
96
|
+
},
|
|
97
|
+
schemaValidation: "COMPATIBLE",
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
82
103
|
function getIdentifiers(schema) {
|
|
83
104
|
const databaseId = schema.primaryDatasource.postgresql?.database;
|
|
84
105
|
if (!databaseId) {
|
package/lib/dataconnect/types.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toDatasource = exports.requiresVector = exports.SCHEMA_ID = void 0;
|
|
3
|
+
exports.toDatasource = exports.Platform = exports.requiresVector = exports.SCHEMA_ID = void 0;
|
|
4
4
|
exports.SCHEMA_ID = "main";
|
|
5
5
|
function requiresVector(dm) {
|
|
6
6
|
return dm?.primaryDataSource?.postgres?.requiredExtensions?.includes("vector") ?? false;
|
|
7
7
|
}
|
|
8
8
|
exports.requiresVector = requiresVector;
|
|
9
|
+
var Platform;
|
|
10
|
+
(function (Platform) {
|
|
11
|
+
Platform["ANDROID"] = "ANDROID";
|
|
12
|
+
Platform["WEB"] = "WEB";
|
|
13
|
+
Platform["IOS"] = "IOS";
|
|
14
|
+
Platform["UNDETERMINED"] = "UNDETERMINED";
|
|
15
|
+
})(Platform = exports.Platform || (exports.Platform = {}));
|
|
9
16
|
function toDatasource(projectId, locationId, ds) {
|
|
10
17
|
if (ds.postgresql) {
|
|
11
18
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const clc = require("colorette");
|
|
4
4
|
const load_1 = require("../../dataconnect/load");
|
|
5
5
|
const fileUtils_1 = require("../../dataconnect/fileUtils");
|
|
6
6
|
const logger_1 = require("../../logger");
|
|
@@ -11,6 +11,7 @@ const build_1 = require("../../dataconnect/build");
|
|
|
11
11
|
const ensureApis_1 = require("../../dataconnect/ensureApis");
|
|
12
12
|
const requireTosAcceptance_1 = require("../../requireTosAcceptance");
|
|
13
13
|
const firedata_1 = require("../../gcp/firedata");
|
|
14
|
+
const error_1 = require("../../error");
|
|
14
15
|
async function default_1(context, options) {
|
|
15
16
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
16
17
|
await (0, ensureApis_1.ensureApis)(projectId);
|
|
@@ -18,10 +19,23 @@ async function default_1(context, options) {
|
|
|
18
19
|
const serviceCfgs = (0, fileUtils_1.readFirebaseJson)(options.config);
|
|
19
20
|
utils.logLabeledBullet("dataconnect", `Preparing to deploy`);
|
|
20
21
|
const filters = (0, filters_1.getResourceFilters)(options);
|
|
21
|
-
const serviceInfos = await Promise.all(serviceCfgs.map((c) => (0, load_1.load)(projectId,
|
|
22
|
+
const serviceInfos = await Promise.all(serviceCfgs.map((c) => (0, load_1.load)(projectId, options.config, c.source)));
|
|
22
23
|
for (const si of serviceInfos) {
|
|
23
24
|
si.deploymentMetadata = await (0, build_1.build)(options, si.sourceDirectory);
|
|
24
25
|
}
|
|
26
|
+
const unmatchedFilters = filters?.filter((f) => {
|
|
27
|
+
const serviceMatched = serviceInfos.some((s) => s.dataConnectYaml.serviceId === f.serviceId);
|
|
28
|
+
const connectorMatched = f.connectorId
|
|
29
|
+
? serviceInfos.some((s) => {
|
|
30
|
+
return (s.dataConnectYaml.serviceId === f.serviceId &&
|
|
31
|
+
s.connectorInfo.some((c) => c.connectorYaml.connectorId === f.connectorId));
|
|
32
|
+
})
|
|
33
|
+
: true;
|
|
34
|
+
return !serviceMatched || !connectorMatched;
|
|
35
|
+
});
|
|
36
|
+
if (unmatchedFilters?.length) {
|
|
37
|
+
throw new error_1.FirebaseError(`The following filters were specified in --only but didn't match anything in this project: ${unmatchedFilters.map(filters_1.toString).map(clc.bold).join(", ")}`);
|
|
38
|
+
}
|
|
25
39
|
context.dataconnect = {
|
|
26
40
|
serviceInfos,
|
|
27
41
|
filters,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveVersion = exports.want = exports.have = exports.getExtensionSpec = exports.getExtension = exports.getExtensionVersion = void 0;
|
|
3
|
+
exports.resolveVersion = exports.want = exports.wantDynamic = exports.have = exports.getExtensionSpec = exports.getExtension = exports.getExtensionVersion = void 0;
|
|
4
4
|
const semver = require("semver");
|
|
5
5
|
const extensionsApi = require("../../extensions/extensionsApi");
|
|
6
6
|
const refs = require("../../extensions/refs");
|
|
@@ -11,6 +11,7 @@ const manifest_1 = require("../../extensions/manifest");
|
|
|
11
11
|
const paramHelper_1 = require("../../extensions/paramHelper");
|
|
12
12
|
const specHelper_1 = require("../../extensions/emulator/specHelper");
|
|
13
13
|
const functional_1 = require("../../functional");
|
|
14
|
+
const askUserForEventsConfig_1 = require("../../extensions/askUserForEventsConfig");
|
|
14
15
|
async function getExtensionVersion(i) {
|
|
15
16
|
if (!i.extensionVersion) {
|
|
16
17
|
if (!i.ref) {
|
|
@@ -68,9 +69,59 @@ async function have(projectId) {
|
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
exports.have = have;
|
|
72
|
+
async function wantDynamic(args) {
|
|
73
|
+
const instanceSpecs = [];
|
|
74
|
+
const errors = [];
|
|
75
|
+
if (!args.extensions) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
for (const [instanceId, ext] of Object.entries(args.extensions)) {
|
|
79
|
+
const autoPopulatedParams = await (0, extensionsHelper_1.getFirebaseProjectParams)(args.projectId, args.emulatorMode);
|
|
80
|
+
const subbedParams = (0, extensionsHelper_1.substituteParams)(ext.params, autoPopulatedParams);
|
|
81
|
+
const eventarcChannel = ext.params["_EVENT_ARC_REGION"]
|
|
82
|
+
? (0, askUserForEventsConfig_1.getEventArcChannel)(args.projectId, ext.params["_EVENT_ARC_REGION"])
|
|
83
|
+
: undefined;
|
|
84
|
+
delete subbedParams["_EVENT_ARC_REGION"];
|
|
85
|
+
const subbedSecretParams = await (0, extensionsHelper_1.substituteSecretParams)(args.projectNumber, subbedParams);
|
|
86
|
+
const [systemParams, params] = (0, functional_1.partitionRecord)(subbedSecretParams, paramHelper_1.isSystemParam);
|
|
87
|
+
const allowedEventTypes = ext.events.length ? ext.events : undefined;
|
|
88
|
+
if (allowedEventTypes && !eventarcChannel) {
|
|
89
|
+
errors.push(new error_1.FirebaseError("EventArcRegion must be specified if event handlers are defined"));
|
|
90
|
+
}
|
|
91
|
+
if (ext.localPath) {
|
|
92
|
+
instanceSpecs.push({
|
|
93
|
+
instanceId,
|
|
94
|
+
localPath: ext.localPath,
|
|
95
|
+
params,
|
|
96
|
+
systemParams,
|
|
97
|
+
allowedEventTypes,
|
|
98
|
+
eventarcChannel,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
else if (ext.ref) {
|
|
102
|
+
instanceSpecs.push({
|
|
103
|
+
instanceId,
|
|
104
|
+
ref: refs.parse(ext.ref),
|
|
105
|
+
params,
|
|
106
|
+
systemParams,
|
|
107
|
+
allowedEventTypes,
|
|
108
|
+
eventarcChannel,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (errors.length) {
|
|
113
|
+
const messages = errors.map((err) => `- ${err.message}`).join("\n");
|
|
114
|
+
throw new error_1.FirebaseError(`Errors while reading 'extensions' in app code\n${messages}`);
|
|
115
|
+
}
|
|
116
|
+
return instanceSpecs;
|
|
117
|
+
}
|
|
118
|
+
exports.wantDynamic = wantDynamic;
|
|
71
119
|
async function want(args) {
|
|
72
120
|
const instanceSpecs = [];
|
|
73
121
|
const errors = [];
|
|
122
|
+
if (!args.extensions) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
74
125
|
for (const e of Object.entries(args.extensions)) {
|
|
75
126
|
try {
|
|
76
127
|
const instanceId = e[0];
|