firebase-tools-with-isolate 13.6.4 → 13.7.3
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 +4 -6
- package/lib/api.js +1 -1
- package/lib/apphosting/app.js +88 -0
- package/lib/apphosting/config.js +97 -0
- package/lib/apphosting/githubConnections.js +265 -0
- package/lib/{init/features/apphosting → apphosting}/index.js +52 -26
- package/lib/{init/features/apphosting → apphosting}/repo.js +10 -10
- package/lib/apphosting/secrets/dialogs.js +170 -0
- package/lib/apphosting/secrets/index.js +97 -0
- package/lib/commands/apphosting-backends-create.js +7 -3
- package/lib/commands/apphosting-backends-delete.js +5 -4
- package/lib/commands/apphosting-backends-get.js +8 -8
- package/lib/commands/apphosting-backends-list.js +2 -2
- package/lib/commands/apphosting-secrets-access.js +24 -0
- package/lib/commands/apphosting-secrets-describe.js +29 -0
- package/lib/commands/apphosting-secrets-grantaccess.js +45 -0
- package/lib/commands/apphosting-secrets-set.js +56 -0
- package/lib/commands/firestore-databases-create.js +1 -0
- package/lib/commands/firestore-databases-restore.js +1 -0
- package/lib/commands/functions-secrets-access.js +2 -2
- package/lib/commands/functions-secrets-describe.js +14 -0
- package/lib/commands/functions-secrets-destroy.js +2 -2
- package/lib/commands/functions-secrets-get.js +3 -17
- package/lib/commands/functions-secrets-prune.js +2 -1
- package/lib/commands/functions-secrets-set.js +3 -19
- package/lib/commands/index.js +14 -6
- package/lib/deploy/firestore/prepare.js +4 -2
- package/lib/deploy/functions/checkIam.js +3 -6
- package/lib/deploy/functions/containerCleaner.js +1 -15
- package/lib/deploy/functions/deploy.js +2 -2
- package/lib/deploy/functions/params.js +2 -2
- package/lib/deploy/functions/prepare.js +13 -3
- package/lib/deploy/functions/pricing.js +2 -2
- package/lib/deploy/functions/prompts.js +39 -7
- package/lib/deploy/functions/release/fabricator.js +5 -5
- package/lib/deploy/functions/release/index.js +17 -2
- package/lib/deploy/functions/release/planner.js +11 -3
- package/lib/deploy/functions/runtimes/discovery/index.js +3 -3
- package/lib/deploy/functions/runtimes/index.js +6 -43
- package/lib/deploy/functions/runtimes/node/index.js +3 -2
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +15 -34
- package/lib/deploy/functions/runtimes/python/index.js +10 -7
- package/lib/deploy/functions/runtimes/supported/index.js +80 -0
- package/lib/deploy/functions/runtimes/supported/types.js +74 -0
- package/lib/deploy/functions/services/index.js +4 -0
- package/lib/downloadUtils.js +1 -0
- package/lib/emulator/controller.js +5 -1
- package/lib/emulator/functionsEmulator.js +2 -2
- package/lib/emulator/hub.js +5 -0
- package/lib/experiments.js +12 -0
- package/lib/extensions/emulator/specHelper.js +7 -6
- package/lib/extensions/extensionsApi.js +2 -2
- package/lib/extensions/localHelper.js +3 -3
- package/lib/firestore/pretty-print.js +5 -0
- package/lib/frameworks/astro/index.js +1 -1
- package/lib/frameworks/flutter/index.js +2 -2
- package/lib/frameworks/next/constants.js +2 -1
- package/lib/frameworks/next/index.js +22 -12
- package/lib/frameworks/next/utils.js +32 -3
- package/lib/functional.js +2 -2
- package/lib/functions/events/v2.js +7 -1
- package/lib/functions/secrets.js +40 -22
- package/lib/gcp/apphosting.js +14 -2
- package/lib/gcp/cloudbuild.js +7 -3
- package/lib/gcp/cloudfunctions.js +5 -5
- package/lib/gcp/cloudfunctionsv2.js +3 -3
- package/lib/gcp/cloudscheduler.js +2 -2
- package/lib/gcp/computeEngine.js +7 -0
- package/lib/gcp/devConnect.js +24 -11
- package/lib/gcp/iam.js +9 -1
- package/lib/gcp/secretManager.js +54 -6
- package/lib/gcp/serviceusage.js +24 -5
- package/lib/init/features/functions/python.js +4 -3
- package/lib/init/features/hosting/github.js +4 -5
- package/lib/init/features/index.js +1 -1
- package/lib/utils.js +23 -6
- package/package.json +4 -4
- package/schema/firebase-config.json +12 -2
- package/templates/init/functions/typescript/_eslintrc +1 -0
- /package/lib/{init/features/apphosting → apphosting}/constants.js +0 -0
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const Table = require("cli-table");
|
|
5
4
|
const requireAuth_1 = require("../requireAuth");
|
|
6
5
|
const command_1 = require("../command");
|
|
7
|
-
const logger_1 = require("../logger");
|
|
8
|
-
const projectUtils_1 = require("../projectUtils");
|
|
9
|
-
const secretManager_1 = require("../gcp/secretManager");
|
|
10
6
|
const requirePermissions_1 = require("../requirePermissions");
|
|
7
|
+
const secretManager = require("../gcp/secretManager");
|
|
11
8
|
const secrets = require("../functions/secrets");
|
|
12
9
|
exports.command = new command_1.Command("functions:secrets:get <KEY>")
|
|
13
10
|
.description("Get metadata for secret and its versions")
|
|
14
11
|
.before(requireAuth_1.requireAuth)
|
|
15
|
-
.before(
|
|
12
|
+
.before(secretManager.ensureApi)
|
|
16
13
|
.before(requirePermissions_1.requirePermissions, ["secretmanager.secrets.get"])
|
|
17
|
-
.action(
|
|
18
|
-
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
19
|
-
const versions = await (0, secretManager_1.listSecretVersions)(projectId, key);
|
|
20
|
-
const table = new Table({
|
|
21
|
-
head: ["Version", "State"],
|
|
22
|
-
style: { head: ["yellow"] },
|
|
23
|
-
});
|
|
24
|
-
for (const version of versions) {
|
|
25
|
-
table.push([version.versionId, version.state]);
|
|
26
|
-
}
|
|
27
|
-
logger_1.logger.info(table.toString());
|
|
28
|
-
});
|
|
14
|
+
.action(secrets.describeSecret);
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const backend = require("../deploy/functions/backend");
|
|
5
5
|
const secrets = require("../functions/secrets");
|
|
6
|
+
const secretManager = require("../gcp/secretManager");
|
|
6
7
|
const command_1 = require("../command");
|
|
7
8
|
const projectUtils_1 = require("../projectUtils");
|
|
8
9
|
const requirePermissions_1 = require("../requirePermissions");
|
|
@@ -15,7 +16,7 @@ exports.command = new command_1.Command("functions:secrets:prune")
|
|
|
15
16
|
.withForce("Destroys unused secrets without prompt")
|
|
16
17
|
.description("Destroys unused secrets")
|
|
17
18
|
.before(requireAuth_1.requireAuth)
|
|
18
|
-
.before(
|
|
19
|
+
.before(secretManager.ensureApi)
|
|
19
20
|
.before(requirePermissions_1.requirePermissions, [
|
|
20
21
|
"cloudfunctions.functions.list",
|
|
21
22
|
"secretmanager.secrets.list",
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const tty = require("tty");
|
|
5
|
-
const fs = require("fs");
|
|
6
4
|
const clc = require("colorette");
|
|
7
5
|
const logger_1 = require("../logger");
|
|
8
6
|
const secrets_1 = require("../functions/secrets");
|
|
@@ -20,7 +18,7 @@ exports.command = new command_1.Command("functions:secrets:set <KEY>")
|
|
|
20
18
|
.description("Create or update a secret for use in Cloud Functions for Firebase.")
|
|
21
19
|
.withForce("Automatically updates functions to use the new secret.")
|
|
22
20
|
.before(requireAuth_1.requireAuth)
|
|
23
|
-
.before(
|
|
21
|
+
.before(secretManager_1.ensureApi)
|
|
24
22
|
.before(requirePermissions_1.requirePermissions, [
|
|
25
23
|
"secretmanager.secrets.create",
|
|
26
24
|
"secretmanager.secrets.get",
|
|
@@ -33,24 +31,10 @@ exports.command = new command_1.Command("functions:secrets:set <KEY>")
|
|
|
33
31
|
const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
|
|
34
32
|
const key = await (0, secrets_1.ensureValidKey)(unvalidatedKey, options);
|
|
35
33
|
const secret = await (0, secrets_1.ensureSecret)(projectId, key, options);
|
|
36
|
-
|
|
37
|
-
if ((!options.dataFile || options.dataFile === "-") && tty.isatty(0)) {
|
|
38
|
-
secretValue = await (0, prompt_1.promptOnce)({
|
|
39
|
-
name: key,
|
|
40
|
-
type: "password",
|
|
41
|
-
message: `Enter a value for ${key}`,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
let dataFile = 0;
|
|
46
|
-
if (options.dataFile && options.dataFile !== "-") {
|
|
47
|
-
dataFile = options.dataFile;
|
|
48
|
-
}
|
|
49
|
-
secretValue = fs.readFileSync(dataFile, "utf-8");
|
|
50
|
-
}
|
|
34
|
+
const secretValue = await (0, utils_1.readSecretValue)(`Enter a value for ${key}`, options.dataFile);
|
|
51
35
|
const secretVersion = await (0, secretManager_1.addVersion)(projectId, key, secretValue);
|
|
52
36
|
(0, utils_1.logSuccess)(`Created a new secret version ${(0, secretManager_1.toSecretVersionResourceName)(secretVersion)}`);
|
|
53
|
-
if (!
|
|
37
|
+
if (!(0, secretManager_1.isFunctionsManaged)(secret)) {
|
|
54
38
|
(0, utils_1.logBullet)("Please deploy your functions for the change to take effect by running:\n\t" +
|
|
55
39
|
clc.bold("firebase deploy --only functions"));
|
|
56
40
|
return;
|
package/lib/commands/index.js
CHANGED
|
@@ -129,6 +129,7 @@ function load(client) {
|
|
|
129
129
|
client.functions.secrets.access = loadCommand("functions-secrets-access");
|
|
130
130
|
client.functions.secrets.destroy = loadCommand("functions-secrets-destroy");
|
|
131
131
|
client.functions.secrets.get = loadCommand("functions-secrets-get");
|
|
132
|
+
client.functions.secrets.describe = loadCommand("functions-secrets-describe");
|
|
132
133
|
client.functions.secrets.prune = loadCommand("functions-secrets-prune");
|
|
133
134
|
client.functions.secrets.set = loadCommand("functions-secrets-set");
|
|
134
135
|
client.help = loadCommand("help");
|
|
@@ -161,12 +162,19 @@ function load(client) {
|
|
|
161
162
|
client.apphosting.backends.create = loadCommand("apphosting-backends-create");
|
|
162
163
|
client.apphosting.backends.get = loadCommand("apphosting-backends-get");
|
|
163
164
|
client.apphosting.backends.delete = loadCommand("apphosting-backends-delete");
|
|
164
|
-
client.apphosting.
|
|
165
|
-
client.apphosting.
|
|
166
|
-
client.apphosting.
|
|
167
|
-
client.apphosting.
|
|
168
|
-
client.apphosting.
|
|
169
|
-
|
|
165
|
+
client.apphosting.secrets = {};
|
|
166
|
+
client.apphosting.secrets.set = loadCommand("apphosting-secrets-set");
|
|
167
|
+
client.apphosting.secrets.grantaccess = loadCommand("apphosting-secrets-grantaccess");
|
|
168
|
+
client.apphosting.secrets.describe = loadCommand("apphosting-secrets-describe");
|
|
169
|
+
client.apphosting.secrets.access = loadCommand("apphosting-secrets-access");
|
|
170
|
+
if (experiments.isEnabled("internaltesting")) {
|
|
171
|
+
client.apphosting.builds = {};
|
|
172
|
+
client.apphosting.builds.get = loadCommand("apphosting-builds-get");
|
|
173
|
+
client.apphosting.builds.create = loadCommand("apphosting-builds-create");
|
|
174
|
+
client.apphosting.rollouts = {};
|
|
175
|
+
client.apphosting.rollouts.create = loadCommand("apphosting-rollouts-create");
|
|
176
|
+
client.apphosting.rollouts.list = loadCommand("apphosting-rollouts-list");
|
|
177
|
+
}
|
|
170
178
|
}
|
|
171
179
|
client.login = loadCommand("login");
|
|
172
180
|
client.login.add = loadCommand("login-add");
|
|
@@ -27,9 +27,11 @@ async function default_1(context, options) {
|
|
|
27
27
|
const targets = options.only.split(",");
|
|
28
28
|
const excludeRules = targets.indexOf("firestore:indexes") >= 0;
|
|
29
29
|
const excludeIndexes = targets.indexOf("firestore:rules") >= 0;
|
|
30
|
+
const includeRules = targets.indexOf("firestore:rules") >= 0;
|
|
31
|
+
const includeIndexes = targets.indexOf("firestore:indexes") >= 0;
|
|
30
32
|
const onlyFirestore = targets.indexOf("firestore") >= 0;
|
|
31
|
-
context.firestoreIndexes = !excludeIndexes || onlyFirestore;
|
|
32
|
-
context.firestoreRules = !excludeRules || onlyFirestore;
|
|
33
|
+
context.firestoreIndexes = !excludeIndexes || includeIndexes || onlyFirestore;
|
|
34
|
+
context.firestoreRules = !excludeRules || includeRules || onlyFirestore;
|
|
33
35
|
}
|
|
34
36
|
else {
|
|
35
37
|
context.firestoreIndexes = true;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ensureServiceAgentRoles = exports.mergeBindings = exports.obtainDefaultComputeServiceAgentBindings = exports.obtainPubSubServiceAgentBindings = exports.
|
|
3
|
+
exports.ensureServiceAgentRoles = exports.mergeBindings = exports.obtainDefaultComputeServiceAgentBindings = exports.obtainPubSubServiceAgentBindings = exports.checkHttpIam = exports.checkServiceAccountIam = exports.EVENTARC_EVENT_RECEIVER_ROLE = exports.RUN_INVOKER_ROLE = exports.SERVICE_ACCOUNT_TOKEN_CREATOR_ROLE = void 0;
|
|
4
4
|
const colorette_1 = require("colorette");
|
|
5
5
|
const logger_1 = require("../../logger");
|
|
6
6
|
const functionsDeployHelper_1 = require("./functionsDeployHelper");
|
|
7
7
|
const error_1 = require("../../error");
|
|
8
8
|
const functional_1 = require("../../functional");
|
|
9
9
|
const iam = require("../../gcp/iam");
|
|
10
|
+
const gce = require("../../gcp/computeEngine");
|
|
10
11
|
const backend = require("./backend");
|
|
11
12
|
const track_1 = require("../../track");
|
|
12
13
|
const utils = require("../../utils");
|
|
@@ -73,10 +74,6 @@ exports.checkHttpIam = checkHttpIam;
|
|
|
73
74
|
function getPubsubServiceAgent(projectNumber) {
|
|
74
75
|
return `service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com`;
|
|
75
76
|
}
|
|
76
|
-
function getDefaultComputeServiceAgent(projectNumber) {
|
|
77
|
-
return `${projectNumber}-compute@developer.gserviceaccount.com`;
|
|
78
|
-
}
|
|
79
|
-
exports.getDefaultComputeServiceAgent = getDefaultComputeServiceAgent;
|
|
80
77
|
function reduceEventsToServices(services, endpoint) {
|
|
81
78
|
const service = (0, services_1.serviceForEndpoint)(endpoint);
|
|
82
79
|
if (service.requiredProjectBindings && !services.find((s) => s.name === service.name)) {
|
|
@@ -93,7 +90,7 @@ function obtainPubSubServiceAgentBindings(projectNumber) {
|
|
|
93
90
|
}
|
|
94
91
|
exports.obtainPubSubServiceAgentBindings = obtainPubSubServiceAgentBindings;
|
|
95
92
|
function obtainDefaultComputeServiceAgentBindings(projectNumber) {
|
|
96
|
-
const defaultComputeServiceAgent = `serviceAccount:${
|
|
93
|
+
const defaultComputeServiceAgent = `serviceAccount:${gce.getDefaultServiceAccount(projectNumber)}`;
|
|
97
94
|
const runInvokerBinding = {
|
|
98
95
|
role: exports.RUN_INVOKER_ROLE,
|
|
99
96
|
members: [defaultComputeServiceAgent],
|
|
@@ -49,7 +49,7 @@ async function cleanupBuildImages(haveFunctions, deletedFunctions, cleaners = {}
|
|
|
49
49
|
}));
|
|
50
50
|
cleanup.push(...deletedFunctions.map(async (func) => {
|
|
51
51
|
try {
|
|
52
|
-
await
|
|
52
|
+
await arCleaner.cleanupFunction(func);
|
|
53
53
|
}
|
|
54
54
|
catch (err) {
|
|
55
55
|
const path = `${func.project}/${func.region}/gcf-artifacts`;
|
|
@@ -110,17 +110,6 @@ class ArtifactRegistryCleaner {
|
|
|
110
110
|
operationResourceName: op.name,
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
async cleanupFunctionCache(func) {
|
|
114
|
-
const op = await artifactregistry.deletePackage(`${ArtifactRegistryCleaner.packagePath(func)}%2Fcache`);
|
|
115
|
-
if (op.done) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
await poller.pollOperation({
|
|
119
|
-
...ArtifactRegistryCleaner.POLLER_OPTIONS,
|
|
120
|
-
pollerName: `cleanup-cache-${func.region}-${func.id}`,
|
|
121
|
-
operationResourceName: op.name,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
113
|
}
|
|
125
114
|
exports.ArtifactRegistryCleaner = ArtifactRegistryCleaner;
|
|
126
115
|
ArtifactRegistryCleaner.POLLER_OPTIONS = {
|
|
@@ -132,9 +121,6 @@ class NoopArtifactRegistryCleaner extends ArtifactRegistryCleaner {
|
|
|
132
121
|
cleanupFunction() {
|
|
133
122
|
return Promise.resolve();
|
|
134
123
|
}
|
|
135
|
-
cleanupFunctionCache() {
|
|
136
|
-
return Promise.resolve();
|
|
137
|
-
}
|
|
138
124
|
}
|
|
139
125
|
exports.NoopArtifactRegistryCleaner = NoopArtifactRegistryCleaner;
|
|
140
126
|
class ContainerRegistryCleaner {
|
|
@@ -25,7 +25,7 @@ async function uploadSourceV1(projectId, source, wantBackend) {
|
|
|
25
25
|
stream: fs.createReadStream(source.functionsSourceV1),
|
|
26
26
|
};
|
|
27
27
|
if (process.env.GOOGLE_CLOUD_QUOTA_PROJECT) {
|
|
28
|
-
(0, utils_1.logLabeledWarning)("functions", "
|
|
28
|
+
(0, utils_1.logLabeledWarning)("functions", "GOOGLE_CLOUD_QUOTA_PROJECT is not usable when uploading source for Cloud Functions.");
|
|
29
29
|
}
|
|
30
30
|
await gcs.upload(uploadOpts, uploadUrl, {
|
|
31
31
|
"x-goog-content-length-range": "0,104857600",
|
|
@@ -44,7 +44,7 @@ async function uploadSourceV2(projectId, source, wantBackend) {
|
|
|
44
44
|
stream: fs.createReadStream(source.functionsSourceV2),
|
|
45
45
|
};
|
|
46
46
|
if (process.env.GOOGLE_CLOUD_QUOTA_PROJECT) {
|
|
47
|
-
(0, utils_1.logLabeledWarning)("functions", "
|
|
47
|
+
(0, utils_1.logLabeledWarning)("functions", "GOOGLE_CLOUD_QUOTA_PROJECT is not usable when uploading source for Cloud Functions.");
|
|
48
48
|
}
|
|
49
49
|
await gcs.upload(uploadOpts, res.uploadUrl, undefined, true);
|
|
50
50
|
return res.storageSource;
|
|
@@ -8,7 +8,7 @@ const functional_1 = require("../../functional");
|
|
|
8
8
|
const secretManager = require("../../gcp/secretManager");
|
|
9
9
|
const storage_1 = require("../../gcp/storage");
|
|
10
10
|
const cel_1 = require("./cel");
|
|
11
|
-
const
|
|
11
|
+
const secretManager_1 = require("../../gcp/secretManager");
|
|
12
12
|
function dependenciesCEL(expr) {
|
|
13
13
|
const deps = [];
|
|
14
14
|
const paramCapture = /{{ params\.(\w+) }}/g;
|
|
@@ -222,7 +222,7 @@ async function handleSecret(secretParam, projectId) {
|
|
|
222
222
|
type: "password",
|
|
223
223
|
message: `This secret will be stored in Cloud Secret Manager (https://cloud.google.com/secret-manager/pricing) as ${secretParam.name}. Enter a value for ${secretParam.label || secretParam.name}:`,
|
|
224
224
|
});
|
|
225
|
-
await secretManager.createSecret(projectId, secretParam.name, (0,
|
|
225
|
+
await secretManager.createSecret(projectId, secretParam.name, (0, secretManager_1.labels)());
|
|
226
226
|
await secretManager.addVersion(projectId, secretParam.name, secretValue);
|
|
227
227
|
return secretValue;
|
|
228
228
|
}
|
|
@@ -8,6 +8,7 @@ const ensureApiEnabled = require("../../ensureApiEnabled");
|
|
|
8
8
|
const functionsConfig = require("../../functionsConfig");
|
|
9
9
|
const functionsEnv = require("../../functions/env");
|
|
10
10
|
const runtimes = require("./runtimes");
|
|
11
|
+
const supported = require("./runtimes/supported");
|
|
11
12
|
const validate = require("./validate");
|
|
12
13
|
const ensure = require("./ensure");
|
|
13
14
|
const api_1 = require("../../api");
|
|
@@ -284,12 +285,21 @@ async function loadCodebases(config, options, firebaseConfig, runtimeConfig, fil
|
|
|
284
285
|
projectId,
|
|
285
286
|
sourceDir,
|
|
286
287
|
projectDir: options.config.projectDir,
|
|
287
|
-
runtime: codebaseConfig.runtime
|
|
288
|
+
runtime: codebaseConfig.runtime,
|
|
288
289
|
};
|
|
290
|
+
const firebaseJsonRuntime = codebaseConfig.runtime;
|
|
291
|
+
if (firebaseJsonRuntime && !supported.isRuntime(firebaseJsonRuntime)) {
|
|
292
|
+
throw new error_1.FirebaseError(`Functions codebase ${codebase} has invalid runtime ` +
|
|
293
|
+
`${firebaseJsonRuntime} specified in firebase.json. Valid values are: ` +
|
|
294
|
+
Object.keys(supported.RUNTIMES)
|
|
295
|
+
.map((s) => `- ${s}`)
|
|
296
|
+
.join("\n"));
|
|
297
|
+
}
|
|
289
298
|
const runtimeDelegate = await runtimes.getRuntimeDelegate(delegateContext);
|
|
290
|
-
logger_1.logger.debug(`Validating ${runtimeDelegate.
|
|
299
|
+
logger_1.logger.debug(`Validating ${runtimeDelegate.language} source`);
|
|
300
|
+
supported.guardVersionSupport(runtimeDelegate.runtime);
|
|
291
301
|
await runtimeDelegate.validate();
|
|
292
|
-
logger_1.logger.debug(`Building ${runtimeDelegate.
|
|
302
|
+
logger_1.logger.debug(`Building ${runtimeDelegate.language} source`);
|
|
293
303
|
await runtimeDelegate.build();
|
|
294
304
|
const firebaseEnvs = functionsEnv.loadFirebaseEnvs(firebaseConfig, projectId);
|
|
295
305
|
(0, utils_1.logLabeledBullet)("functions", `Loading and analyzing source code for codebase ${codebase} to determine what to deploy`);
|
|
@@ -107,7 +107,7 @@ const MB_TO_GHZ = {
|
|
|
107
107
|
32768: 8 * VCPU_TO_GHZ,
|
|
108
108
|
};
|
|
109
109
|
function canCalculateMinInstanceCost(endpoint) {
|
|
110
|
-
if (
|
|
110
|
+
if (endpoint.minInstances === undefined || endpoint.minInstances === null) {
|
|
111
111
|
return true;
|
|
112
112
|
}
|
|
113
113
|
if (endpoint.platform === "gcfv1") {
|
|
@@ -132,7 +132,7 @@ function monthlyMinInstanceCost(endpoints) {
|
|
|
132
132
|
gcfv2: { 1: { ram: 0, cpu: 0 }, 2: { ram: 0, cpu: 0 } },
|
|
133
133
|
};
|
|
134
134
|
for (const endpoint of endpoints) {
|
|
135
|
-
if (
|
|
135
|
+
if (endpoint.minInstances === undefined || endpoint.minInstances === null) {
|
|
136
136
|
continue;
|
|
137
137
|
}
|
|
138
138
|
const ramMb = endpoint.availableMemoryMb || backend.DEFAULT_MEMORY;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.promptForMinInstances = exports.promptForFunctionDeletion = exports.promptForFailurePolicies = void 0;
|
|
3
|
+
exports.promptForMinInstances = exports.promptForUnsafeMigration = exports.promptForFunctionDeletion = exports.promptForFailurePolicies = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const functionsDeployHelper_1 = require("./functionsDeployHelper");
|
|
6
6
|
const error_1 = require("../../error");
|
|
@@ -48,16 +48,16 @@ async function promptForFailurePolicies(options, want, have) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.promptForFailurePolicies = promptForFailurePolicies;
|
|
51
|
-
async function promptForFunctionDeletion(functionsToDelete,
|
|
51
|
+
async function promptForFunctionDeletion(functionsToDelete, options) {
|
|
52
52
|
let shouldDeleteFns = true;
|
|
53
|
-
if (functionsToDelete.length === 0 || force) {
|
|
53
|
+
if (functionsToDelete.length === 0 || options.force) {
|
|
54
54
|
return true;
|
|
55
55
|
}
|
|
56
56
|
const deleteList = functionsToDelete
|
|
57
57
|
.sort(backend.compareFunctions)
|
|
58
58
|
.map((fn) => "\t" + (0, functionsDeployHelper_1.getFunctionLabel)(fn))
|
|
59
59
|
.join("\n");
|
|
60
|
-
if (nonInteractive) {
|
|
60
|
+
if (options.nonInteractive) {
|
|
61
61
|
const deleteCommands = functionsToDelete
|
|
62
62
|
.map((func) => {
|
|
63
63
|
return "\tfirebase functions:delete " + func.id + " --region " + func.region;
|
|
@@ -74,9 +74,7 @@ async function promptForFunctionDeletion(functionsToDelete, force, nonInteractiv
|
|
|
74
74
|
"\n\nIf you are renaming a function or changing its region, it is recommended that you create the new " +
|
|
75
75
|
"function first before deleting the old one to prevent event loss. For more info, visit " +
|
|
76
76
|
clc.underline("https://firebase.google.com/docs/functions/manage-functions#modify" + "\n"));
|
|
77
|
-
shouldDeleteFns = await (0, prompt_1.
|
|
78
|
-
type: "confirm",
|
|
79
|
-
name: "confirm",
|
|
77
|
+
shouldDeleteFns = await (0, prompt_1.confirm)({
|
|
80
78
|
default: false,
|
|
81
79
|
message: "Would you like to proceed with deletion? Selecting no will continue the rest of the deployments.",
|
|
82
80
|
});
|
|
@@ -84,6 +82,40 @@ async function promptForFunctionDeletion(functionsToDelete, force, nonInteractiv
|
|
|
84
82
|
return shouldDeleteFns;
|
|
85
83
|
}
|
|
86
84
|
exports.promptForFunctionDeletion = promptForFunctionDeletion;
|
|
85
|
+
async function promptForUnsafeMigration(fnsToUpdate, options) {
|
|
86
|
+
const unsafeUpdates = fnsToUpdate.filter((eu) => eu.unsafe);
|
|
87
|
+
if (unsafeUpdates.length === 0 || options.force) {
|
|
88
|
+
return fnsToUpdate;
|
|
89
|
+
}
|
|
90
|
+
const warnMessage = "The following functions are unsafely changing event types: " +
|
|
91
|
+
clc.bold(unsafeUpdates
|
|
92
|
+
.map((eu) => eu.endpoint)
|
|
93
|
+
.sort(backend.compareFunctions)
|
|
94
|
+
.map(functionsDeployHelper_1.getFunctionLabel)
|
|
95
|
+
.join(", ")) +
|
|
96
|
+
". " +
|
|
97
|
+
"While automatic migration is allowed for these functions, updating the underlying event type may result in data loss. " +
|
|
98
|
+
"To avoid this, consider the best practices outlined in the migration guide: https://firebase.google.com/docs/functions/manage-functions?gen=2nd#modify-trigger";
|
|
99
|
+
utils.logLabeledWarning("functions", warnMessage);
|
|
100
|
+
const safeUpdates = fnsToUpdate.filter((eu) => !eu.unsafe);
|
|
101
|
+
if (options.nonInteractive) {
|
|
102
|
+
utils.logLabeledWarning("functions", "Skipping updates for functions that may be unsafe to update. To update these functions anyway, deploy again in interactive mode or use the --force option.");
|
|
103
|
+
return safeUpdates;
|
|
104
|
+
}
|
|
105
|
+
for (const eu of unsafeUpdates) {
|
|
106
|
+
const shouldUpdate = await (0, prompt_1.promptOnce)({
|
|
107
|
+
type: "confirm",
|
|
108
|
+
name: "confirm",
|
|
109
|
+
default: false,
|
|
110
|
+
message: `[${(0, functionsDeployHelper_1.getFunctionLabel)(eu.endpoint)}] Would you like to proceed with the unsafe migration?`,
|
|
111
|
+
});
|
|
112
|
+
if (shouldUpdate) {
|
|
113
|
+
safeUpdates.push(eu);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return safeUpdates;
|
|
117
|
+
}
|
|
118
|
+
exports.promptForUnsafeMigration = promptForUnsafeMigration;
|
|
87
119
|
async function promptForMinInstances(options, want, have) {
|
|
88
120
|
if (options.force) {
|
|
89
121
|
return;
|
|
@@ -7,7 +7,7 @@ const error_1 = require("../../../error");
|
|
|
7
7
|
const sourceTokenScraper_1 = require("./sourceTokenScraper");
|
|
8
8
|
const timer_1 = require("./timer");
|
|
9
9
|
const functional_1 = require("../../../functional");
|
|
10
|
-
const
|
|
10
|
+
const supported_1 = require("../runtimes/supported");
|
|
11
11
|
const api_1 = require("../../../api");
|
|
12
12
|
const logger_1 = require("../../../logger");
|
|
13
13
|
const backend = require("../backend");
|
|
@@ -25,7 +25,7 @@ const scheduler = require("../../../gcp/cloudscheduler");
|
|
|
25
25
|
const utils = require("../../../utils");
|
|
26
26
|
const services = require("../services");
|
|
27
27
|
const v1_1 = require("../../../functions/events/v1");
|
|
28
|
-
const
|
|
28
|
+
const gce = require("../../../gcp/computeEngine");
|
|
29
29
|
const functionsDeployHelper_1 = require("../functionsDeployHelper");
|
|
30
30
|
const gcfV1PollerOptions = {
|
|
31
31
|
apiOrigin: (0, api_1.functionsOrigin)(),
|
|
@@ -344,7 +344,7 @@ class Fabricator {
|
|
|
344
344
|
else if (backend.isScheduleTriggered(endpoint)) {
|
|
345
345
|
const invoker = endpoint.serviceAccount
|
|
346
346
|
? [endpoint.serviceAccount]
|
|
347
|
-
: [
|
|
347
|
+
: [gce.getDefaultServiceAccount(this.projectNumber)];
|
|
348
348
|
await this.executor
|
|
349
349
|
.run(() => run.setInvokerCreate(endpoint.project, serviceName, invoker))
|
|
350
350
|
.catch(rethrowAs(endpoint, "set invoker"));
|
|
@@ -435,7 +435,7 @@ class Fabricator {
|
|
|
435
435
|
else if (backend.isScheduleTriggered(endpoint)) {
|
|
436
436
|
invoker = endpoint.serviceAccount
|
|
437
437
|
? [endpoint.serviceAccount]
|
|
438
|
-
: [
|
|
438
|
+
: [gce.getDefaultServiceAccount(this.projectNumber)];
|
|
439
439
|
}
|
|
440
440
|
if (invoker) {
|
|
441
441
|
await this.executor
|
|
@@ -590,7 +590,7 @@ class Fabricator {
|
|
|
590
590
|
.catch(rethrowAs(endpoint, "unregister blocking trigger"));
|
|
591
591
|
}
|
|
592
592
|
logOpStart(op, endpoint) {
|
|
593
|
-
const runtime =
|
|
593
|
+
const runtime = supported_1.RUNTIMES[endpoint.runtime].friendly;
|
|
594
594
|
const platform = (0, functionsDeployHelper_1.getHumanFriendlyPlatformName)(endpoint.platform);
|
|
595
595
|
const label = helper.getFunctionLabel(endpoint);
|
|
596
596
|
utils.logLabeledBullet("functions", `${op} ${runtime} (${platform}) function ${clc.bold(label)}...`);
|
|
@@ -11,6 +11,7 @@ const fabricator = require("./fabricator");
|
|
|
11
11
|
const reporter = require("./reporter");
|
|
12
12
|
const executor = require("./executor");
|
|
13
13
|
const prompts = require("../prompts");
|
|
14
|
+
const experiments = require("../../../experiments");
|
|
14
15
|
const functionsConfig_1 = require("../../../functionsConfig");
|
|
15
16
|
const functionsDeployHelper_1 = require("../functionsDeployHelper");
|
|
16
17
|
const error_1 = require("../../../error");
|
|
@@ -40,12 +41,24 @@ async function release(context, options, payload) {
|
|
|
40
41
|
const fnsToDelete = Object.values(plan)
|
|
41
42
|
.map((regionalChanges) => regionalChanges.endpointsToDelete)
|
|
42
43
|
.reduce(functional_1.reduceFlat, []);
|
|
43
|
-
const shouldDelete = await prompts.promptForFunctionDeletion(fnsToDelete, options
|
|
44
|
+
const shouldDelete = await prompts.promptForFunctionDeletion(fnsToDelete, options);
|
|
44
45
|
if (!shouldDelete) {
|
|
45
46
|
for (const change of Object.values(plan)) {
|
|
46
47
|
change.endpointsToDelete = [];
|
|
47
48
|
}
|
|
48
49
|
}
|
|
50
|
+
const fnsToUpdate = Object.values(plan)
|
|
51
|
+
.map((regionalChanges) => regionalChanges.endpointsToUpdate)
|
|
52
|
+
.reduce(functional_1.reduceFlat, []);
|
|
53
|
+
const fnsToUpdateSafe = await prompts.promptForUnsafeMigration(fnsToUpdate, options);
|
|
54
|
+
for (const key of Object.keys(plan)) {
|
|
55
|
+
plan[key].endpointsToUpdate = [];
|
|
56
|
+
}
|
|
57
|
+
for (const eu of fnsToUpdateSafe) {
|
|
58
|
+
const e = eu.endpoint;
|
|
59
|
+
const key = `${e.codebase || ""}-${e.region}-${e.availableMemoryMb || "default"}`;
|
|
60
|
+
plan[key].endpointsToUpdate.push(eu);
|
|
61
|
+
}
|
|
49
62
|
const throttlerOptions = {
|
|
50
63
|
retries: 30,
|
|
51
64
|
backoff: 20000,
|
|
@@ -68,7 +81,9 @@ async function release(context, options, payload) {
|
|
|
68
81
|
const deletedEndpoints = Object.values(plan)
|
|
69
82
|
.map((r) => r.endpointsToDelete)
|
|
70
83
|
.reduce(functional_1.reduceFlat, []);
|
|
71
|
-
|
|
84
|
+
if (experiments.isEnabled("automaticallydeletegcfartifacts")) {
|
|
85
|
+
await containerCleaner.cleanupBuildImages(haveEndpoints, deletedEndpoints);
|
|
86
|
+
}
|
|
72
87
|
const allErrors = summary.results.filter((r) => r.error).map((r) => r.error);
|
|
73
88
|
if (allErrors.length) {
|
|
74
89
|
const opts = allErrors.length === 1 ? { original: allErrors[0] } : { children: allErrors };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkForV2Upgrade = exports.checkForIllegalUpdate = exports.upgradedScheduleFromV1ToV2 = exports.changedV2PubSubTopic = exports.changedTriggerRegion = exports.upgradedToGCFv2WithoutSettingConcurrency = exports.createDeploymentPlan = exports.calculateUpdate = exports.calculateChangesets = void 0;
|
|
4
|
-
const clc = require("colorette");
|
|
3
|
+
exports.checkForV2Upgrade = exports.checkForIllegalUpdate = exports.checkForUnsafeUpdate = exports.upgradedScheduleFromV1ToV2 = exports.changedV2PubSubTopic = exports.changedTriggerRegion = exports.upgradedToGCFv2WithoutSettingConcurrency = exports.createDeploymentPlan = exports.calculateUpdate = exports.calculateChangesets = void 0;
|
|
5
4
|
const functionsDeployHelper_1 = require("../functionsDeployHelper");
|
|
6
5
|
const deploymentTool_1 = require("../../../deploymentTool");
|
|
7
6
|
const error_1 = require("../../../error");
|
|
8
7
|
const utils = require("../../../utils");
|
|
9
8
|
const backend = require("../backend");
|
|
10
9
|
const v2events = require("../../../functions/events/v2");
|
|
10
|
+
const v2_1 = require("../../../functions/events/v2");
|
|
11
11
|
function calculateChangesets(want, have, keyFn, deleteAll) {
|
|
12
12
|
const toCreate = utils.groupBy(Object.keys(want)
|
|
13
13
|
.filter((id) => !have[id])
|
|
@@ -29,7 +29,7 @@ function calculateChangesets(want, have, keyFn, deleteAll) {
|
|
|
29
29
|
}, {});
|
|
30
30
|
const toSkip = utils.groupBy(Object.values(toSkipEndpointsMap), keyFn);
|
|
31
31
|
if (Object.keys(toSkip).length) {
|
|
32
|
-
utils.logLabeledBullet("functions",
|
|
32
|
+
utils.logLabeledBullet("functions", "Skipping the deploy of unchanged functions.");
|
|
33
33
|
}
|
|
34
34
|
const toUpdate = utils.groupBy(Object.keys(want)
|
|
35
35
|
.filter((id) => have[id])
|
|
@@ -57,6 +57,7 @@ function calculateUpdate(want, have) {
|
|
|
57
57
|
checkForIllegalUpdate(want, have);
|
|
58
58
|
const update = {
|
|
59
59
|
endpoint: want,
|
|
60
|
+
unsafe: checkForUnsafeUpdate(want, have),
|
|
60
61
|
};
|
|
61
62
|
const needsDelete = changedTriggerRegion(want, have) ||
|
|
62
63
|
changedV2PubSubTopic(want, have) ||
|
|
@@ -163,6 +164,13 @@ function upgradedScheduleFromV1ToV2(want, have) {
|
|
|
163
164
|
return true;
|
|
164
165
|
}
|
|
165
166
|
exports.upgradedScheduleFromV1ToV2 = upgradedScheduleFromV1ToV2;
|
|
167
|
+
function checkForUnsafeUpdate(want, have) {
|
|
168
|
+
return (backend.isEventTriggered(want) &&
|
|
169
|
+
v2_1.FIRESTORE_EVENT_WITH_AUTH_CONTEXT_REGEX.test(want.eventTrigger.eventType) &&
|
|
170
|
+
backend.isEventTriggered(have) &&
|
|
171
|
+
v2_1.FIRESTORE_EVENT_REGEX.test(have.eventTrigger.eventType));
|
|
172
|
+
}
|
|
173
|
+
exports.checkForUnsafeUpdate = checkForUnsafeUpdate;
|
|
166
174
|
function checkForIllegalUpdate(want, have) {
|
|
167
175
|
const triggerType = (e) => {
|
|
168
176
|
if (backend.isHttpsTriggered(e)) {
|
|
@@ -4,7 +4,7 @@ exports.detectFromPort = exports.detectFromYaml = exports.yamlToBuild = exports.
|
|
|
4
4
|
const node_fetch_1 = require("node-fetch");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
7
|
-
const yaml = require("
|
|
7
|
+
const yaml = require("yaml");
|
|
8
8
|
const util_1 = require("util");
|
|
9
9
|
const logger_1 = require("../../../../logger");
|
|
10
10
|
const api = require("../../.../../../../api");
|
|
@@ -41,7 +41,7 @@ async function detectFromYaml(directory, project, runtime) {
|
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
logger_1.logger.debug("Found functions.yaml. Got spec:", text);
|
|
44
|
-
const parsed = yaml.
|
|
44
|
+
const parsed = yaml.parse(text);
|
|
45
45
|
return yamlToBuild(parsed, project, api.functionsDefaultRegion(), runtime);
|
|
46
46
|
}
|
|
47
47
|
exports.detectFromYaml = detectFromYaml;
|
|
@@ -74,7 +74,7 @@ async function detectFromPort(port, project, runtime, timeout = 10000) {
|
|
|
74
74
|
logger_1.logger.debug("Got response from /__/functions.yaml", text);
|
|
75
75
|
let parsed;
|
|
76
76
|
try {
|
|
77
|
-
parsed = yaml.
|
|
77
|
+
parsed = yaml.parse(text);
|
|
78
78
|
}
|
|
79
79
|
catch (err) {
|
|
80
80
|
logger_1.logger.debug("Failed to parse functions.yaml", err);
|
|
@@ -1,61 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRuntimeDelegate =
|
|
3
|
+
exports.getRuntimeDelegate = void 0;
|
|
4
4
|
const node = require("./node");
|
|
5
5
|
const python = require("./python");
|
|
6
6
|
const validate = require("../validate");
|
|
7
7
|
const error_1 = require("../../../error");
|
|
8
|
-
const
|
|
9
|
-
"nodejs10",
|
|
10
|
-
"nodejs12",
|
|
11
|
-
"nodejs14",
|
|
12
|
-
"nodejs16",
|
|
13
|
-
"nodejs18",
|
|
14
|
-
"nodejs20",
|
|
15
|
-
"python310",
|
|
16
|
-
"python311",
|
|
17
|
-
"python312",
|
|
18
|
-
];
|
|
19
|
-
const EXPERIMENTAL_RUNTIMES = [];
|
|
20
|
-
const DEPRECATED_RUNTIMES = ["nodejs6", "nodejs8"];
|
|
21
|
-
function isDeprecatedRuntime(runtime) {
|
|
22
|
-
return DEPRECATED_RUNTIMES.includes(runtime);
|
|
23
|
-
}
|
|
24
|
-
exports.isDeprecatedRuntime = isDeprecatedRuntime;
|
|
25
|
-
function isValidRuntime(runtime) {
|
|
26
|
-
return RUNTIMES.includes(runtime) || EXPERIMENTAL_RUNTIMES.includes(runtime);
|
|
27
|
-
}
|
|
28
|
-
exports.isValidRuntime = isValidRuntime;
|
|
29
|
-
const MESSAGE_FRIENDLY_RUNTIMES = {
|
|
30
|
-
nodejs6: "Node.js 6 (Deprecated)",
|
|
31
|
-
nodejs8: "Node.js 8 (Deprecated)",
|
|
32
|
-
nodejs10: "Node.js 10",
|
|
33
|
-
nodejs12: "Node.js 12",
|
|
34
|
-
nodejs14: "Node.js 14",
|
|
35
|
-
nodejs16: "Node.js 16",
|
|
36
|
-
nodejs18: "Node.js 18",
|
|
37
|
-
nodejs20: "Node.js 20",
|
|
38
|
-
python310: "Python 3.10",
|
|
39
|
-
python311: "Python 3.11",
|
|
40
|
-
python312: "Python 3.12",
|
|
41
|
-
};
|
|
42
|
-
function getHumanFriendlyRuntimeName(runtime) {
|
|
43
|
-
return MESSAGE_FRIENDLY_RUNTIMES[runtime] || runtime;
|
|
44
|
-
}
|
|
45
|
-
exports.getHumanFriendlyRuntimeName = getHumanFriendlyRuntimeName;
|
|
8
|
+
const supported = require("./supported");
|
|
46
9
|
const factories = [node.tryCreateDelegate, python.tryCreateDelegate];
|
|
47
10
|
async function getRuntimeDelegate(context) {
|
|
48
11
|
const { projectDir, sourceDir, runtime } = context;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
throw new error_1.FirebaseError(`Cannot deploy function with runtime ${runtime}`);
|
|
12
|
+
if (runtime && !supported.isRuntime(runtime)) {
|
|
13
|
+
throw new error_1.FirebaseError(`firebase.json specifies invalid runtime ${runtime} for directory ${sourceDir}`);
|
|
52
14
|
}
|
|
15
|
+
validate.functionsDirectoryExists(sourceDir, projectDir);
|
|
53
16
|
for (const factory of factories) {
|
|
54
17
|
const delegate = await factory(context);
|
|
55
18
|
if (delegate) {
|
|
56
19
|
return delegate;
|
|
57
20
|
}
|
|
58
21
|
}
|
|
59
|
-
throw new error_1.FirebaseError(`Could not detect
|
|
22
|
+
throw new error_1.FirebaseError(`Could not detect runtime for functions at ${sourceDir}`);
|
|
60
23
|
}
|
|
61
24
|
exports.getRuntimeDelegate = getRuntimeDelegate;
|
|
@@ -13,6 +13,7 @@ const parseRuntimeAndValidateSDK_1 = require("./parseRuntimeAndValidateSDK");
|
|
|
13
13
|
const logger_1 = require("../../../../logger");
|
|
14
14
|
const utils_1 = require("../../../../utils");
|
|
15
15
|
const discovery = require("../discovery");
|
|
16
|
+
const supported = require("../supported");
|
|
16
17
|
const validate = require("./validate");
|
|
17
18
|
const versioning = require("./versioning");
|
|
18
19
|
const parseTriggers = require("./parseTriggers");
|
|
@@ -25,7 +26,7 @@ async function tryCreateDelegate(context) {
|
|
|
25
26
|
return undefined;
|
|
26
27
|
}
|
|
27
28
|
const runtime = (0, parseRuntimeAndValidateSDK_1.getRuntimeChoice)(context.sourceDir, context.runtime);
|
|
28
|
-
if (!
|
|
29
|
+
if (!supported.runtimeIsLanguage(runtime, "nodejs")) {
|
|
29
30
|
logger_1.logger.debug("Customer has a package.json but did not get a nodejs runtime. This should not happen");
|
|
30
31
|
throw new error_1.FirebaseError(`Unexpected runtime ${runtime}`);
|
|
31
32
|
}
|
|
@@ -38,7 +39,7 @@ class Delegate {
|
|
|
38
39
|
this.projectDir = projectDir;
|
|
39
40
|
this.sourceDir = sourceDir;
|
|
40
41
|
this.runtime = runtime;
|
|
41
|
-
this.
|
|
42
|
+
this.language = "nodejs";
|
|
42
43
|
this._sdkVersion = undefined;
|
|
43
44
|
this._bin = "";
|
|
44
45
|
}
|