firebase-tools 13.15.2 → 13.15.4
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.
|
@@ -73,6 +73,9 @@ exports.have = have;
|
|
|
73
73
|
async function wantDynamic(args) {
|
|
74
74
|
const instanceSpecs = [];
|
|
75
75
|
const errors = [];
|
|
76
|
+
if (!args.extensions) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
76
79
|
for (const [instanceId, ext] of Object.entries(args.extensions)) {
|
|
77
80
|
const autoPopulatedParams = await (0, extensionsHelper_1.getFirebaseProjectParams)(args.projectId, args.emulatorMode);
|
|
78
81
|
const subbedParams = (0, extensionsHelper_1.substituteParams)(ext.params, autoPopulatedParams);
|
|
@@ -117,6 +120,9 @@ exports.wantDynamic = wantDynamic;
|
|
|
117
120
|
async function want(args) {
|
|
118
121
|
const instanceSpecs = [];
|
|
119
122
|
const errors = [];
|
|
123
|
+
if (!args.extensions) {
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
120
126
|
for (const e of Object.entries(args.extensions)) {
|
|
121
127
|
try {
|
|
122
128
|
const instanceId = e[0];
|
|
@@ -101,7 +101,8 @@ async function prepareHelper(context, options, payload, wantExtensions, noDelete
|
|
|
101
101
|
async function prepareDynamicExtensions(context, options, payload, builds) {
|
|
102
102
|
const filters = (0, functionsDeployHelper_1.getEndpointFilters)(options);
|
|
103
103
|
const extensions = (0, common_1.extractExtensionsFromBuilds)(builds, filters);
|
|
104
|
-
|
|
104
|
+
const isApiEnabled = await (0, extensionsHelper_1.checkExtensionsApiEnabled)(options);
|
|
105
|
+
if (Object.keys(extensions).length === 0 && !isApiEnabled) {
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
108
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
@@ -109,9 +110,7 @@ async function prepareDynamicExtensions(context, options, payload, builds) {
|
|
|
109
110
|
const aliases = (0, projectUtils_1.getAliases)(options, projectId);
|
|
110
111
|
const projectDir = options.config.projectDir;
|
|
111
112
|
const isPrimaryCall = !!options.only && !options.only.split(",").includes("extensions");
|
|
112
|
-
|
|
113
|
-
await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
|
|
114
|
-
}
|
|
113
|
+
await (0, extensionsHelper_1.ensureExtensionsApiEnabled)(options);
|
|
115
114
|
await (0, requirePermissions_1.requirePermissions)(options, ["firebaseextensions.instances.list"]);
|
|
116
115
|
const dynamicWant = await planner.wantDynamic({
|
|
117
116
|
projectId,
|
|
@@ -125,7 +124,7 @@ async function prepareDynamicExtensions(context, options, payload, builds) {
|
|
|
125
124
|
projectNumber,
|
|
126
125
|
aliases,
|
|
127
126
|
projectDir,
|
|
128
|
-
extensions: options.config.get("extensions"),
|
|
127
|
+
extensions: options.config.get("extensions", {}),
|
|
129
128
|
});
|
|
130
129
|
noDeleteExtensions = noDeleteExtensions.concat(firebaseJsonWant);
|
|
131
130
|
if (hasNonDeployingCodebases(options)) {
|
|
@@ -165,7 +164,7 @@ async function prepare(context, options, payload) {
|
|
|
165
164
|
projectNumber,
|
|
166
165
|
aliases,
|
|
167
166
|
projectDir,
|
|
168
|
-
extensions: options.config.get("extensions"),
|
|
167
|
+
extensions: options.config.get("extensions", {}),
|
|
169
168
|
});
|
|
170
169
|
const dynamicWant = await planner.wantDynamic({
|
|
171
170
|
projectId,
|
|
@@ -11,6 +11,12 @@ const etags_1 = require("../../extensions/etags");
|
|
|
11
11
|
const track_1 = require("../../track");
|
|
12
12
|
async function release(context, options, payload) {
|
|
13
13
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
14
|
+
if (!payload.instancesToCreate &&
|
|
15
|
+
!payload.instancesToUpdate &&
|
|
16
|
+
!payload.instancesToConfigure &&
|
|
17
|
+
!payload.instancesToDelete) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
14
20
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
15
21
|
const errorHandler = new errors_1.ErrorHandler();
|
|
16
22
|
const deploymentQueue = new queue_1.default({
|
|
@@ -7,7 +7,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
7
7
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.diagnoseAndFixProject = exports.getSourceOrigin = exports.isLocalOrURLPath = exports.isLocalPath = exports.isUrlPath = exports.instanceIdExists = exports.promptForRepeatInstance = exports.promptForOfficialExtension = exports.displayReleaseNotes = exports.getPublisherProjectFromName = exports.createSourceFromLocation = exports.getMissingPublisherError = exports.uploadExtensionVersionFromLocalSource = exports.uploadExtensionVersionFromGitHubSource = exports.unpackExtensionState = exports.getNextVersionByStage = exports.ensureExtensionsPublisherApiEnabled = exports.ensureExtensionsApiEnabled = exports.promptForExtensionRoot = exports.promptForValidRepoURI = exports.promptForValidInstanceId = exports.validateSpec = exports.validateCommandLineParams = exports.populateDefaultParams = exports.substituteSecretParams = exports.substituteParams = exports.getFirebaseProjectParams = exports.getDBInstanceFromURL = exports.resourceTypeToNiceName = exports.AUTOPOULATED_PARAM_PLACEHOLDERS = exports.EXTENSIONS_BUCKET_NAME = exports.URL_REGEX = exports.logPrefix = exports.SourceOrigin = exports.SpecParamType = void 0;
|
|
10
|
+
exports.diagnoseAndFixProject = exports.getSourceOrigin = exports.isLocalOrURLPath = exports.isLocalPath = exports.isUrlPath = exports.instanceIdExists = exports.promptForRepeatInstance = exports.promptForOfficialExtension = exports.displayReleaseNotes = exports.getPublisherProjectFromName = exports.createSourceFromLocation = exports.getMissingPublisherError = exports.uploadExtensionVersionFromLocalSource = exports.uploadExtensionVersionFromGitHubSource = exports.unpackExtensionState = exports.getNextVersionByStage = exports.ensureExtensionsPublisherApiEnabled = exports.ensureExtensionsApiEnabled = exports.checkExtensionsApiEnabled = exports.promptForExtensionRoot = exports.promptForValidRepoURI = exports.promptForValidInstanceId = exports.validateSpec = exports.validateCommandLineParams = exports.populateDefaultParams = exports.substituteSecretParams = exports.substituteParams = exports.getFirebaseProjectParams = exports.getDBInstanceFromURL = exports.resourceTypeToNiceName = exports.AUTOPOULATED_PARAM_PLACEHOLDERS = exports.EXTENSIONS_BUCKET_NAME = exports.URL_REGEX = exports.logPrefix = exports.SourceOrigin = exports.SpecParamType = void 0;
|
|
11
11
|
const clc = require("colorette");
|
|
12
12
|
const ora = require("ora");
|
|
13
13
|
const semver = require("semver");
|
|
@@ -385,6 +385,14 @@ async function promptForReleaseStage(args) {
|
|
|
385
385
|
}
|
|
386
386
|
return stage;
|
|
387
387
|
}
|
|
388
|
+
async function checkExtensionsApiEnabled(options) {
|
|
389
|
+
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
390
|
+
if (!projectId) {
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
return await (0, ensureApiEnabled_1.check)(projectId, (0, api_1.extensionsOrigin)(), "extensions", options.markdown);
|
|
394
|
+
}
|
|
395
|
+
exports.checkExtensionsApiEnabled = checkExtensionsApiEnabled;
|
|
388
396
|
async function ensureExtensionsApiEnabled(options) {
|
|
389
397
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
390
398
|
if (!projectId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools",
|
|
3
|
-
"version": "13.15.
|
|
3
|
+
"version": "13.15.4",
|
|
4
4
|
"description": "Command-Line Interface for Firebase",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"uuid": "^8.3.2",
|
|
125
125
|
"winston": "^3.0.0",
|
|
126
126
|
"winston-transport": "^4.4.0",
|
|
127
|
-
"ws": "^7.
|
|
127
|
+
"ws": "^7.5.10",
|
|
128
128
|
"yaml": "^2.4.1"
|
|
129
129
|
}
|
|
130
130
|
}
|