firebase-tools 11.4.2 → 11.7.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/accountImporter.js +1 -1
- package/lib/auth.js +3 -4
- package/lib/bin/firebase.js +4 -4
- package/lib/command.js +35 -10
- package/lib/commands/apps-android-sha-create.js +1 -1
- package/lib/commands/apps-android-sha-delete.js +1 -1
- package/lib/commands/apps-create.js +1 -1
- package/lib/commands/apps-list.js +1 -1
- package/lib/commands/auth-export.js +1 -1
- package/lib/commands/auth-import.js +1 -1
- package/lib/commands/crashlytics-mappingfile-generateid.js +26 -0
- package/lib/commands/crashlytics-mappingfile-upload.js +46 -0
- package/lib/commands/crashlytics-symbols-upload.js +18 -87
- package/lib/commands/database-instances-list.js +1 -1
- package/lib/commands/database-push.js +1 -1
- package/lib/commands/database-remove.js +1 -1
- package/lib/commands/database-set.js +1 -1
- package/lib/commands/database-update.js +1 -1
- package/lib/commands/emulators-exec.js +4 -1
- package/lib/commands/emulators-export.js +5 -2
- package/lib/commands/emulators-start.js +24 -18
- package/lib/commands/ext-dev-deprecate.js +1 -1
- package/lib/commands/ext-dev-emulators-exec.js +1 -1
- package/lib/commands/ext-dev-emulators-start.js +1 -1
- package/lib/commands/ext-dev-extension-delete.js +1 -1
- package/lib/commands/ext-dev-list.js +1 -1
- package/lib/commands/ext-dev-publish.js +4 -1
- package/lib/commands/ext-dev-register.js +1 -1
- package/lib/commands/ext-dev-undeprecate.js +1 -1
- package/lib/commands/ext-dev-unpublish.js +1 -1
- package/lib/commands/ext-dev-usage.js +1 -1
- package/lib/commands/ext-info.js +1 -1
- package/lib/commands/ext-install.js +2 -2
- package/lib/commands/ext-update.js +1 -1
- package/lib/commands/ext.js +1 -1
- package/lib/commands/firestore-delete.js +2 -2
- package/lib/commands/firestore-indexes-list.js +3 -3
- package/lib/commands/functions-config-clone.js +1 -1
- package/lib/commands/functions-config-export.js +1 -1
- package/lib/commands/functions-config-set.js +1 -1
- package/lib/commands/functions-config-unset.js +1 -1
- package/lib/commands/functions-delete.js +3 -1
- package/lib/commands/functions-secrets-get.js +2 -0
- package/lib/commands/functions-secrets-set.js +1 -1
- package/lib/commands/help.js +1 -1
- package/lib/commands/hosting-channel-create.js +5 -5
- package/lib/commands/hosting-channel-delete.js +3 -3
- package/lib/commands/hosting-channel-deploy.js +6 -6
- package/lib/commands/hosting-channel-list.js +2 -2
- package/lib/commands/hosting-channel-open.js +2 -2
- package/lib/commands/hosting-clone.js +8 -8
- package/lib/commands/hosting-disable.js +1 -1
- package/lib/commands/hosting-sites-create.js +4 -4
- package/lib/commands/hosting-sites-delete.js +4 -4
- package/lib/commands/hosting-sites-list.js +2 -2
- package/lib/commands/index.js +3 -0
- package/lib/commands/init.js +5 -5
- package/lib/commands/login-add.js +1 -1
- package/lib/commands/login-ci.js +2 -2
- package/lib/commands/login-list.js +1 -1
- package/lib/commands/login-use.js +1 -1
- package/lib/commands/login.js +3 -3
- package/lib/commands/logout.js +1 -1
- package/lib/commands/open.js +3 -3
- package/lib/commands/projects-list.js +2 -2
- package/lib/commands/serve.js +1 -1
- package/lib/commands/target-apply.js +1 -1
- package/lib/commands/target-clear.js +1 -1
- package/lib/commands/target-remove.js +1 -1
- package/lib/commands/target.js +1 -1
- package/lib/commands/use.js +7 -7
- package/lib/config.js +1 -1
- package/lib/crashlytics/buildToolsJarHelper.js +51 -0
- package/lib/deploy/database/prepare.js +3 -3
- package/lib/deploy/database/release.js +3 -3
- package/lib/deploy/extensions/deploymentSummary.js +1 -1
- package/lib/deploy/extensions/errors.js +1 -1
- package/lib/deploy/extensions/secrets.js +1 -1
- package/lib/deploy/extensions/tasks.js +2 -2
- package/lib/deploy/firestore/deploy.js +2 -2
- package/lib/deploy/firestore/prepare.js +2 -2
- package/lib/deploy/functions/backend.js +4 -4
- package/lib/deploy/functions/build.js +78 -8
- package/lib/deploy/functions/checkIam.js +9 -8
- package/lib/deploy/functions/containerCleaner.js +2 -2
- package/lib/deploy/functions/deploy.js +2 -2
- package/lib/deploy/functions/ensure.js +1 -1
- package/lib/deploy/functions/params.js +15 -15
- package/lib/deploy/functions/prepare.js +1 -1
- package/lib/deploy/functions/prepareFunctionsUpload.js +2 -2
- package/lib/deploy/functions/prompts.js +1 -1
- package/lib/deploy/functions/release/fabricator.js +24 -7
- package/lib/deploy/functions/release/index.js +3 -1
- package/lib/deploy/functions/release/reporter.js +1 -1
- package/lib/deploy/functions/runtimes/discovery/index.js +1 -16
- package/lib/deploy/functions/runtimes/discovery/parsing.js +16 -0
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +59 -131
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +1 -1
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +2 -6
- package/lib/deploy/functions/runtimes/node/versioning.js +4 -4
- package/lib/deploy/functions/validate.js +1 -1
- package/lib/deploy/hosting/deploy.js +10 -9
- package/lib/deploy/hosting/uploader.js +2 -2
- package/lib/deploy/hosting/validate.js +2 -2
- package/lib/deploy/index.js +7 -7
- package/lib/deploy/lifecycleHooks.js +5 -2
- package/lib/deploy/storage/prepare.js +5 -3
- package/lib/deploy/storage/release.js +7 -6
- package/lib/emulator/auth/index.js +7 -2
- package/lib/emulator/auth/operations.js +10 -10
- package/lib/emulator/commandUtils.js +33 -16
- package/lib/emulator/constants.js +14 -6
- package/lib/emulator/controller.js +50 -18
- package/lib/emulator/databaseEmulator.js +1 -1
- package/lib/emulator/downloadableEmulators.js +8 -8
- package/lib/emulator/emulatorLogger.js +1 -1
- package/lib/emulator/eventarcEmulator.js +148 -0
- package/lib/emulator/extensionsEmulator.js +5 -3
- package/lib/emulator/firestoreEmulator.js +1 -1
- package/lib/emulator/functionsEmulator.js +66 -14
- package/lib/emulator/functionsEmulatorRuntime.js +12 -23
- package/lib/emulator/functionsEmulatorShared.js +6 -1
- package/lib/emulator/hub.js +7 -3
- package/lib/emulator/hubClient.js +2 -2
- package/lib/emulator/hubExport.js +22 -2
- package/lib/emulator/loggingEmulator.js +2 -2
- package/lib/emulator/registry.js +1 -0
- package/lib/emulator/storage/apis/firebase.js +26 -12
- package/lib/emulator/storage/apis/gcloud.js +15 -8
- package/lib/emulator/storage/files.js +21 -4
- package/lib/emulator/storage/multipart.js +6 -5
- package/lib/emulator/storage/rules/runtime.js +3 -3
- package/lib/emulator/storage/rules/utils.js +4 -2
- package/lib/emulator/storage/server.js +2 -1
- package/lib/emulator/storage/upload.js +1 -0
- package/lib/emulator/types.js +4 -0
- package/lib/emulator/ui.js +7 -2
- package/lib/ensureApiEnabled.js +7 -7
- package/lib/extensions/askUserForConsent.js +1 -1
- package/lib/extensions/askUserForEventsConfig.js +1 -1
- package/lib/extensions/askUserForParam.js +1 -1
- package/lib/extensions/changelog.js +2 -2
- package/lib/extensions/checkProjectBilling.js +2 -2
- package/lib/extensions/displayExtensionInfo.js +1 -1
- package/lib/extensions/extensionsApi.js +3 -2
- package/lib/extensions/extensionsHelper.js +30 -2
- package/lib/extensions/listExtensions.js +1 -1
- package/lib/extensions/manifest.js +1 -1
- package/lib/extensions/metricsUtils.js +1 -1
- package/lib/extensions/paramHelper.js +1 -1
- package/lib/extensions/updateHelper.js +2 -2
- package/lib/extensions/warnings.js +2 -2
- package/lib/fetchMOTD.js +1 -1
- package/lib/firestore/delete.js +1 -1
- package/lib/firestore/indexes.js +2 -2
- package/lib/firestore/validator.js +1 -1
- package/lib/functions/env.js +11 -11
- package/lib/functions/runtimeConfigExport.js +1 -1
- package/lib/functionsConfig.js +1 -1
- package/lib/functionsConfigClone.js +1 -1
- package/lib/functionsShellCommandAction.js +1 -1
- package/lib/gcp/cloudfunctions.js +3 -3
- package/lib/gcp/cloudfunctionsv2.js +5 -5
- package/lib/gcp/cloudscheduler.js +63 -22
- package/lib/gcp/cloudtasks.js +17 -1
- package/lib/gcp/serviceusage.js +2 -2
- package/lib/handlePreviewToggles.js +4 -4
- package/lib/hosting/implicitInit.js +1 -1
- package/lib/hosting/normalizedHostingConfigs.js +3 -3
- package/lib/index.js +2 -2
- package/lib/init/features/database.js +1 -1
- package/lib/init/features/emulators.js +1 -1
- package/lib/init/features/firestore/index.js +2 -2
- package/lib/init/features/firestore/indexes.js +1 -1
- package/lib/init/features/firestore/rules.js +1 -1
- package/lib/init/features/functions/golang.js +1 -1
- package/lib/init/features/functions/index.js +8 -1
- package/lib/init/features/hosting/github.js +9 -9
- package/lib/init/features/hosting/index.js +1 -1
- package/lib/init/features/project.js +1 -1
- package/lib/init/features/remoteconfig.js +1 -1
- package/lib/init/features/storage.js +1 -1
- package/lib/init/index.js +1 -1
- package/lib/logError.js +3 -3
- package/lib/management/projects.js +1 -1
- package/lib/parseBoltRules.js +1 -1
- package/lib/profileReport.js +2 -2
- package/lib/projectUtils.js +1 -1
- package/lib/rc.js +1 -1
- package/lib/requireAuth.js +1 -1
- package/lib/requireDatabaseInstance.js +2 -2
- package/lib/requirePermissions.js +2 -2
- package/lib/rulesDeploy.js +11 -12
- package/lib/serve/hosting.js +2 -1
- package/lib/serve/index.js +15 -0
- package/lib/track.js +122 -3
- package/lib/utils.js +24 -11
- package/npm-shrinkwrap.json +523 -294
- package/package.json +6 -4
- package/schema/firebase-config.json +12 -0
- package/templates/extensions/CHANGELOG.md +1 -7
- package/templates/hosting/init.js +6 -2
|
@@ -177,14 +177,6 @@ function createCloudEndpoints(emulator) {
|
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
179
|
gcloudStorageAPI.post("/upload/storage/v1/b/:bucketId/o", async (req, res) => {
|
|
180
|
-
if (!req.query.name) {
|
|
181
|
-
res.sendStatus(400);
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
let name = req.query.name.toString();
|
|
185
|
-
if (name.startsWith("/")) {
|
|
186
|
-
name = name.slice(1);
|
|
187
|
-
}
|
|
188
180
|
const contentTypeHeader = req.header("content-type") || req.header("x-upload-content-type");
|
|
189
181
|
if (!contentTypeHeader) {
|
|
190
182
|
return res.sendStatus(400);
|
|
@@ -194,6 +186,11 @@ function createCloudEndpoints(emulator) {
|
|
|
194
186
|
if (emulatorInfo === undefined) {
|
|
195
187
|
return res.sendStatus(500);
|
|
196
188
|
}
|
|
189
|
+
const name = getIncomingFileNameFromRequest(req.query, req.body);
|
|
190
|
+
if (name === undefined) {
|
|
191
|
+
res.sendStatus(400);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
197
194
|
const upload = uploadService.startResumableUpload({
|
|
198
195
|
bucketId: req.params.bucketId,
|
|
199
196
|
objectId: name,
|
|
@@ -223,6 +220,11 @@ function createCloudEndpoints(emulator) {
|
|
|
223
220
|
}
|
|
224
221
|
throw err;
|
|
225
222
|
}
|
|
223
|
+
const name = getIncomingFileNameFromRequest(req.query, JSON.parse(metadataRaw));
|
|
224
|
+
if (name === undefined) {
|
|
225
|
+
res.sendStatus(400);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
226
228
|
const upload = uploadService.multipartUpload({
|
|
227
229
|
bucketId: req.params.bucketId,
|
|
228
230
|
objectId: name,
|
|
@@ -363,3 +365,8 @@ function sendObjectNotFound(req, res) {
|
|
|
363
365
|
});
|
|
364
366
|
}
|
|
365
367
|
}
|
|
368
|
+
function getIncomingFileNameFromRequest(query, metadata) {
|
|
369
|
+
var _a;
|
|
370
|
+
const name = ((_a = query === null || query === void 0 ? void 0 : query.name) === null || _a === void 0 ? void 0 : _a.toString()) || (metadata === null || metadata === void 0 ? void 0 : metadata.name);
|
|
371
|
+
return (name === null || name === void 0 ? void 0 : name.startsWith("/")) ? name.slice(1) : name;
|
|
372
|
+
}
|
|
@@ -17,6 +17,8 @@ const logger_1 = require("../../logger");
|
|
|
17
17
|
const adminSdkConfig_1 = require("../adminSdkConfig");
|
|
18
18
|
const types_1 = require("./rules/types");
|
|
19
19
|
const upload_1 = require("./upload");
|
|
20
|
+
const track_1 = require("../../track");
|
|
21
|
+
const types_2 = require("../types");
|
|
20
22
|
class StoredFile {
|
|
21
23
|
constructor(metadata) {
|
|
22
24
|
this.metadata = metadata;
|
|
@@ -29,6 +31,7 @@ class StoredFile {
|
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
exports.StoredFile = StoredFile;
|
|
34
|
+
const TRAILING_SLASHES_PATTERN = /\/+$/;
|
|
32
35
|
class StorageLayer {
|
|
33
36
|
constructor(_projectId, _files, _buckets, _rulesValidator, _adminCredsValidator, _persistence, _cloudFunctions) {
|
|
34
37
|
this._projectId = _projectId;
|
|
@@ -137,6 +140,7 @@ class StorageLayer {
|
|
|
137
140
|
if (upload.status !== upload_1.UploadStatus.FINISHED) {
|
|
138
141
|
throw new Error(`Unexpected upload status encountered: ${upload.status}.`);
|
|
139
142
|
}
|
|
143
|
+
const storedMetadata = this.getMetadata(upload.bucketId, upload.objectId);
|
|
140
144
|
const filePath = this.path(upload.bucketId, upload.objectId);
|
|
141
145
|
const metadata = new metadata_1.StoredFileMetadata({
|
|
142
146
|
name: upload.objectId,
|
|
@@ -149,7 +153,10 @@ class StorageLayer {
|
|
|
149
153
|
customMetadata: upload.metadata.metadata,
|
|
150
154
|
}, this._cloudFunctions, this._persistence.readBytes(upload.path, upload.size));
|
|
151
155
|
metadata.update(upload.metadata, false);
|
|
152
|
-
const authorized = await this._rulesValidator.validate(["b", upload.bucketId, "o", upload.objectId].join("/"), upload.bucketId, types_1.RulesetOperationMethod.CREATE, {
|
|
156
|
+
const authorized = await this._rulesValidator.validate(["b", upload.bucketId, "o", upload.objectId].join("/"), upload.bucketId, types_1.RulesetOperationMethod.CREATE, {
|
|
157
|
+
before: storedMetadata === null || storedMetadata === void 0 ? void 0 : storedMetadata.asRulesResource(),
|
|
158
|
+
after: metadata === null || metadata === void 0 ? void 0 : metadata.asRulesResource(),
|
|
159
|
+
}, upload.authorization);
|
|
153
160
|
if (!authorized) {
|
|
154
161
|
this._persistence.deleteFile(upload.path);
|
|
155
162
|
throw new errors_1.ForbiddenError();
|
|
@@ -203,7 +210,7 @@ class StorageLayer {
|
|
|
203
210
|
async listObjects(request) {
|
|
204
211
|
var _a;
|
|
205
212
|
const { bucketId, prefix, delimiter, pageToken, authorization } = request;
|
|
206
|
-
const authorized = await this._rulesValidator.validate(["b", bucketId, "o", prefix].join("/"), bucketId, types_1.RulesetOperationMethod.LIST, {}, authorization);
|
|
213
|
+
const authorized = await this._rulesValidator.validate(["b", bucketId, "o", prefix.replace(TRAILING_SLASHES_PATTERN, "")].join("/"), bucketId, types_1.RulesetOperationMethod.LIST, {}, authorization, delimiter);
|
|
207
214
|
if (!authorized) {
|
|
208
215
|
throw new errors_1.ForbiddenError();
|
|
209
216
|
}
|
|
@@ -287,7 +294,7 @@ class StorageLayer {
|
|
|
287
294
|
get dirPath() {
|
|
288
295
|
return this._persistence.dirPath;
|
|
289
296
|
}
|
|
290
|
-
async export(storageExportPath) {
|
|
297
|
+
async export(storageExportPath, options) {
|
|
291
298
|
var e_1, _a;
|
|
292
299
|
const bucketsList = {
|
|
293
300
|
buckets: [],
|
|
@@ -295,6 +302,11 @@ class StorageLayer {
|
|
|
295
302
|
for (const b of await this.listBuckets()) {
|
|
296
303
|
bucketsList.buckets.push({ id: b.id });
|
|
297
304
|
}
|
|
305
|
+
void (0, track_1.trackEmulator)("emulator_export", {
|
|
306
|
+
initiated_by: options.initiatedBy,
|
|
307
|
+
emulator_name: types_2.Emulators.STORAGE,
|
|
308
|
+
count: bucketsList.buckets.length,
|
|
309
|
+
});
|
|
298
310
|
const bucketsFilePath = path.join(storageExportPath, "buckets.json");
|
|
299
311
|
await fse.writeFile(bucketsFilePath, JSON.stringify(bucketsList, undefined, 2));
|
|
300
312
|
const blobsDirPath = path.join(storageExportPath, "blobs");
|
|
@@ -318,9 +330,14 @@ class StorageLayer {
|
|
|
318
330
|
finally { if (e_1) throw e_1.error; }
|
|
319
331
|
}
|
|
320
332
|
}
|
|
321
|
-
import(storageExportPath) {
|
|
333
|
+
import(storageExportPath, options) {
|
|
322
334
|
const bucketsFile = path.join(storageExportPath, "buckets.json");
|
|
323
335
|
const bucketsList = JSON.parse((0, fs_1.readFileSync)(bucketsFile, "utf-8"));
|
|
336
|
+
void (0, track_1.trackEmulator)("emulator_import", {
|
|
337
|
+
initiated_by: options.initiatedBy,
|
|
338
|
+
emulator_name: types_2.Emulators.STORAGE,
|
|
339
|
+
count: bucketsList.buckets.length,
|
|
340
|
+
});
|
|
324
341
|
for (const b of bucketsList.buckets) {
|
|
325
342
|
const bucketMetadata = new metadata_1.CloudStorageBucketMetadata(b.id);
|
|
326
343
|
this._buckets.set(b.id, bucketMetadata);
|
|
@@ -23,7 +23,8 @@ function splitBufferByDelimiter(buffer, delimiter, maxResults = -1) {
|
|
|
23
23
|
return bufferParts;
|
|
24
24
|
}
|
|
25
25
|
function parseMultipartRequestBody(boundaryId, body) {
|
|
26
|
-
const
|
|
26
|
+
const cleanBoundaryId = boundaryId.replace(/^["'](.+(?=["']$))["']$/, "$1");
|
|
27
|
+
const boundaryString = `--${cleanBoundaryId}`;
|
|
27
28
|
const bodyParts = splitBufferByDelimiter(body, boundaryString).map((buf) => {
|
|
28
29
|
return Buffer.from(buf.slice(2));
|
|
29
30
|
});
|
|
@@ -35,8 +36,8 @@ function parseMultipartRequestBody(boundaryId, body) {
|
|
|
35
36
|
}
|
|
36
37
|
function parseMultipartRequestBodyPart(bodyPart) {
|
|
37
38
|
const sections = splitBufferByDelimiter(bodyPart, LINE_SEPARATOR, 3);
|
|
38
|
-
const contentTypeRaw = sections[0].toString();
|
|
39
|
-
if (!contentTypeRaw.startsWith("
|
|
39
|
+
const contentTypeRaw = sections[0].toString().toLowerCase();
|
|
40
|
+
if (!contentTypeRaw.startsWith("content-type: ")) {
|
|
40
41
|
throw new Error(`Failed to parse multipart request body part. Missing content type.`);
|
|
41
42
|
}
|
|
42
43
|
const dataRaw = Buffer.from(sections[2]).slice(0, sections[2].byteLength - LINE_SEPARATOR.length);
|
|
@@ -44,11 +45,11 @@ function parseMultipartRequestBodyPart(bodyPart) {
|
|
|
44
45
|
}
|
|
45
46
|
function parseObjectUploadMultipartRequest(contentTypeHeader, body) {
|
|
46
47
|
if (!contentTypeHeader.startsWith("multipart/related")) {
|
|
47
|
-
throw new Error(`
|
|
48
|
+
throw new Error(`Bad content type. ${contentTypeHeader}`);
|
|
48
49
|
}
|
|
49
50
|
const boundaryId = contentTypeHeader.split("boundary=")[1];
|
|
50
51
|
if (!boundaryId) {
|
|
51
|
-
throw new Error(`
|
|
52
|
+
throw new Error(`Bad content type. ${contentTypeHeader}`);
|
|
52
53
|
}
|
|
53
54
|
const parsedBody = parseMultipartRequestBody(boundaryId, body);
|
|
54
55
|
if (parsedBody.length !== 2) {
|
|
@@ -65,12 +65,12 @@ class StorageRulesRuntime {
|
|
|
65
65
|
get alive() {
|
|
66
66
|
return this._alive;
|
|
67
67
|
}
|
|
68
|
-
async start(
|
|
68
|
+
async start(autoDownload = true) {
|
|
69
69
|
var _a, _b;
|
|
70
70
|
const downloadDetails = downloadableEmulators_1.DownloadDetails[types_2.Emulators.STORAGE];
|
|
71
71
|
const hasEmulator = fs.existsSync(downloadDetails.downloadPath);
|
|
72
72
|
if (!hasEmulator) {
|
|
73
|
-
if (
|
|
73
|
+
if (autoDownload) {
|
|
74
74
|
if (process.env.CI) {
|
|
75
75
|
utils.logWarning(`It appears you are running in a CI environment. You can avoid downloading the ${constants_1.Constants.description(types_2.Emulators.STORAGE)} repeatedly by caching the ${downloadDetails.opts.cacheDir} directory.`);
|
|
76
76
|
}
|
|
@@ -199,6 +199,7 @@ class StorageRulesRuntime {
|
|
|
199
199
|
service: "firebase.storage",
|
|
200
200
|
path: opts.path,
|
|
201
201
|
method: opts.method,
|
|
202
|
+
delimiter: opts.delimiter,
|
|
202
203
|
variables: runtimeVariables,
|
|
203
204
|
},
|
|
204
205
|
};
|
|
@@ -293,7 +294,6 @@ function createRequestExpressionValue(opts) {
|
|
|
293
294
|
segments: opts.path
|
|
294
295
|
.split("/")
|
|
295
296
|
.filter((s) => s)
|
|
296
|
-
.slice(3)
|
|
297
297
|
.map((simple) => ({
|
|
298
298
|
simple,
|
|
299
299
|
})),
|
|
@@ -5,13 +5,14 @@ const emulatorLogger_1 = require("../../emulatorLogger");
|
|
|
5
5
|
const types_1 = require("../../types");
|
|
6
6
|
function getFirebaseRulesValidator(rulesetProvider) {
|
|
7
7
|
return {
|
|
8
|
-
validate: async (path, bucketId, method, variableOverrides, authorization) => {
|
|
8
|
+
validate: async (path, bucketId, method, variableOverrides, authorization, delimiter) => {
|
|
9
9
|
return await isPermitted({
|
|
10
10
|
ruleset: rulesetProvider(bucketId),
|
|
11
11
|
file: variableOverrides,
|
|
12
12
|
path,
|
|
13
13
|
method,
|
|
14
14
|
authorization,
|
|
15
|
+
delimiter,
|
|
15
16
|
});
|
|
16
17
|
},
|
|
17
18
|
};
|
|
@@ -19,7 +20,7 @@ function getFirebaseRulesValidator(rulesetProvider) {
|
|
|
19
20
|
exports.getFirebaseRulesValidator = getFirebaseRulesValidator;
|
|
20
21
|
function getAdminOnlyFirebaseRulesValidator() {
|
|
21
22
|
return {
|
|
22
|
-
validate: (_path, _bucketId, _method, _variableOverrides, _authorization) => {
|
|
23
|
+
validate: (_path, _bucketId, _method, _variableOverrides, _authorization, delimiter) => {
|
|
23
24
|
return Promise.resolve(true);
|
|
24
25
|
},
|
|
25
26
|
};
|
|
@@ -42,6 +43,7 @@ async function isPermitted(opts) {
|
|
|
42
43
|
path: opts.path,
|
|
43
44
|
file: opts.file,
|
|
44
45
|
token: opts.authorization ? opts.authorization.split(" ")[1] : undefined,
|
|
46
|
+
delimiter: opts.delimiter,
|
|
45
47
|
});
|
|
46
48
|
if (issues.exist()) {
|
|
47
49
|
issues.all.forEach((warningOrError) => {
|
|
@@ -36,12 +36,13 @@ function createApp(defaultProjectId, emulator) {
|
|
|
36
36
|
type: ["application/json"],
|
|
37
37
|
}));
|
|
38
38
|
app.post("/internal/export", async (req, res) => {
|
|
39
|
+
const initiatedBy = req.body.initiatedBy || "unknown";
|
|
39
40
|
const path = req.body.path;
|
|
40
41
|
if (!path) {
|
|
41
42
|
res.status(400).send("Export request body must include 'path'.");
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
|
-
await storageLayer.export(path);
|
|
45
|
+
await storageLayer.export(path, { initiatedBy });
|
|
45
46
|
res.sendStatus(200);
|
|
46
47
|
});
|
|
47
48
|
app.put("/internal/setRules", async (req, res) => {
|
package/lib/emulator/types.js
CHANGED
|
@@ -14,6 +14,7 @@ var Emulators;
|
|
|
14
14
|
Emulators["LOGGING"] = "logging";
|
|
15
15
|
Emulators["STORAGE"] = "storage";
|
|
16
16
|
Emulators["EXTENSIONS"] = "extensions";
|
|
17
|
+
Emulators["EVENTARC"] = "eventarc";
|
|
17
18
|
})(Emulators = exports.Emulators || (exports.Emulators = {}));
|
|
18
19
|
exports.DOWNLOADABLE_EMULATORS = [
|
|
19
20
|
Emulators.FIRESTORE,
|
|
@@ -36,12 +37,14 @@ exports.ALL_SERVICE_EMULATORS = [
|
|
|
36
37
|
Emulators.HOSTING,
|
|
37
38
|
Emulators.PUBSUB,
|
|
38
39
|
Emulators.STORAGE,
|
|
40
|
+
Emulators.EVENTARC,
|
|
39
41
|
].filter((v) => v);
|
|
40
42
|
exports.EMULATORS_SUPPORTED_BY_FUNCTIONS = [
|
|
41
43
|
Emulators.FIRESTORE,
|
|
42
44
|
Emulators.DATABASE,
|
|
43
45
|
Emulators.PUBSUB,
|
|
44
46
|
Emulators.STORAGE,
|
|
47
|
+
Emulators.EVENTARC,
|
|
45
48
|
];
|
|
46
49
|
exports.EMULATORS_SUPPORTED_BY_UI = [
|
|
47
50
|
Emulators.AUTH,
|
|
@@ -56,6 +59,7 @@ exports.EMULATORS_SUPPORTED_BY_USE_EMULATOR = [
|
|
|
56
59
|
Emulators.DATABASE,
|
|
57
60
|
Emulators.FIRESTORE,
|
|
58
61
|
Emulators.FUNCTIONS,
|
|
62
|
+
Emulators.STORAGE,
|
|
59
63
|
];
|
|
60
64
|
exports.ALL_EMULATORS = [
|
|
61
65
|
Emulators.HUB,
|
package/lib/emulator/ui.js
CHANGED
|
@@ -6,6 +6,7 @@ const downloadableEmulators = require("./downloadableEmulators");
|
|
|
6
6
|
const registry_1 = require("./registry");
|
|
7
7
|
const error_1 = require("../error");
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
|
+
const track_1 = require("../track");
|
|
9
10
|
class EmulatorUI {
|
|
10
11
|
constructor(args) {
|
|
11
12
|
this.args = args;
|
|
@@ -15,14 +16,18 @@ class EmulatorUI {
|
|
|
15
16
|
throw new error_1.FirebaseError(`Cannot start ${constants_1.Constants.description(types_1.Emulators.UI)} without ${constants_1.Constants.description(types_1.Emulators.HUB)}!`);
|
|
16
17
|
}
|
|
17
18
|
const hubInfo = registry_1.EmulatorRegistry.get(types_1.Emulators.HUB).getInfo();
|
|
18
|
-
const { auto_download, host, port, projectId } = this.args;
|
|
19
|
+
const { auto_download: autoDownload, host, port, projectId } = this.args;
|
|
19
20
|
const env = {
|
|
20
21
|
HOST: host.toString(),
|
|
21
22
|
PORT: port.toString(),
|
|
22
23
|
GCLOUD_PROJECT: projectId,
|
|
23
24
|
[constants_1.Constants.FIREBASE_EMULATOR_HUB]: registry_1.EmulatorRegistry.getInfoHostString(hubInfo),
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
const session = (0, track_1.emulatorSession)();
|
|
27
|
+
if (session) {
|
|
28
|
+
env[constants_1.Constants.FIREBASE_GA_SESSION] = JSON.stringify(session);
|
|
29
|
+
}
|
|
30
|
+
return downloadableEmulators.start(types_1.Emulators.UI, { auto_download: autoDownload }, env);
|
|
26
31
|
}
|
|
27
32
|
connect() {
|
|
28
33
|
return Promise.resolve();
|
package/lib/ensureApiEnabled.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.enableApiURI = exports.ensure = exports.check = exports.POLL_SETTINGS = void 0;
|
|
4
|
-
const
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
5
|
const track_1 = require("./track");
|
|
6
6
|
const api_1 = require("./api");
|
|
7
7
|
const apiv2_1 = require("./apiv2");
|
|
@@ -21,7 +21,7 @@ async function check(projectId, apiName, prefix, silent = false) {
|
|
|
21
21
|
});
|
|
22
22
|
const isEnabled = res.body.state === "ENABLED";
|
|
23
23
|
if (isEnabled && !silent) {
|
|
24
|
-
utils.logLabeledSuccess(prefix, `required API ${(0,
|
|
24
|
+
utils.logLabeledSuccess(prefix, `required API ${(0, colorette_1.bold)(apiName)} is enabled`);
|
|
25
25
|
}
|
|
26
26
|
return isEnabled;
|
|
27
27
|
}
|
|
@@ -34,7 +34,7 @@ async function enable(projectId, apiName) {
|
|
|
34
34
|
}
|
|
35
35
|
catch (err) {
|
|
36
36
|
if ((0, error_1.isBillingError)(err)) {
|
|
37
|
-
throw new error_1.FirebaseError(`Your project ${(0,
|
|
37
|
+
throw new error_1.FirebaseError(`Your project ${(0, colorette_1.bold)(projectId)} must be on the Blaze (pay-as-you-go) plan to complete this command. Required API ${(0, colorette_1.bold)(apiName)} can't be enabled until the upgrade is complete. To upgrade, visit the following URL:
|
|
38
38
|
|
|
39
39
|
https://console.firebase.google.com/project/${projectId}/usage/details`);
|
|
40
40
|
}
|
|
@@ -54,27 +54,27 @@ async function pollCheckEnabled(projectId, apiName, prefix, silent, enablementRe
|
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
if (!silent) {
|
|
57
|
-
utils.logLabeledBullet(prefix, `waiting for API ${(0,
|
|
57
|
+
utils.logLabeledBullet(prefix, `waiting for API ${(0, colorette_1.bold)(apiName)} to activate...`);
|
|
58
58
|
}
|
|
59
59
|
return pollCheckEnabled(projectId, apiName, prefix, silent, enablementRetries, pollRetries + 1);
|
|
60
60
|
}
|
|
61
61
|
async function enableApiWithRetries(projectId, apiName, prefix, silent, enablementRetries = 0) {
|
|
62
62
|
if (enablementRetries > 1) {
|
|
63
|
-
throw new error_1.FirebaseError(`Timed out waiting for API ${(0,
|
|
63
|
+
throw new error_1.FirebaseError(`Timed out waiting for API ${(0, colorette_1.bold)(apiName)} to enable. Please try again in a few minutes.`);
|
|
64
64
|
}
|
|
65
65
|
await enable(projectId, apiName);
|
|
66
66
|
return pollCheckEnabled(projectId, apiName, prefix, silent, enablementRetries);
|
|
67
67
|
}
|
|
68
68
|
async function ensure(projectId, apiName, prefix, silent = false) {
|
|
69
69
|
if (!silent) {
|
|
70
|
-
utils.logLabeledBullet(prefix, `ensuring required API ${(0,
|
|
70
|
+
utils.logLabeledBullet(prefix, `ensuring required API ${(0, colorette_1.bold)(apiName)} is enabled...`);
|
|
71
71
|
}
|
|
72
72
|
const isEnabled = await check(projectId, apiName, prefix, silent);
|
|
73
73
|
if (isEnabled) {
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
if (!silent) {
|
|
77
|
-
utils.logLabeledWarning(prefix, `missing required API ${(0,
|
|
77
|
+
utils.logLabeledWarning(prefix, `missing required API ${(0, colorette_1.bold)(apiName)}. Enabling now...`);
|
|
78
78
|
}
|
|
79
79
|
return enableApiWithRetries(projectId, apiName, prefix, silent);
|
|
80
80
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.promptForPublisherTOS = exports.displayApis = exports.displayRoles = exports.retrieveRoleInfo = exports.formatDescription = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const { marked } = require("marked");
|
|
6
6
|
const TerminalRenderer = require("marked-terminal");
|
|
7
7
|
const error_1 = require("../error");
|
|
@@ -4,7 +4,7 @@ exports.askForEventArcLocation = exports.askShouldCollectEventsConfig = exports.
|
|
|
4
4
|
const prompt_1 = require("../prompt");
|
|
5
5
|
const extensionsApi = require("../extensions/extensionsApi");
|
|
6
6
|
const utils = require("../utils");
|
|
7
|
-
const clc = require("
|
|
7
|
+
const clc = require("colorette");
|
|
8
8
|
const logger_1 = require("../logger");
|
|
9
9
|
const { marked } = require("marked");
|
|
10
10
|
function checkAllowedEventTypesResponse(response, validEvents) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInquirerDefault = exports.promptCreateSecret = exports.askForParam = exports.ask = exports.checkResponse = exports.SecretLocation = void 0;
|
|
4
4
|
const _ = require("lodash");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
const { marked } = require("marked");
|
|
7
7
|
const types_1 = require("./types");
|
|
8
8
|
const secretManagerApi = require("../gcp/secretManager");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseChangelog = exports.getLocalChangelog = exports.breakingChangesInUpdate = exports.displayReleaseNotes = exports.getReleaseNotesForUpdate = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const { marked } = require("marked");
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const semver = require("semver");
|
|
@@ -39,7 +39,7 @@ function displayReleaseNotes(releaseNotes, fromVersion) {
|
|
|
39
39
|
const table = new Table({ head: ["Version", "What's New"], style: { head: ["yellow", "bold"] } });
|
|
40
40
|
for (const [version, note] of Object.entries(releaseNotes)) {
|
|
41
41
|
if (breakingVersions.includes(version)) {
|
|
42
|
-
table.push([clc.yellow.bold(version), marked(note)]);
|
|
42
|
+
table.push([clc.yellow(clc.bold(version)), marked(note)]);
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
table.push([version, marked(note)]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.enableBilling = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const opn = require("open");
|
|
6
6
|
const cloudbilling = require("../gcp/cloudbilling");
|
|
7
7
|
const error_1 = require("../error");
|
|
@@ -59,7 +59,7 @@ async function setUpBillingAccount(projectId) {
|
|
|
59
59
|
logger_1.logger.info();
|
|
60
60
|
logger_1.logger.info(`Extension require your project to be upgraded to the Blaze plan. Please visit the following link to add a billing account:`);
|
|
61
61
|
logger_1.logger.info();
|
|
62
|
-
logger_1.logger.info(clc.bold.underline(billingURL));
|
|
62
|
+
logger_1.logger.info(clc.bold(clc.underline(billingURL)));
|
|
63
63
|
logger_1.logger.info();
|
|
64
64
|
const open = await prompt.promptOnce({
|
|
65
65
|
name: "open-url",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printSourceDownloadLink = exports.displayExtInfo = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const { marked } = require("marked");
|
|
6
6
|
const TerminalRenderer = require("marked-terminal");
|
|
7
7
|
const utils = require("../utils");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getExtension = exports.deleteExtension = exports.unpublishExtension = exports.publishExtensionVersion = exports.undeprecateExtensionVersion = exports.deprecateExtensionVersion = exports.registerPublisherProfile = exports.getPublisherProfile = exports.listExtensionVersions = exports.listExtensions = exports.getExtensionVersion = exports.getSource = exports.createSource = exports.updateInstanceFromRegistry = exports.updateInstance = exports.configureInstance = exports.listInstances = exports.getInstance = exports.deleteInstance = exports.createInstance = void 0;
|
|
4
4
|
const yaml = require("js-yaml");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
const { marked } = require("marked");
|
|
7
7
|
const apiv2_1 = require("../apiv2");
|
|
8
8
|
const api_1 = require("../api");
|
|
@@ -291,13 +291,14 @@ async function listExtensions(publisherId) {
|
|
|
291
291
|
return extensions;
|
|
292
292
|
}
|
|
293
293
|
exports.listExtensions = listExtensions;
|
|
294
|
-
async function listExtensionVersions(ref, filter = "") {
|
|
294
|
+
async function listExtensionVersions(ref, filter = "", showPrereleases = false) {
|
|
295
295
|
const { publisherId, extensionId } = refs.parse(ref);
|
|
296
296
|
const extensionVersions = [];
|
|
297
297
|
const getNextPage = async (pageToken = "") => {
|
|
298
298
|
const res = await apiClient.get(`/publishers/${publisherId}/extensions/${extensionId}/versions`, {
|
|
299
299
|
queryParams: {
|
|
300
300
|
filter,
|
|
301
|
+
showPrereleases: String(showPrereleases),
|
|
301
302
|
pageSize: PAGE_SIZE_MAX,
|
|
302
303
|
pageToken,
|
|
303
304
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canonicalizeRefInput = exports.diagnoseAndFixProject = exports.confirm = exports.getSourceOrigin = exports.isLocalOrURLPath = exports.isLocalPath = exports.isUrlPath = exports.instanceIdExists = exports.promptForRepeatInstance = exports.promptForOfficialExtension = exports.displayReleaseNotes = exports.getPublisherProjectFromName = exports.createSourceFromLocation = exports.publishExtensionVersionFromLocalSource = exports.ensureExtensionsApiEnabled = exports.promptForValidInstanceId = exports.validateSpec = exports.validateCommandLineParams = exports.populateDefaultParams = 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;
|
|
4
|
-
const clc = require("
|
|
3
|
+
exports.canonicalizeRefInput = exports.diagnoseAndFixProject = exports.confirm = exports.getSourceOrigin = exports.isLocalOrURLPath = exports.isLocalPath = exports.isUrlPath = exports.instanceIdExists = exports.promptForRepeatInstance = exports.promptForOfficialExtension = exports.displayReleaseNotes = exports.getPublisherProjectFromName = exports.createSourceFromLocation = exports.publishExtensionVersionFromLocalSource = exports.incrementPrereleaseVersion = exports.ensureExtensionsApiEnabled = exports.promptForValidInstanceId = exports.validateSpec = exports.validateCommandLineParams = exports.populateDefaultParams = 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;
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const ora = require("ora");
|
|
6
6
|
const semver = require("semver");
|
|
7
7
|
const { marked } = require("marked");
|
|
@@ -282,6 +282,33 @@ async function archiveAndUploadSource(extPath, bucketName) {
|
|
|
282
282
|
const res = await (0, storage_1.uploadObject)(zippedSource, bucketName);
|
|
283
283
|
return `/${res.bucket}/${res.object}`;
|
|
284
284
|
}
|
|
285
|
+
async function incrementPrereleaseVersion(ref, extensionVersion, stage) {
|
|
286
|
+
var _a;
|
|
287
|
+
const stageOptions = ["stable", "alpha", "beta", "rc"];
|
|
288
|
+
if (!stageOptions.includes(stage)) {
|
|
289
|
+
throw new error_1.FirebaseError(`--stage flag only supports the following values: ${stageOptions}`);
|
|
290
|
+
}
|
|
291
|
+
if (stage !== "stable") {
|
|
292
|
+
const version = semver.parse(extensionVersion);
|
|
293
|
+
if (version.prerelease.length > 0 || version.build.length > 0) {
|
|
294
|
+
throw new error_1.FirebaseError(`Cannot combine the --stage flag with a version with a prerelease annotation in extension.yaml.`);
|
|
295
|
+
}
|
|
296
|
+
let extensionVersions = [];
|
|
297
|
+
try {
|
|
298
|
+
extensionVersions = await (0, extensionsApi_1.listExtensionVersions)(ref, `id="${version.version}"`, true);
|
|
299
|
+
}
|
|
300
|
+
catch (e) {
|
|
301
|
+
}
|
|
302
|
+
const latestVersion = (_a = extensionVersions
|
|
303
|
+
.map((version) => semver.parse(version.spec.version))
|
|
304
|
+
.filter((version) => version.prerelease.length > 0 && version.prerelease[0] === stage)
|
|
305
|
+
.sort((v1, v2) => semver.compare(v1, v2))
|
|
306
|
+
.pop()) !== null && _a !== void 0 ? _a : `${version}-${stage}`;
|
|
307
|
+
return semver.inc(latestVersion, "prerelease", undefined, stage);
|
|
308
|
+
}
|
|
309
|
+
return extensionVersion;
|
|
310
|
+
}
|
|
311
|
+
exports.incrementPrereleaseVersion = incrementPrereleaseVersion;
|
|
285
312
|
async function publishExtensionVersionFromLocalSource(args) {
|
|
286
313
|
const extensionSpec = await (0, localHelper_1.getLocalExtensionSpec)(args.rootDirectory);
|
|
287
314
|
if (extensionSpec.name !== args.extensionId) {
|
|
@@ -290,6 +317,7 @@ async function publishExtensionVersionFromLocalSource(args) {
|
|
|
290
317
|
const subbedSpec = JSON.parse(JSON.stringify(extensionSpec));
|
|
291
318
|
subbedSpec.params = substituteParams(extensionSpec.params || [], exports.AUTOPOULATED_PARAM_PLACEHOLDERS);
|
|
292
319
|
validateSpec(subbedSpec);
|
|
320
|
+
extensionSpec.version = await incrementPrereleaseVersion(`${args.publisherId}/${args.extensionId}`, extensionSpec.version, args.stage);
|
|
293
321
|
let extension;
|
|
294
322
|
try {
|
|
295
323
|
extension = await (0, extensionsApi_1.getExtension)(`${args.publisherId}/${args.extensionId}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listExtensions = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const Table = require("cli-table");
|
|
6
6
|
const extensionsApi_1 = require("./extensionsApi");
|
|
7
7
|
const logger_1 = require("../logger");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.showPostDeprecationNotice = exports.readInstanceParam = exports.getInstanceRef = exports.getInstanceTarget = exports.instanceExists = exports.loadConfig = exports.removeFromManifest = exports.writeLocalSecrets = exports.writeToManifest = exports.ENV_DIRECTORY = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const refs = require("./refs");
|
|
7
7
|
const config_1 = require("../config");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildMetricsTableRow = exports.parseBucket = exports.parseTimeseriesResponse = void 0;
|
|
4
4
|
const semver = require("semver");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
function parseTimeseriesResponse(series) {
|
|
7
7
|
const ret = [];
|
|
8
8
|
for (const s of series) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readEnvFile = exports.promptForNewParams = exports.getParamsForUpdate = exports.getParams = exports.getParamsWithCurrentValuesAsDefaults = exports.setNewDefaults = exports.buildBindingOptionsWithBaseValue = exports.getBaseParamBindings = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
const fs = require("fs-extra");
|
|
7
7
|
const error_1 = require("../error");
|
|
8
8
|
const logger_1 = require("../logger");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inferUpdateSource = exports.updateFromPublisherSource = exports.updateToVersionFromPublisherSource = exports.updateFromUrlSource = exports.updateFromLocalSource = exports.update = exports.warningUpdateToOtherSource = exports.getExistingSourceOrigin = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const semver = require("semver");
|
|
6
6
|
const { marked } = require("marked");
|
|
7
7
|
const error_1 = require("../error");
|
|
@@ -120,7 +120,7 @@ async function updateToVersionFromPublisherSource(projectId, instanceId, extVers
|
|
|
120
120
|
source = await extensionsApi.getExtensionVersion(extVersionRef);
|
|
121
121
|
}
|
|
122
122
|
catch (err) {
|
|
123
|
-
throw new error_1.FirebaseError(`Could not find source '${clc.bold(extVersionRef)}' because (${clc.bold(version)}) is not a published version. To update, use the latest version of this extension (${clc.bold(extension.latestVersion)}).`);
|
|
123
|
+
throw new error_1.FirebaseError(`Could not find source '${clc.bold(extVersionRef)}' because (${clc.bold(version || "")}) is not a published version. To update, use the latest version of this extension (${clc.bold(extension.latestVersion || "")}).`);
|
|
124
124
|
}
|
|
125
125
|
showUpdateVersionInfo(instanceId, existingSpec.version, source.spec.version, extVersionRef);
|
|
126
126
|
warningUpdateToOtherSource(extensionsHelper_1.SourceOrigin.PUBLISHED_EXTENSION);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.outOfBandChangesWarning = exports.paramsFlagDeprecationWarning = exports.displayWarningsForDeploy = exports.displayWarningPrompts = void 0;
|
|
4
4
|
const { marked } = require("marked");
|
|
5
|
-
const clc = require("
|
|
5
|
+
const clc = require("colorette");
|
|
6
6
|
const types_1 = require("./types");
|
|
7
7
|
const displayExtensionInfo_1 = require("./displayExtensionInfo");
|
|
8
8
|
const extensionsHelper_1 = require("./extensionsHelper");
|
|
@@ -20,7 +20,7 @@ function displayEAPWarning({ publisherId, sourceDownloadUri, githubLink, }) {
|
|
|
20
20
|
(0, displayExtensionInfo_1.printSourceDownloadLink)(sourceDownloadUri);
|
|
21
21
|
}
|
|
22
22
|
function displayExperimentalWarning() {
|
|
23
|
-
utils.logLabeledBullet(extensionsHelper_1.logPrefix, marked(`${clc.yellow.bold("Important")}: This extension is ${clc.bold("experimental")} and may not be production-ready. Its functionality might change in backward-incompatible ways before its official release, or it may be discontinued.`));
|
|
23
|
+
utils.logLabeledBullet(extensionsHelper_1.logPrefix, marked(`${clc.yellow(clc.bold("Important"))}: This extension is ${clc.bold("experimental")} and may not be production-ready. Its functionality might change in backward-incompatible ways before its official release, or it may be discontinued.`));
|
|
24
24
|
}
|
|
25
25
|
async function displayWarningPrompts(publisherId, launchStage, extensionVersion) {
|
|
26
26
|
const trustedPublishers = await (0, resolveSource_1.getTrustedPublishers)();
|
package/lib/fetchMOTD.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchMOTD = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const semver = require("semver");
|
|
6
6
|
const apiv2_1 = require("./apiv2");
|
|
7
7
|
const configstore_1 = require("./configstore");
|
package/lib/firestore/delete.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FirestoreDelete = void 0;
|
|
4
|
-
const clc = require("
|
|
4
|
+
const clc = require("colorette");
|
|
5
5
|
const ProgressBar = require("progress");
|
|
6
6
|
const apiv2 = require("../apiv2");
|
|
7
7
|
const firestore = require("../gcp/firestore");
|