firebase-tools 10.0.1 → 10.1.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/lib/accountExporter.js +9 -8
- package/lib/accountImporter.js +10 -8
- package/lib/api.js +1 -0
- package/lib/apiv2.js +91 -48
- package/lib/appdistribution/client.js +1 -1
- package/lib/appdistribution/options-parser-util.js +1 -1
- package/lib/archiveDirectory.js +63 -73
- package/lib/auth.js +2 -2
- package/lib/bin/firebase.js +1 -1
- package/lib/command.js +26 -26
- package/lib/commands/appdistribution-distribute.js +4 -4
- package/lib/commands/appdistribution-testers-add.js +2 -2
- package/lib/commands/appdistribution-testers-remove.js +2 -2
- package/lib/commands/apps-android-sha-create.js +2 -2
- package/lib/commands/apps-android-sha-delete.js +2 -2
- package/lib/commands/apps-android-sha-list.js +2 -2
- package/lib/commands/apps-create.js +9 -9
- package/lib/commands/apps-list.js +3 -3
- package/lib/commands/apps-sdkconfig.js +8 -8
- package/lib/commands/auth-export.js +26 -25
- package/lib/commands/auth-import.js +88 -78
- package/lib/commands/database-get.js +1 -1
- package/lib/commands/database-instances-create.js +4 -4
- package/lib/commands/database-instances-list.js +4 -4
- package/lib/commands/database-profile.js +1 -1
- package/lib/commands/database-push.js +1 -1
- package/lib/commands/database-remove.js +2 -2
- package/lib/commands/database-set.js +2 -2
- package/lib/commands/database-settings-get.js +1 -1
- package/lib/commands/database-settings-set.js +1 -1
- package/lib/commands/database-update.js +2 -2
- package/lib/commands/ext-configure.js +3 -3
- package/lib/commands/ext-dev-deprecate.js +4 -4
- package/lib/commands/ext-dev-extension-delete.js +3 -3
- package/lib/commands/ext-dev-init.js +4 -4
- package/lib/commands/ext-dev-list.js +1 -1
- package/lib/commands/ext-dev-publish.js +4 -4
- package/lib/commands/ext-dev-register.js +6 -6
- package/lib/commands/ext-dev-undeprecate.js +4 -4
- package/lib/commands/ext-dev-unpublish.js +3 -3
- package/lib/commands/ext-dev-usage.js +140 -0
- package/lib/commands/ext-export.js +8 -8
- package/lib/commands/ext-info.js +5 -5
- package/lib/commands/ext-install.js +27 -23
- package/lib/commands/ext-list.js +2 -2
- package/lib/commands/ext-sources-create.js +2 -2
- package/lib/commands/ext-uninstall.js +4 -4
- package/lib/commands/ext-update.js +18 -18
- package/lib/commands/ext.js +3 -3
- package/lib/commands/firestore-delete.js +1 -1
- package/lib/commands/functions-config-clone.js +22 -23
- package/lib/commands/functions-config-export.js +11 -11
- package/lib/commands/functions-config-get.js +22 -22
- package/lib/commands/functions-config-set.js +24 -22
- package/lib/commands/functions-config-unset.js +20 -22
- package/lib/commands/functions-delete.js +3 -3
- package/lib/commands/functions-deletegcfartifacts.js +4 -4
- package/lib/commands/functions-list.js +1 -1
- package/lib/commands/functions-log.js +1 -1
- package/lib/commands/help.js +12 -12
- package/lib/commands/hosting-channel-create.js +13 -13
- package/lib/commands/hosting-channel-delete.js +10 -10
- package/lib/commands/hosting-channel-deploy.js +18 -18
- package/lib/commands/hosting-channel-list.js +5 -5
- package/lib/commands/hosting-channel-open.js +9 -9
- package/lib/commands/hosting-clone.js +16 -16
- package/lib/commands/hosting-disable.js +1 -1
- package/lib/commands/hosting-sites-create.js +7 -7
- package/lib/commands/hosting-sites-delete.js +7 -7
- package/lib/commands/hosting-sites-get.js +2 -2
- package/lib/commands/hosting-sites-list.js +3 -3
- package/lib/commands/index.js +1 -0
- package/lib/commands/login-ci.js +10 -10
- package/lib/commands/login.js +2 -2
- package/lib/commands/logout.js +1 -1
- package/lib/commands/open.js +1 -1
- package/lib/commands/projects-addfirebase.js +2 -2
- package/lib/commands/projects-create.js +2 -2
- package/lib/commands/projects-list.js +1 -1
- package/lib/commands/remoteconfig-get.js +3 -3
- package/lib/commands/remoteconfig-rollback.js +3 -3
- package/lib/commands/remoteconfig-versions-list.js +7 -2
- package/lib/commands/setup-emulators-database.js +8 -7
- package/lib/commands/setup-emulators-firestore.js +8 -7
- package/lib/commands/setup-emulators-pubsub.js +5 -4
- package/lib/commands/setup-emulators-storage.js +4 -3
- package/lib/commands/setup-emulators-ui.js +8 -7
- package/lib/commands/target-apply.js +17 -16
- package/lib/commands/target-clear.js +11 -10
- package/lib/commands/target-remove.js +10 -9
- package/lib/commands/target.js +20 -20
- package/lib/config.js +6 -6
- package/lib/database/api.js +2 -2
- package/lib/database/metadata.js +16 -24
- package/lib/defaultCredentials.js +3 -3
- package/lib/deploy/extensions/deploy.js +4 -4
- package/lib/deploy/extensions/deploymentSummary.js +5 -4
- package/lib/deploy/extensions/index.js +1 -0
- package/lib/deploy/extensions/params.js +1 -1
- package/lib/deploy/extensions/planner.js +3 -3
- package/lib/deploy/extensions/prepare.js +9 -9
- package/lib/deploy/extensions/release.js +1 -1
- package/lib/deploy/extensions/secrets.js +7 -7
- package/lib/deploy/extensions/validate.js +2 -2
- package/lib/deploy/functions/backend.js +9 -5
- package/lib/deploy/functions/checkIam.js +7 -7
- package/lib/deploy/functions/containerCleaner.js +3 -3
- package/lib/deploy/functions/deploy.js +4 -4
- package/lib/deploy/functions/ensureCloudBuildEnabled.js +3 -3
- package/lib/deploy/functions/index.js +1 -0
- package/lib/deploy/functions/prepare.js +29 -23
- package/lib/deploy/functions/prompts.js +5 -5
- package/lib/deploy/functions/release/executor.js +4 -1
- package/lib/deploy/functions/release/fabricator.js +9 -6
- package/lib/deploy/functions/release/index.js +2 -2
- package/lib/deploy/functions/release/planner.js +6 -6
- package/lib/deploy/functions/release/reporter.js +8 -4
- package/lib/deploy/functions/runtimes/discovery/index.js +2 -2
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +14 -14
- package/lib/deploy/functions/runtimes/golang/index.js +11 -14
- package/lib/deploy/functions/runtimes/index.js +6 -10
- package/lib/deploy/functions/runtimes/node/index.js +6 -10
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +3 -3
- package/lib/deploy/functions/runtimes/node/validate.js +2 -1
- package/lib/deploy/functions/services/storage.js +1 -1
- package/lib/deploy/functions/triggerRegionHelper.js +1 -1
- package/lib/deploy/functions/validate.js +32 -4
- package/lib/deploy/hosting/convertConfig.js +45 -24
- package/lib/deploy/hosting/deploy.js +7 -7
- package/lib/deploy/hosting/prepare.js +1 -1
- package/lib/deploy/hosting/uploader.js +1 -1
- package/lib/deploy/hosting/validate.js +3 -3
- package/lib/deploy/remoteconfig/prepare.js +3 -3
- package/lib/deploy/remoteconfig/release.js +3 -3
- package/lib/deploy/storage/deploy.js +1 -1
- package/lib/deploy/storage/release.js +2 -2
- package/lib/detectProjectRoot.js +5 -5
- package/lib/emulator/auth/apiSpec.js +13 -7
- package/lib/emulator/auth/handlers.js +3 -3
- package/lib/emulator/auth/index.js +1 -1
- package/lib/emulator/auth/operations.js +256 -248
- package/lib/emulator/auth/server.js +11 -8
- package/lib/emulator/auth/state.js +12 -12
- package/lib/emulator/commandUtils.js +5 -5
- package/lib/emulator/controller.js +16 -11
- package/lib/emulator/downloadableEmulators.js +5 -4
- package/lib/emulator/emulatorLogger.js +1 -1
- package/lib/emulator/functionsEmulator.js +110 -75
- package/lib/emulator/functionsEmulatorRuntime.js +36 -21
- package/lib/emulator/functionsEmulatorShell.js +3 -2
- package/lib/emulator/functionsRuntimeWorker.js +1 -1
- package/lib/emulator/hubExport.js +2 -2
- package/lib/emulator/storage/apis/firebase.js +2 -2
- package/lib/emulator/storage/apis/gcloud.js +2 -2
- package/lib/emulator/storage/cloudFunctions.js +1 -1
- package/lib/emulator/storage/files.js +14 -14
- package/lib/emulator/storage/index.js +2 -2
- package/lib/emulator/storage/metadata.js +7 -6
- package/lib/emulator/storage/rules/runtime.js +10 -9
- package/lib/emulator/storage/server.js +2 -2
- package/lib/ensureApiEnabled.js +7 -7
- package/lib/error.js +3 -3
- package/lib/extensions/askUserForConsent.js +3 -4
- package/lib/extensions/askUserForParam.js +11 -11
- package/lib/extensions/billingMigrationHelper.js +2 -2
- package/lib/extensions/changelog.js +4 -4
- package/lib/extensions/displayExtensionInfo.js +6 -6
- package/lib/extensions/emulator/optionsHelper.js +1 -1
- package/lib/extensions/emulator/specHelper.js +1 -1
- package/lib/extensions/emulator/triggerHelper.js +1 -1
- package/lib/extensions/export.js +6 -6
- package/lib/extensions/extensionsApi.js +68 -110
- package/lib/extensions/extensionsHelper.js +56 -43
- package/lib/extensions/listExtensions.js +1 -1
- package/lib/extensions/localHelper.js +1 -1
- package/lib/extensions/metricsTypeDef.js +2 -0
- package/lib/extensions/metricsUtils.js +98 -0
- package/lib/extensions/paramHelper.js +6 -6
- package/lib/extensions/provisioningHelper.js +13 -14
- package/lib/extensions/resolveSource.js +6 -6
- package/lib/extensions/secretsUtils.js +3 -3
- package/lib/extensions/updateHelper.js +10 -10
- package/lib/extensions/utils.js +1 -1
- package/lib/extensions/warnings.js +11 -10
- package/lib/fetchWebSetup.js +2 -2
- package/lib/filterTargets.js +2 -2
- package/lib/firestore/indexes.js +2 -2
- package/lib/fsAsync.js +3 -3
- package/lib/fsutils.js +2 -2
- package/lib/functional.js +2 -1
- package/lib/functions/env.js +1 -1
- package/lib/functions/runtimeConfigExport.js +4 -4
- package/lib/functionsConfig.js +7 -8
- package/lib/functionsShellCommandAction.js +4 -3
- package/lib/gcp/cloudbilling.js +8 -19
- package/lib/gcp/cloudfunctions.js +22 -46
- package/lib/gcp/cloudlogging.js +8 -11
- package/lib/gcp/cloudmonitoring.js +77 -0
- package/lib/gcp/cloudscheduler.js +8 -19
- package/lib/gcp/firedata.js +5 -4
- package/lib/gcp/firestore.js +5 -5
- package/lib/gcp/iam.js +19 -34
- package/lib/gcp/resourceManager.js +10 -15
- package/lib/gcp/rules.js +18 -41
- package/lib/gcp/runtimeconfig.js +31 -53
- package/lib/gcp/secretManager.js +24 -45
- package/lib/gcp/storage.js +24 -29
- package/lib/getDefaultDatabaseInstance.js +1 -1
- package/lib/getDefaultHostingSite.js +1 -1
- package/lib/getProjectNumber.js +2 -2
- package/lib/handlePreviewToggles.js +5 -5
- package/lib/hosting/api.js +6 -6
- package/lib/hosting/cloudRunProxy.js +6 -6
- package/lib/hosting/functionsProxy.js +3 -3
- package/lib/hosting/implicitInit.js +2 -2
- package/lib/hosting/normalizedHostingConfigs.js +3 -3
- package/lib/hosting/proxy.js +2 -2
- package/lib/init/features/account.js +7 -7
- package/lib/init/features/database.js +9 -9
- package/lib/init/features/emulators.js +8 -8
- package/lib/init/features/firestore/index.js +3 -3
- package/lib/init/features/firestore/indexes.js +2 -2
- package/lib/init/features/firestore/rules.js +2 -2
- package/lib/init/features/functions/golang.js +4 -4
- package/lib/init/features/functions/index.js +4 -4
- package/lib/init/features/hosting/github.js +31 -31
- package/lib/init/features/project.js +8 -8
- package/lib/init/features/remoteconfig.js +2 -2
- package/lib/init/features/storage.js +2 -2
- package/lib/listFiles.js +1 -1
- package/lib/management/apps.js +3 -3
- package/lib/management/projects.js +6 -6
- package/lib/previews.js +2 -2
- package/lib/profiler.js +1 -1
- package/lib/projectPath.js +1 -1
- package/lib/projectUtils.js +2 -2
- package/lib/prompt.js +0 -1
- package/lib/rc.js +1 -1
- package/lib/remoteconfig/get.js +14 -8
- package/lib/remoteconfig/rollback.js +13 -6
- package/lib/remoteconfig/versionslist.js +13 -7
- package/lib/requireAuth.js +2 -2
- package/lib/requireDatabaseInstance.js +1 -1
- package/lib/requireHostingSite.js +1 -1
- package/lib/requirePermissions.js +4 -4
- package/lib/rulesDeploy.js +2 -2
- package/lib/serve/functions.js +14 -7
- package/lib/serve/hosting.js +7 -7
- package/lib/utils.js +3 -2
- package/npm-shrinkwrap.json +24090 -0
- package/package.json +36 -31
- package/schema/firebase-config.json +387 -12
- package/lib/commands/functions-config-legacy.js +0 -45
- package/lib/prepareFirebaseRules.js +0 -58
package/lib/accountExporter.js
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
var os = require("os");
|
|
3
3
|
var path = require("path");
|
|
4
4
|
var _ = require("lodash");
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const { Client } = require("./apiv2");
|
|
6
|
+
const { googleOrigin } = require("./api");
|
|
7
7
|
var { FirebaseError } = require("./error");
|
|
8
|
+
var utils = require("./utils");
|
|
9
|
+
const apiClient = new Client({
|
|
10
|
+
urlPrefix: googleOrigin,
|
|
11
|
+
});
|
|
8
12
|
var EXPORTED_JSON_KEYS = [
|
|
9
13
|
"localId",
|
|
10
14
|
"email",
|
|
@@ -149,12 +153,9 @@ var serialExportUsers = function (projectId, options) {
|
|
|
149
153
|
if (!options.timeoutRetryCount) {
|
|
150
154
|
options.timeoutRetryCount = 0;
|
|
151
155
|
}
|
|
152
|
-
return
|
|
153
|
-
.
|
|
154
|
-
|
|
155
|
-
json: true,
|
|
156
|
-
data: postBody,
|
|
157
|
-
origin: api.googleOrigin,
|
|
156
|
+
return apiClient
|
|
157
|
+
.post("/identitytoolkit/v3/relyingparty/downloadAccount", postBody, {
|
|
158
|
+
skipLog: { resBody: true },
|
|
158
159
|
})
|
|
159
160
|
.then(function (ret) {
|
|
160
161
|
options.timeoutRetryCount = 0;
|
package/lib/accountImporter.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var clc = require("cli-color");
|
|
3
3
|
var _ = require("lodash");
|
|
4
|
-
|
|
4
|
+
const { Client } = require("./apiv2");
|
|
5
|
+
const { googleOrigin } = require("./api");
|
|
5
6
|
const { logger } = require("./logger");
|
|
6
|
-
var utils = require("./utils");
|
|
7
7
|
var { FirebaseError } = require("./error");
|
|
8
|
+
var utils = require("./utils");
|
|
9
|
+
const apiClient = new Client({
|
|
10
|
+
urlPrefix: googleOrigin,
|
|
11
|
+
});
|
|
8
12
|
var ALLOWED_JSON_KEYS = [
|
|
9
13
|
"localId",
|
|
10
14
|
"email",
|
|
@@ -266,12 +270,10 @@ var validateUserJson = function (userJson) {
|
|
|
266
270
|
};
|
|
267
271
|
var _sendRequest = function (projectId, userList, hashOptions) {
|
|
268
272
|
logger.info("Starting importing " + userList.length + " account(s).");
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
data: _genUploadAccountPostBody(projectId, userList, hashOptions),
|
|
274
|
-
origin: api.googleOrigin,
|
|
273
|
+
const postData = _genUploadAccountPostBody(projectId, userList, hashOptions);
|
|
274
|
+
return apiClient
|
|
275
|
+
.post("/identitytoolkit/v3/relyingparty/uploadAccount", postData, {
|
|
276
|
+
skipLog: { body: true },
|
|
275
277
|
})
|
|
276
278
|
.then(function (ret) {
|
|
277
279
|
if (ret.body.error) {
|
package/lib/api.js
CHANGED
|
@@ -71,6 +71,7 @@ var api = {
|
|
|
71
71
|
clientSecret: utils.envOverride("FIREBASE_CLIENT_SECRET", "j9iVZfS8kkCEFUPaAeJV0sAi"),
|
|
72
72
|
cloudbillingOrigin: utils.envOverride("FIREBASE_CLOUDBILLING_URL", "https://cloudbilling.googleapis.com"),
|
|
73
73
|
cloudloggingOrigin: utils.envOverride("FIREBASE_CLOUDLOGGING_URL", "https://logging.googleapis.com"),
|
|
74
|
+
cloudMonitoringOrigin: utils.envOverride("CLOUD_MONITORING_URL", "https://monitoring.googleapis.com"),
|
|
74
75
|
containerRegistryDomain: utils.envOverride("CONTAINER_REGISTRY_DOMAIN", "gcr.io"),
|
|
75
76
|
artifactRegistryDomain: utils.envOverride("ARTIFACT_REGISTRY_DOMAIN", "https://artifactregistry.googleapis.com"),
|
|
76
77
|
appDistributionOrigin: utils.envOverride("FIREBASE_APP_DISTRIBUTION_URL", "https://firebaseappdistribution.googleapis.com"),
|
package/lib/apiv2.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Client = exports.setAccessToken = exports.setRefreshToken = void 0;
|
|
4
|
-
const stream_1 = require("stream");
|
|
5
4
|
const url_1 = require("url");
|
|
5
|
+
const stream_1 = require("stream");
|
|
6
6
|
const ProxyAgent = require("proxy-agent");
|
|
7
|
+
const retry = require("retry");
|
|
7
8
|
const abort_controller_1 = require("abort-controller");
|
|
8
9
|
const node_fetch_1 = require("node-fetch");
|
|
9
10
|
const util_1 = require("util");
|
|
@@ -151,6 +152,7 @@ class Client {
|
|
|
151
152
|
return `${this.opts.urlPrefix}${versionPath}${options.path}`;
|
|
152
153
|
}
|
|
153
154
|
async doRequest(options) {
|
|
155
|
+
var _a;
|
|
154
156
|
if (!options.path.startsWith("/")) {
|
|
155
157
|
options.path = "/" + options.path;
|
|
156
158
|
}
|
|
@@ -199,53 +201,94 @@ class Client {
|
|
|
199
201
|
else if (options.body !== undefined) {
|
|
200
202
|
fetchOptions.body = JSON.stringify(options.body);
|
|
201
203
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
catch (thrown) {
|
|
208
|
-
const err = thrown instanceof Error ? thrown : new Error(thrown);
|
|
209
|
-
const isAbortError = err.name.includes("AbortError");
|
|
210
|
-
if (isAbortError) {
|
|
211
|
-
throw new error_1.FirebaseError(`Timeout reached making request to ${fetchURL}`, { original: err });
|
|
212
|
-
}
|
|
213
|
-
throw new error_1.FirebaseError(`Failed to make request to ${fetchURL}`, { original: err });
|
|
214
|
-
}
|
|
215
|
-
finally {
|
|
216
|
-
if (reqTimeout) {
|
|
217
|
-
clearTimeout(reqTimeout);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
let body;
|
|
221
|
-
if (options.responseType === "json") {
|
|
222
|
-
const text = await res.text();
|
|
223
|
-
if (!text.length) {
|
|
224
|
-
body = undefined;
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
body = JSON.parse(text);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
else if (options.responseType === "stream") {
|
|
231
|
-
body = res.body;
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
throw new error_1.FirebaseError(`Unable to interpret response. Please set responseType.`, {
|
|
235
|
-
exit: 2,
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
this.logResponse(res, body, options);
|
|
239
|
-
if (res.status >= 400) {
|
|
240
|
-
if (!options.resolveOnHTTPError) {
|
|
241
|
-
throw responseToError({ statusCode: res.status }, body);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return {
|
|
245
|
-
status: res.status,
|
|
246
|
-
response: res,
|
|
247
|
-
body,
|
|
204
|
+
const operationOptions = {
|
|
205
|
+
retries: ((_a = options.retryCodes) === null || _a === void 0 ? void 0 : _a.length) ? 1 : 2,
|
|
206
|
+
minTimeout: 1 * 1000,
|
|
207
|
+
maxTimeout: 5 * 1000,
|
|
248
208
|
};
|
|
209
|
+
if (typeof options.retries === "number") {
|
|
210
|
+
operationOptions.retries = options.retries;
|
|
211
|
+
}
|
|
212
|
+
if (typeof options.retryMinTimeout === "number") {
|
|
213
|
+
operationOptions.minTimeout = options.retryMinTimeout;
|
|
214
|
+
}
|
|
215
|
+
if (typeof options.retryMaxTimeout === "number") {
|
|
216
|
+
operationOptions.maxTimeout = options.retryMaxTimeout;
|
|
217
|
+
}
|
|
218
|
+
const operation = retry.operation(operationOptions);
|
|
219
|
+
return await new Promise((resolve, reject) => {
|
|
220
|
+
operation.attempt(async (currentAttempt) => {
|
|
221
|
+
var _a;
|
|
222
|
+
let res;
|
|
223
|
+
let body;
|
|
224
|
+
try {
|
|
225
|
+
if (currentAttempt > 1) {
|
|
226
|
+
logger_1.logger.debug(`*** [apiv2] Attempting the request again. Attempt number ${currentAttempt}`);
|
|
227
|
+
}
|
|
228
|
+
this.logRequest(options);
|
|
229
|
+
try {
|
|
230
|
+
res = await (0, node_fetch_1.default)(fetchURL, fetchOptions);
|
|
231
|
+
}
|
|
232
|
+
catch (thrown) {
|
|
233
|
+
const err = thrown instanceof Error ? thrown : new Error(thrown);
|
|
234
|
+
const isAbortError = err.name.includes("AbortError");
|
|
235
|
+
if (isAbortError) {
|
|
236
|
+
throw new error_1.FirebaseError(`Timeout reached making request to ${fetchURL}`, {
|
|
237
|
+
original: err,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
throw new error_1.FirebaseError(`Failed to make request to ${fetchURL}`, { original: err });
|
|
241
|
+
}
|
|
242
|
+
finally {
|
|
243
|
+
if (reqTimeout) {
|
|
244
|
+
clearTimeout(reqTimeout);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (options.responseType === "json") {
|
|
248
|
+
const text = await res.text();
|
|
249
|
+
if (!text.length) {
|
|
250
|
+
body = undefined;
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
try {
|
|
254
|
+
body = JSON.parse(text);
|
|
255
|
+
}
|
|
256
|
+
catch (err) {
|
|
257
|
+
throw new error_1.FirebaseError(`Unable to parse JSON: ${err}`);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
else if (options.responseType === "stream") {
|
|
262
|
+
body = res.body;
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
throw new error_1.FirebaseError(`Unable to interpret response. Please set responseType.`, {
|
|
266
|
+
exit: 2,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch (err) {
|
|
271
|
+
return err instanceof error_1.FirebaseError ? reject(err) : reject(new error_1.FirebaseError(`${err}`));
|
|
272
|
+
}
|
|
273
|
+
this.logResponse(res, body, options);
|
|
274
|
+
if (res.status >= 400) {
|
|
275
|
+
if ((_a = options.retryCodes) === null || _a === void 0 ? void 0 : _a.includes(res.status)) {
|
|
276
|
+
const err = responseToError({ statusCode: res.status }, body) || undefined;
|
|
277
|
+
if (operation.retry(err)) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (!options.resolveOnHTTPError) {
|
|
282
|
+
return reject(responseToError({ statusCode: res.status }, body));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
resolve({
|
|
286
|
+
status: res.status,
|
|
287
|
+
response: res,
|
|
288
|
+
body,
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
});
|
|
249
292
|
}
|
|
250
293
|
logRequest(options) {
|
|
251
294
|
var _a, _b;
|
|
@@ -282,7 +325,7 @@ class Client {
|
|
|
282
325
|
}
|
|
283
326
|
exports.Client = Client;
|
|
284
327
|
function isLocalInsecureRequest(urlPrefix) {
|
|
285
|
-
const u = url_1.
|
|
328
|
+
const u = new url_1.URL(urlPrefix);
|
|
286
329
|
return u.protocol === "http:";
|
|
287
330
|
}
|
|
288
331
|
function bodyToString(body) {
|
|
@@ -83,7 +83,7 @@ class AppDistributionClient {
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
catch (err) {
|
|
86
|
-
throw new error_1.FirebaseError(`failed to update release notes with ${err.message}`, { exit: 1 });
|
|
86
|
+
throw new error_1.FirebaseError(`failed to update release notes with ${err === null || err === void 0 ? void 0 : err.message}`, { exit: 1 });
|
|
87
87
|
}
|
|
88
88
|
utils.logSuccess("added release notes successfully");
|
|
89
89
|
}
|
|
@@ -37,7 +37,7 @@ function splitter(value) {
|
|
|
37
37
|
.filter((entry) => !!entry);
|
|
38
38
|
}
|
|
39
39
|
async function getProjectName(options) {
|
|
40
|
-
const projectNumber = await projectUtils_1.needProjectNumber(options);
|
|
40
|
+
const projectNumber = await (0, projectUtils_1.needProjectNumber)(options);
|
|
41
41
|
return `projects/${projectNumber}`;
|
|
42
42
|
}
|
|
43
43
|
exports.getProjectName = getProjectName;
|
package/lib/archiveDirectory.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.archiveDirectory = void 0;
|
|
3
4
|
const archiver = require("archiver");
|
|
4
5
|
const filesize = require("filesize");
|
|
5
6
|
const fs = require("fs");
|
|
6
7
|
const path = require("path");
|
|
7
8
|
const tar = require("tar");
|
|
8
9
|
const tmp = require("tmp");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
10
|
+
const error_1 = require("./error");
|
|
11
|
+
const listFiles_1 = require("./listFiles");
|
|
12
|
+
const logger_1 = require("./logger");
|
|
11
13
|
const fsAsync = require("./fsAsync");
|
|
12
|
-
|
|
13
|
-
const utils = require("./utils");
|
|
14
|
-
const archiveDirectory = (sourceDirectory, options) => {
|
|
15
|
-
options = options || {};
|
|
14
|
+
async function archiveDirectory(sourceDirectory, options = {}) {
|
|
16
15
|
let postfix = ".tar.gz";
|
|
17
16
|
if (options.type === "zip") {
|
|
18
17
|
postfix = ".zip";
|
|
@@ -26,105 +25,96 @@ const archiveDirectory = (sourceDirectory, options) => {
|
|
|
26
25
|
}
|
|
27
26
|
let makeArchive;
|
|
28
27
|
if (options.type === "zip") {
|
|
29
|
-
makeArchive =
|
|
28
|
+
makeArchive = zipDirectory(sourceDirectory, tempFile, options);
|
|
30
29
|
}
|
|
31
30
|
else {
|
|
32
|
-
makeArchive =
|
|
31
|
+
makeArchive = tarDirectory(sourceDirectory, tempFile, options);
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
logger.debug(`Archived ${filesize(archive.size)} in ${sourceDirectory}.`);
|
|
33
|
+
try {
|
|
34
|
+
const archive = await makeArchive;
|
|
35
|
+
logger_1.logger.debug(`Archived ${filesize(archive.size)} in ${sourceDirectory}.`);
|
|
37
36
|
return archive;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (err instanceof FirebaseError) {
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
if (err instanceof error_1.FirebaseError) {
|
|
41
40
|
throw err;
|
|
42
41
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
const allFiles = listFiles(sourceDirectory, options.ignore);
|
|
42
|
+
throw new error_1.FirebaseError("Failed to create archive.", { original: err });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.archiveDirectory = archiveDirectory;
|
|
46
|
+
async function tarDirectory(sourceDirectory, tempFile, options) {
|
|
47
|
+
const allFiles = (0, listFiles_1.listFiles)(sourceDirectory, options.ignore);
|
|
50
48
|
try {
|
|
51
49
|
fs.statSync(sourceDirectory);
|
|
52
50
|
}
|
|
53
51
|
catch (err) {
|
|
54
52
|
if (err.code === "ENOENT") {
|
|
55
|
-
|
|
53
|
+
throw new error_1.FirebaseError(`Could not read directory "${sourceDirectory}"`);
|
|
56
54
|
}
|
|
57
55
|
throw err;
|
|
58
56
|
}
|
|
59
57
|
if (!allFiles.length) {
|
|
60
|
-
|
|
58
|
+
throw new error_1.FirebaseError(`Cannot create a tar archive with 0 files from directory "${sourceDirectory}"`);
|
|
61
59
|
}
|
|
62
|
-
|
|
63
|
-
.create({
|
|
60
|
+
await tar.create({
|
|
64
61
|
gzip: true,
|
|
65
62
|
file: tempFile.name,
|
|
66
63
|
cwd: sourceDirectory,
|
|
67
64
|
follow: true,
|
|
68
65
|
noDirRecurse: true,
|
|
69
66
|
portable: true,
|
|
70
|
-
}, allFiles)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
};
|
|
82
|
-
const _zipDirectory = (sourceDirectory, tempFile, options) => {
|
|
67
|
+
}, allFiles);
|
|
68
|
+
const stats = fs.statSync(tempFile.name);
|
|
69
|
+
return {
|
|
70
|
+
file: tempFile.name,
|
|
71
|
+
stream: fs.createReadStream(tempFile.name),
|
|
72
|
+
manifest: allFiles,
|
|
73
|
+
size: stats.size,
|
|
74
|
+
source: sourceDirectory,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async function zipDirectory(sourceDirectory, tempFile, options) {
|
|
83
78
|
const archiveFileStream = fs.createWriteStream(tempFile.name, {
|
|
84
79
|
flags: "w",
|
|
85
80
|
encoding: "binary",
|
|
86
81
|
});
|
|
87
82
|
const archive = archiver("zip");
|
|
88
|
-
const archiveDone =
|
|
83
|
+
const archiveDone = pipeAsync(archive, archiveFileStream);
|
|
89
84
|
const allFiles = [];
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.
|
|
85
|
+
let files;
|
|
86
|
+
try {
|
|
87
|
+
files = await fsAsync.readdirRecursive({ path: sourceDirectory, ignore: options.ignore });
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
93
90
|
if (err.code === "ENOENT") {
|
|
94
|
-
|
|
91
|
+
throw new error_1.FirebaseError(`Could not read directory "${sourceDirectory}"`, { original: err });
|
|
95
92
|
}
|
|
96
93
|
throw err;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
mode: file.mode,
|
|
105
|
-
});
|
|
94
|
+
}
|
|
95
|
+
for (const file of files) {
|
|
96
|
+
const name = path.relative(sourceDirectory, file.name);
|
|
97
|
+
allFiles.push(name);
|
|
98
|
+
archive.file(file.name, {
|
|
99
|
+
name,
|
|
100
|
+
mode: file.mode,
|
|
106
101
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const _pipeAsync = function (from, to) {
|
|
122
|
-
return new Promise(function (resolve, reject) {
|
|
102
|
+
}
|
|
103
|
+
void archive.finalize();
|
|
104
|
+
await archiveDone;
|
|
105
|
+
const stats = fs.statSync(tempFile.name);
|
|
106
|
+
return {
|
|
107
|
+
file: tempFile.name,
|
|
108
|
+
stream: fs.createReadStream(tempFile.name),
|
|
109
|
+
manifest: allFiles,
|
|
110
|
+
size: stats.size,
|
|
111
|
+
source: sourceDirectory,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
async function pipeAsync(from, to) {
|
|
115
|
+
return new Promise((resolve, reject) => {
|
|
123
116
|
to.on("finish", resolve);
|
|
124
117
|
to.on("error", reject);
|
|
125
118
|
from.pipe(to);
|
|
126
119
|
});
|
|
127
|
-
}
|
|
128
|
-
module.exports = {
|
|
129
|
-
archiveDirectory,
|
|
130
|
-
};
|
|
120
|
+
}
|
package/lib/auth.js
CHANGED
|
@@ -256,7 +256,7 @@ async function loginWithoutLocalhost(userHint) {
|
|
|
256
256
|
logger_1.logger.info(clc.bold.underline(authUrl));
|
|
257
257
|
logger_1.logger.info();
|
|
258
258
|
open(authUrl);
|
|
259
|
-
const code = await prompt_1.promptOnce({
|
|
259
|
+
const code = await (0, prompt_1.promptOnce)({
|
|
260
260
|
type: "input",
|
|
261
261
|
name: "code",
|
|
262
262
|
message: "Paste authorization code here:",
|
|
@@ -401,7 +401,7 @@ function logoutCurrentSession(refreshToken) {
|
|
|
401
401
|
if (!account) {
|
|
402
402
|
return;
|
|
403
403
|
}
|
|
404
|
-
defaultCredentials_1.clearCredentials(account);
|
|
404
|
+
(0, defaultCredentials_1.clearCredentials)(account);
|
|
405
405
|
deleteAccount(account);
|
|
406
406
|
}
|
|
407
407
|
async function refreshTokens(refreshToken, authScopes) {
|
package/lib/bin/firebase.js
CHANGED
|
@@ -15,7 +15,7 @@ if (!semver.satisfies(nodeVersion, pkg.engines.node)) {
|
|
|
15
15
|
const updateNotifier = require("update-notifier")({ pkg: pkg });
|
|
16
16
|
const clc = require("cli-color");
|
|
17
17
|
const TerminalRenderer = require("marked-terminal");
|
|
18
|
-
const marked = require("marked");
|
|
18
|
+
const marked = require("marked").marked;
|
|
19
19
|
marked.setOptions({
|
|
20
20
|
renderer: new TerminalRenderer(),
|
|
21
21
|
});
|
package/lib/command.js
CHANGED
|
@@ -25,7 +25,7 @@ class Command {
|
|
|
25
25
|
this.befores = [];
|
|
26
26
|
this.helpText = "";
|
|
27
27
|
this.positionalArgs = [];
|
|
28
|
-
this.name = lodash_1.first(cmd.split(" ")) || "";
|
|
28
|
+
this.name = (0, lodash_1.first)(cmd.split(" ")) || "";
|
|
29
29
|
}
|
|
30
30
|
description(t) {
|
|
31
31
|
this.descriptionText = t;
|
|
@@ -71,14 +71,14 @@ class Command {
|
|
|
71
71
|
cmd.action((...args) => {
|
|
72
72
|
const runner = this.runner();
|
|
73
73
|
const start = new Date().getTime();
|
|
74
|
-
const options = lodash_1.last(args);
|
|
74
|
+
const options = (0, lodash_1.last)(args);
|
|
75
75
|
if (args.length - 1 > cmd._args.length) {
|
|
76
|
-
client.errorOut(new error_1.FirebaseError(`Too many arguments. Run ${cli_color_1.bold("firebase help " + this.name)} for usage instructions`, { exit: 1 }));
|
|
76
|
+
client.errorOut(new error_1.FirebaseError(`Too many arguments. Run ${(0, cli_color_1.bold)("firebase help " + this.name)} for usage instructions`, { exit: 1 }));
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
runner(...args)
|
|
80
80
|
.then((result) => {
|
|
81
|
-
if (utils_1.getInheritedOption(options, "json")) {
|
|
81
|
+
if ((0, utils_1.getInheritedOption)(options, "json")) {
|
|
82
82
|
console.log(JSON.stringify({
|
|
83
83
|
status: "success",
|
|
84
84
|
result: result,
|
|
@@ -88,7 +88,7 @@ class Command {
|
|
|
88
88
|
track(this.name, "success", duration).then(() => process.exit());
|
|
89
89
|
})
|
|
90
90
|
.catch(async (err) => {
|
|
91
|
-
if (utils_1.getInheritedOption(options, "json")) {
|
|
91
|
+
if ((0, utils_1.getInheritedOption)(options, "json")) {
|
|
92
92
|
console.log(JSON.stringify({
|
|
93
93
|
status: "error",
|
|
94
94
|
error: err.message,
|
|
@@ -103,25 +103,25 @@ class Command {
|
|
|
103
103
|
}
|
|
104
104
|
async prepare(options) {
|
|
105
105
|
options = options || {};
|
|
106
|
-
options.project = utils_1.getInheritedOption(options, "project");
|
|
107
|
-
if (!process.stdin.isTTY || utils_1.getInheritedOption(options, "nonInteractive")) {
|
|
106
|
+
options.project = (0, utils_1.getInheritedOption)(options, "project");
|
|
107
|
+
if (!process.stdin.isTTY || (0, utils_1.getInheritedOption)(options, "nonInteractive")) {
|
|
108
108
|
options.nonInteractive = true;
|
|
109
109
|
}
|
|
110
|
-
if (utils_1.getInheritedOption(options, "interactive")) {
|
|
110
|
+
if ((0, utils_1.getInheritedOption)(options, "interactive")) {
|
|
111
111
|
options.interactive = true;
|
|
112
112
|
options.nonInteractive = false;
|
|
113
113
|
}
|
|
114
|
-
if (utils_1.getInheritedOption(options, "debug")) {
|
|
114
|
+
if ((0, utils_1.getInheritedOption)(options, "debug")) {
|
|
115
115
|
options.debug = true;
|
|
116
116
|
}
|
|
117
|
-
if (utils_1.getInheritedOption(options, "json")) {
|
|
117
|
+
if ((0, utils_1.getInheritedOption)(options, "json")) {
|
|
118
118
|
options.nonInteractive = true;
|
|
119
119
|
}
|
|
120
120
|
else {
|
|
121
|
-
utils_1.setupLoggers();
|
|
121
|
+
(0, utils_1.setupLoggers)();
|
|
122
122
|
}
|
|
123
|
-
if (utils_1.getInheritedOption(options, "config")) {
|
|
124
|
-
options.configPath = utils_1.getInheritedOption(options, "config");
|
|
123
|
+
if ((0, utils_1.getInheritedOption)(options, "config")) {
|
|
124
|
+
options.configPath = (0, utils_1.getInheritedOption)(options, "config");
|
|
125
125
|
}
|
|
126
126
|
try {
|
|
127
127
|
options.config = config_1.Config.load(options);
|
|
@@ -129,13 +129,13 @@ class Command {
|
|
|
129
129
|
catch (e) {
|
|
130
130
|
options.configError = e;
|
|
131
131
|
}
|
|
132
|
-
const account = utils_1.getInheritedOption(options, "account");
|
|
132
|
+
const account = (0, utils_1.getInheritedOption)(options, "account");
|
|
133
133
|
options.account = account;
|
|
134
|
-
options.projectRoot = detectProjectRoot_1.detectProjectRoot(options);
|
|
134
|
+
options.projectRoot = (0, detectProjectRoot_1.detectProjectRoot)(options);
|
|
135
135
|
const projectRoot = options.projectRoot;
|
|
136
|
-
const activeAccount = auth_1.selectAccount(account, projectRoot);
|
|
136
|
+
const activeAccount = (0, auth_1.selectAccount)(account, projectRoot);
|
|
137
137
|
if (activeAccount) {
|
|
138
|
-
auth_1.setActiveAccount(options, activeAccount);
|
|
138
|
+
(0, auth_1.setActiveAccount)(options, activeAccount);
|
|
139
139
|
}
|
|
140
140
|
this.applyRC(options);
|
|
141
141
|
if (options.project) {
|
|
@@ -144,7 +144,7 @@ class Command {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
applyRC(options) {
|
|
147
|
-
const rc = rc_1.loadRC(options);
|
|
147
|
+
const rc = (0, rc_1.loadRC)(options);
|
|
148
148
|
options.rc = rc;
|
|
149
149
|
options.project =
|
|
150
150
|
options.project || (configstore_1.configstore.get("activeProjects") || {})[options.projectRoot];
|
|
@@ -152,21 +152,21 @@ class Command {
|
|
|
152
152
|
options.project = options.config.defaults.project;
|
|
153
153
|
}
|
|
154
154
|
const aliases = rc.projects;
|
|
155
|
-
const rcProject = lodash_1.get(aliases, options.project);
|
|
155
|
+
const rcProject = (0, lodash_1.get)(aliases, options.project);
|
|
156
156
|
if (rcProject) {
|
|
157
157
|
options.projectAlias = options.project;
|
|
158
158
|
options.project = rcProject;
|
|
159
159
|
}
|
|
160
|
-
else if (!options.project && lodash_1.size(aliases) === 1) {
|
|
161
|
-
options.projectAlias = lodash_1.head(lodash_1.keys(aliases));
|
|
162
|
-
options.project = lodash_1.head(lodash_1.values(aliases));
|
|
160
|
+
else if (!options.project && (0, lodash_1.size)(aliases) === 1) {
|
|
161
|
+
options.projectAlias = (0, lodash_1.head)((0, lodash_1.keys)(aliases));
|
|
162
|
+
options.project = (0, lodash_1.head)((0, lodash_1.values)(aliases));
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
async resolveProjectIdentifiers(options) {
|
|
166
166
|
var _a;
|
|
167
167
|
if ((_a = options.project) === null || _a === void 0 ? void 0 : _a.match(/^\d+$/)) {
|
|
168
|
-
await requireAuth_1.requireAuth(options);
|
|
169
|
-
const { projectId, projectNumber } = await projects_1.getFirebaseProject(options.project);
|
|
168
|
+
await (0, requireAuth_1.requireAuth)(options);
|
|
169
|
+
const { projectId, projectNumber } = await (0, projects_1.getFirebaseProject)(options.project);
|
|
170
170
|
options.projectId = projectId;
|
|
171
171
|
options.projectNumber = projectNumber;
|
|
172
172
|
}
|
|
@@ -176,13 +176,13 @@ class Command {
|
|
|
176
176
|
}
|
|
177
177
|
runner() {
|
|
178
178
|
return async (...args) => {
|
|
179
|
-
if (typeof lodash_1.last(args) !== "object" || lodash_1.last(args) === null) {
|
|
179
|
+
if (typeof (0, lodash_1.last)(args) !== "object" || (0, lodash_1.last)(args) === null) {
|
|
180
180
|
args.push({});
|
|
181
181
|
}
|
|
182
182
|
while (args.length < this.positionalArgs.length + 1) {
|
|
183
183
|
args.splice(args.length - 1, 0, "");
|
|
184
184
|
}
|
|
185
|
-
const options = lodash_1.last(args);
|
|
185
|
+
const options = (0, lodash_1.last)(args);
|
|
186
186
|
await this.prepare(options);
|
|
187
187
|
for (const before of this.befores) {
|
|
188
188
|
await before.fn(options, ...before.args);
|
|
@@ -13,7 +13,7 @@ function getReleaseNotes(releaseNotes, releaseNotesFile) {
|
|
|
13
13
|
return releaseNotes.replace(/\\n/g, "\n");
|
|
14
14
|
}
|
|
15
15
|
else if (releaseNotesFile) {
|
|
16
|
-
options_parser_util_1.ensureFileExists(releaseNotesFile);
|
|
16
|
+
(0, options_parser_util_1.ensureFileExists)(releaseNotesFile);
|
|
17
17
|
return fs.readFileSync(releaseNotesFile, "utf8");
|
|
18
18
|
}
|
|
19
19
|
return "";
|
|
@@ -29,11 +29,11 @@ module.exports = new command_1.Command("appdistribution:distribute <release-bina
|
|
|
29
29
|
.option("--groups-file <file>", "path to file with a comma separated list of group aliases to distribute to")
|
|
30
30
|
.before(requireAuth_1.requireAuth)
|
|
31
31
|
.action(async (file, options) => {
|
|
32
|
-
const appName = options_parser_util_1.getAppName(options);
|
|
32
|
+
const appName = (0, options_parser_util_1.getAppName)(options);
|
|
33
33
|
const distribution = new distribution_1.Distribution(file);
|
|
34
34
|
const releaseNotes = getReleaseNotes(options.releaseNotes, options.releaseNotesFile);
|
|
35
|
-
const testers = options_parser_util_1.getTestersOrGroups(options.testers, options.testersFile);
|
|
36
|
-
const groups = options_parser_util_1.getTestersOrGroups(options.groups, options.groupsFile);
|
|
35
|
+
const testers = (0, options_parser_util_1.getTestersOrGroups)(options.testers, options.testersFile);
|
|
36
|
+
const groups = (0, options_parser_util_1.getTestersOrGroups)(options.groups, options.groupsFile);
|
|
37
37
|
const requests = new client_1.AppDistributionClient();
|
|
38
38
|
let aabInfo;
|
|
39
39
|
if (distribution.distributionFileType() === distribution_1.DistributionFileType.AAB) {
|
|
@@ -10,9 +10,9 @@ module.exports = new command_1.Command("appdistribution:testers:add [emails...]"
|
|
|
10
10
|
.option("--file <file>", "a path to a file containing a list of tester emails to be added")
|
|
11
11
|
.before(requireAuth_1.requireAuth)
|
|
12
12
|
.action(async (emails, options) => {
|
|
13
|
-
const projectName = await options_parser_util_1.getProjectName(options);
|
|
13
|
+
const projectName = await (0, options_parser_util_1.getProjectName)(options);
|
|
14
14
|
const appDistroClient = new client_1.AppDistributionClient();
|
|
15
|
-
const emailsToAdd = options_parser_util_1.getEmails(emails, options.file);
|
|
15
|
+
const emailsToAdd = (0, options_parser_util_1.getEmails)(emails, options.file);
|
|
16
16
|
utils.logBullet(`Adding ${emailsToAdd.length} testers to project`);
|
|
17
17
|
await appDistroClient.addTesters(projectName, emailsToAdd);
|
|
18
18
|
});
|