firebase-tools-with-isolate 12.9.1-1
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/LICENSE +21 -0
- package/README.md +48 -0
- package/lib/accountExporter.js +207 -0
- package/lib/accountImporter.js +305 -0
- package/lib/api.js +84 -0
- package/lib/apiv2.js +353 -0
- package/lib/appdistribution/client.js +193 -0
- package/lib/appdistribution/distribution.js +51 -0
- package/lib/appdistribution/options-parser-util.js +51 -0
- package/lib/archiveDirectory.js +120 -0
- package/lib/auth.js +535 -0
- package/lib/bin/firebase.js +132 -0
- package/lib/checkMinRequiredVersion.js +14 -0
- package/lib/checkValidTargetFilters.js +46 -0
- package/lib/command.js +250 -0
- package/lib/commands/appdistribution-distribute.js +121 -0
- package/lib/commands/appdistribution-group-create.js +19 -0
- package/lib/commands/appdistribution-group-delete.js +24 -0
- package/lib/commands/appdistribution-testers-add.js +24 -0
- package/lib/commands/appdistribution-testers-remove.js +40 -0
- package/lib/commands/apps-android-sha-create.js +29 -0
- package/lib/commands/apps-android-sha-delete.js +16 -0
- package/lib/commands/apps-android-sha-list.js +42 -0
- package/lib/commands/apps-create.js +166 -0
- package/lib/commands/apps-list.js +53 -0
- package/lib/commands/apps-sdkconfig.js +103 -0
- package/lib/commands/auth-export.js +44 -0
- package/lib/commands/auth-import.js +114 -0
- 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 +78 -0
- package/lib/commands/database-get.js +122 -0
- package/lib/commands/database-import.js +85 -0
- package/lib/commands/database-instances-create.js +29 -0
- package/lib/commands/database-instances-list.js +53 -0
- package/lib/commands/database-profile.js +46 -0
- package/lib/commands/database-push.js +63 -0
- package/lib/commands/database-remove.js +42 -0
- package/lib/commands/database-rules-canary.js +24 -0
- package/lib/commands/database-rules-get.js +22 -0
- package/lib/commands/database-rules-list.js +36 -0
- package/lib/commands/database-rules-release.js +24 -0
- package/lib/commands/database-rules-stage.js +26 -0
- package/lib/commands/database-set.js +68 -0
- package/lib/commands/database-settings-get.js +44 -0
- package/lib/commands/database-settings-set.js +46 -0
- package/lib/commands/database-update.js +69 -0
- package/lib/commands/deploy.js +101 -0
- package/lib/commands/emulators-exec.js +19 -0
- package/lib/commands/emulators-export.js +14 -0
- package/lib/commands/emulators-start.js +115 -0
- package/lib/commands/experimental-functions-shell.js +13 -0
- package/lib/commands/experiments-describe.js +31 -0
- package/lib/commands/experiments-disable.js +28 -0
- package/lib/commands/experiments-enable.js +28 -0
- package/lib/commands/experiments-list.js +29 -0
- package/lib/commands/ext-configure.js +110 -0
- package/lib/commands/ext-dev-deprecate.js +68 -0
- package/lib/commands/ext-dev-init.js +148 -0
- package/lib/commands/ext-dev-list.js +47 -0
- package/lib/commands/ext-dev-publish.js +32 -0
- package/lib/commands/ext-dev-register.js +50 -0
- package/lib/commands/ext-dev-undeprecate.js +57 -0
- package/lib/commands/ext-dev-upload.js +88 -0
- package/lib/commands/ext-dev-usage.js +141 -0
- package/lib/commands/ext-export.js +68 -0
- package/lib/commands/ext-info.js +118 -0
- package/lib/commands/ext-install.js +167 -0
- package/lib/commands/ext-list.js +18 -0
- package/lib/commands/ext-uninstall.js +29 -0
- package/lib/commands/ext-update.js +105 -0
- package/lib/commands/ext.js +41 -0
- package/lib/commands/firestore-databases-create.js +55 -0
- package/lib/commands/firestore-databases-delete.js +39 -0
- package/lib/commands/firestore-databases-get.js +25 -0
- package/lib/commands/firestore-databases-list.js +24 -0
- package/lib/commands/firestore-databases-update.js +59 -0
- package/lib/commands/firestore-delete.js +88 -0
- package/lib/commands/firestore-indexes-list.js +38 -0
- package/lib/commands/firestore-locations.js +24 -0
- package/lib/commands/frameworks-backends-create.js +14 -0
- package/lib/commands/frameworks-backends-delete.js +98 -0
- package/lib/commands/frameworks-backends-get.js +80 -0
- package/lib/commands/frameworks-backends-list.js +68 -0
- package/lib/commands/functions-config-clone.js +53 -0
- package/lib/commands/functions-config-export.js +118 -0
- package/lib/commands/functions-config-get.js +35 -0
- package/lib/commands/functions-config-set.js +43 -0
- package/lib/commands/functions-config-unset.js +42 -0
- package/lib/commands/functions-delete.js +95 -0
- package/lib/commands/functions-deletegcfartifacts.js +44 -0
- package/lib/commands/functions-list.js +47 -0
- package/lib/commands/functions-log.js +34 -0
- package/lib/commands/functions-secrets-access.js +22 -0
- package/lib/commands/functions-secrets-destroy.js +64 -0
- package/lib/commands/functions-secrets-get.js +28 -0
- package/lib/commands/functions-secrets-prune.js +57 -0
- package/lib/commands/functions-secrets-set.js +108 -0
- package/lib/commands/functions-shell.js +15 -0
- package/lib/commands/help.js +27 -0
- package/lib/commands/hosting-channel-create.js +78 -0
- package/lib/commands/hosting-channel-delete.js +47 -0
- package/lib/commands/hosting-channel-deploy.js +146 -0
- package/lib/commands/hosting-channel-list.js +40 -0
- package/lib/commands/hosting-channel-open.js +48 -0
- package/lib/commands/hosting-clone.js +103 -0
- package/lib/commands/hosting-disable.js +31 -0
- package/lib/commands/hosting-sites-create.js +34 -0
- package/lib/commands/hosting-sites-delete.js +39 -0
- package/lib/commands/hosting-sites-get.js +27 -0
- package/lib/commands/hosting-sites-list.js +28 -0
- package/lib/commands/index.js +191 -0
- package/lib/commands/init.js +195 -0
- package/lib/commands/internaltesting-frameworks-compose.js +22 -0
- package/lib/commands/internaltesting-functions-discover.js +25 -0
- package/lib/commands/login-add.js +32 -0
- package/lib/commands/login-ci.js +25 -0
- package/lib/commands/login-list.js +28 -0
- package/lib/commands/login-use.js +24 -0
- package/lib/commands/login.js +57 -0
- package/lib/commands/logout.js +76 -0
- package/lib/commands/open.js +100 -0
- package/lib/commands/projects-addfirebase.js +19 -0
- package/lib/commands/projects-create.js +37 -0
- package/lib/commands/projects-list.js +61 -0
- package/lib/commands/remoteconfig-get.js +68 -0
- package/lib/commands/remoteconfig-rollback.js +48 -0
- package/lib/commands/remoteconfig-versions-list.js +34 -0
- package/lib/commands/serve.js +60 -0
- package/lib/commands/setup-emulators-database.js +12 -0
- package/lib/commands/setup-emulators-firestore.js +12 -0
- package/lib/commands/setup-emulators-pubsub.js +12 -0
- package/lib/commands/setup-emulators-storage.js +12 -0
- package/lib/commands/setup-emulators-ui.js +12 -0
- package/lib/commands/target-apply.js +24 -0
- package/lib/commands/target-clear.js +20 -0
- package/lib/commands/target-remove.js +20 -0
- package/lib/commands/target.js +34 -0
- package/lib/commands/use.js +162 -0
- package/lib/config.js +227 -0
- package/lib/configstore.js +6 -0
- package/lib/crashlytics/buildToolsJarHelper.js +51 -0
- package/lib/database/api.js +19 -0
- package/lib/database/import.js +218 -0
- package/lib/database/listRemote.js +37 -0
- package/lib/database/metadata.js +67 -0
- package/lib/database/remove.js +88 -0
- package/lib/database/removeRemote.js +51 -0
- package/lib/database/rulesConfig.js +79 -0
- package/lib/database/settings.js +62 -0
- package/lib/defaultCredentials.js +80 -0
- package/lib/deploy/database/deploy.js +5 -0
- package/lib/deploy/database/index.js +9 -0
- package/lib/deploy/database/prepare.js +54 -0
- package/lib/deploy/database/release.js +30 -0
- package/lib/deploy/extensions/args.js +2 -0
- package/lib/deploy/extensions/deploy.js +49 -0
- package/lib/deploy/extensions/deploymentSummary.js +56 -0
- package/lib/deploy/extensions/errors.js +31 -0
- package/lib/deploy/extensions/index.js +9 -0
- package/lib/deploy/extensions/planner.js +157 -0
- package/lib/deploy/extensions/prepare.js +110 -0
- package/lib/deploy/extensions/release.js +57 -0
- package/lib/deploy/extensions/secrets.js +150 -0
- package/lib/deploy/extensions/tasks.js +156 -0
- package/lib/deploy/extensions/v2FunctionHelper.js +53 -0
- package/lib/deploy/extensions/validate.js +17 -0
- package/lib/deploy/firestore/deploy.js +44 -0
- package/lib/deploy/firestore/index.js +9 -0
- package/lib/deploy/firestore/prepare.js +59 -0
- package/lib/deploy/firestore/release.js +22 -0
- package/lib/deploy/functions/args.js +2 -0
- package/lib/deploy/functions/backend.js +316 -0
- package/lib/deploy/functions/build.js +311 -0
- package/lib/deploy/functions/cache/applyHash.js +22 -0
- package/lib/deploy/functions/cache/hash.js +30 -0
- package/lib/deploy/functions/cel.js +365 -0
- package/lib/deploy/functions/checkIam.js +183 -0
- package/lib/deploy/functions/containerCleaner.js +305 -0
- package/lib/deploy/functions/deploy.js +108 -0
- package/lib/deploy/functions/ensure.js +105 -0
- package/lib/deploy/functions/ensureCloudBuildEnabled.js +1 -0
- package/lib/deploy/functions/functionsDeployHelper.js +134 -0
- package/lib/deploy/functions/index.js +9 -0
- package/lib/deploy/functions/params.js +517 -0
- package/lib/deploy/functions/prepare.js +304 -0
- package/lib/deploy/functions/prepareFunctionsUpload.js +113 -0
- package/lib/deploy/functions/pricing.js +171 -0
- package/lib/deploy/functions/prompts.js +157 -0
- package/lib/deploy/functions/release/executor.js +51 -0
- package/lib/deploy/functions/release/fabricator.js +584 -0
- package/lib/deploy/functions/release/index.js +93 -0
- package/lib/deploy/functions/release/planner.js +205 -0
- package/lib/deploy/functions/release/reporter.js +196 -0
- package/lib/deploy/functions/release/sourceTokenScraper.js +67 -0
- package/lib/deploy/functions/release/timer.js +14 -0
- package/lib/deploy/functions/runtimes/discovery/index.js +85 -0
- package/lib/deploy/functions/runtimes/discovery/mockDiscoveryServer.js +14 -0
- package/lib/deploy/functions/runtimes/discovery/parsing.js +95 -0
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +296 -0
- package/lib/deploy/functions/runtimes/index.js +59 -0
- package/lib/deploy/functions/runtimes/node/extractTriggers.js +23 -0
- package/lib/deploy/functions/runtimes/node/index.js +173 -0
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +57 -0
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +332 -0
- package/lib/deploy/functions/runtimes/node/triggerParser.js +72 -0
- package/lib/deploy/functions/runtimes/node/validate.js +34 -0
- package/lib/deploy/functions/runtimes/node/versioning.js +95 -0
- package/lib/deploy/functions/runtimes/python/index.js +154 -0
- package/lib/deploy/functions/services/auth.js +95 -0
- package/lib/deploy/functions/services/database.js +14 -0
- package/lib/deploy/functions/services/firebaseAlerts.js +14 -0
- package/lib/deploy/functions/services/firestore.js +17 -0
- package/lib/deploy/functions/services/index.js +117 -0
- package/lib/deploy/functions/services/remoteConfig.js +14 -0
- package/lib/deploy/functions/services/storage.js +44 -0
- package/lib/deploy/functions/services/testLab.js +14 -0
- package/lib/deploy/functions/triggerRegionHelper.js +16 -0
- package/lib/deploy/functions/validate.js +198 -0
- package/lib/deploy/hosting/args.js +2 -0
- package/lib/deploy/hosting/context.js +2 -0
- package/lib/deploy/hosting/convertConfig.js +181 -0
- package/lib/deploy/hosting/deploy.js +85 -0
- package/lib/deploy/hosting/hashcache.js +48 -0
- package/lib/deploy/hosting/index.js +9 -0
- package/lib/deploy/hosting/prepare.js +162 -0
- package/lib/deploy/hosting/release.js +40 -0
- package/lib/deploy/hosting/uploader.js +207 -0
- package/lib/deploy/index.js +127 -0
- package/lib/deploy/lifecycleHooks.js +151 -0
- package/lib/deploy/remoteconfig/deploy.js +4 -0
- package/lib/deploy/remoteconfig/functions.js +69 -0
- package/lib/deploy/remoteconfig/index.js +9 -0
- package/lib/deploy/remoteconfig/prepare.js +23 -0
- package/lib/deploy/remoteconfig/release.js +14 -0
- package/lib/deploy/storage/deploy.js +12 -0
- package/lib/deploy/storage/index.js +9 -0
- package/lib/deploy/storage/prepare.js +52 -0
- package/lib/deploy/storage/release.js +27 -0
- package/lib/deploymentTool.js +22 -0
- package/lib/detectProjectRoot.js +28 -0
- package/lib/downloadUtils.js +37 -0
- package/lib/dynamicImport.js +22 -0
- package/lib/emulator/ExpressBasedEmulator.js +92 -0
- package/lib/emulator/adminSdkConfig.js +65 -0
- package/lib/emulator/auth/apiSpec.js +8138 -0
- package/lib/emulator/auth/cloudFunctions.js +70 -0
- package/lib/emulator/auth/errors.js +77 -0
- package/lib/emulator/auth/handlers.js +281 -0
- package/lib/emulator/auth/index.js +146 -0
- package/lib/emulator/auth/operations.js +2145 -0
- package/lib/emulator/auth/schema.js +2 -0
- package/lib/emulator/auth/server.js +474 -0
- package/lib/emulator/auth/state.js +668 -0
- package/lib/emulator/auth/types.js +2 -0
- package/lib/emulator/auth/utils.js +84 -0
- package/lib/emulator/auth/widget_ui.js +620 -0
- package/lib/emulator/commandUtils.js +380 -0
- package/lib/emulator/constants.js +111 -0
- package/lib/emulator/controller.js +654 -0
- package/lib/emulator/databaseEmulator.js +172 -0
- package/lib/emulator/dns.js +49 -0
- package/lib/emulator/download.js +88 -0
- package/lib/emulator/downloadableEmulators.js +384 -0
- package/lib/emulator/emulatorLogger.js +237 -0
- package/lib/emulator/env.js +37 -0
- package/lib/emulator/eventarcEmulator.js +143 -0
- package/lib/emulator/eventarcEmulatorUtils.js +62 -0
- package/lib/emulator/events/types.js +28 -0
- package/lib/emulator/extensions/postinstall.js +41 -0
- package/lib/emulator/extensions/validation.js +72 -0
- package/lib/emulator/extensionsEmulator.js +254 -0
- package/lib/emulator/firestoreEmulator.js +96 -0
- package/lib/emulator/functionsEmulator.js +1038 -0
- package/lib/emulator/functionsEmulatorRuntime.js +730 -0
- package/lib/emulator/functionsEmulatorShared.js +322 -0
- package/lib/emulator/functionsEmulatorShell.js +88 -0
- package/lib/emulator/functionsEmulatorUtils.js +91 -0
- package/lib/emulator/functionsRuntimeWorker.js +314 -0
- package/lib/emulator/hostingEmulator.js +40 -0
- package/lib/emulator/hub.js +162 -0
- package/lib/emulator/hubClient.js +53 -0
- package/lib/emulator/hubExport.js +208 -0
- package/lib/emulator/loggingEmulator.js +118 -0
- package/lib/emulator/portUtils.js +323 -0
- package/lib/emulator/pubsubEmulator.js +186 -0
- package/lib/emulator/registry.js +122 -0
- package/lib/emulator/shared/request.js +19 -0
- package/lib/emulator/storage/apis/firebase.js +500 -0
- package/lib/emulator/storage/apis/gcloud.js +405 -0
- package/lib/emulator/storage/apis/shared.js +44 -0
- package/lib/emulator/storage/cloudFunctions.js +88 -0
- package/lib/emulator/storage/crc.js +33 -0
- package/lib/emulator/storage/errors.js +9 -0
- package/lib/emulator/storage/files.js +410 -0
- package/lib/emulator/storage/index.js +98 -0
- package/lib/emulator/storage/metadata.js +349 -0
- package/lib/emulator/storage/multipart.js +63 -0
- package/lib/emulator/storage/persistence.js +92 -0
- package/lib/emulator/storage/rules/config.js +53 -0
- package/lib/emulator/storage/rules/expressionValue.js +2 -0
- package/lib/emulator/storage/rules/manager.js +88 -0
- package/lib/emulator/storage/rules/runtime.js +363 -0
- package/lib/emulator/storage/rules/types.js +19 -0
- package/lib/emulator/storage/rules/utils.js +60 -0
- package/lib/emulator/storage/server.js +113 -0
- package/lib/emulator/storage/upload.js +143 -0
- package/lib/emulator/types.js +200 -0
- package/lib/emulator/ui.js +52 -0
- package/lib/emulator/workQueue.js +114 -0
- package/lib/ensureApiEnabled.js +110 -0
- package/lib/ensureCloudResourceLocation.js +12 -0
- package/lib/error.js +29 -0
- package/lib/errorOut.js +23 -0
- package/lib/experiments.js +153 -0
- package/lib/extensions/askUserForEventsConfig.js +97 -0
- package/lib/extensions/askUserForParam.js +338 -0
- package/lib/extensions/billingMigrationHelper.js +61 -0
- package/lib/extensions/change-log.js +95 -0
- package/lib/extensions/checkProjectBilling.js +82 -0
- package/lib/extensions/diagnose.js +56 -0
- package/lib/extensions/displayExtensionInfo.js +175 -0
- package/lib/extensions/emulator/optionsHelper.js +73 -0
- package/lib/extensions/emulator/specHelper.js +102 -0
- package/lib/extensions/emulator/triggerHelper.js +105 -0
- package/lib/extensions/etags.js +28 -0
- package/lib/extensions/export.js +64 -0
- package/lib/extensions/extensionsApi.js +361 -0
- package/lib/extensions/extensionsHelper.js +862 -0
- package/lib/extensions/listExtensions.js +53 -0
- package/lib/extensions/localHelper.js +67 -0
- package/lib/extensions/manifest.js +205 -0
- package/lib/extensions/metricsTypeDef.js +2 -0
- package/lib/extensions/metricsUtils.js +98 -0
- package/lib/extensions/paramHelper.js +140 -0
- package/lib/extensions/provisioningHelper.js +109 -0
- package/lib/extensions/publishHelpers.js +8 -0
- package/lib/extensions/publisherApi.js +214 -0
- package/lib/extensions/refs.js +67 -0
- package/lib/extensions/resolveSource.js +24 -0
- package/lib/extensions/secretsUtils.js +60 -0
- package/lib/extensions/tos.js +90 -0
- package/lib/extensions/types.js +25 -0
- package/lib/extensions/updateHelper.js +127 -0
- package/lib/extensions/utils.js +63 -0
- package/lib/extensions/versionHelper.js +14 -0
- package/lib/extensions/warnings.js +44 -0
- package/lib/fetchMOTD.js +46 -0
- package/lib/fetchWebSetup.js +75 -0
- package/lib/filterTargets.js +34 -0
- package/lib/firebaseConfig.js +2 -0
- package/lib/firebaseConfigValidate.js +29 -0
- package/lib/firestore/api-sort.js +118 -0
- package/lib/firestore/api-spec.js +2 -0
- package/lib/firestore/api-types.js +60 -0
- package/lib/firestore/api.js +566 -0
- package/lib/firestore/checkDatabaseType.js +18 -0
- package/lib/firestore/delete.js +347 -0
- package/lib/firestore/encodeFirestoreValue.js +59 -0
- package/lib/firestore/fsConfig.js +74 -0
- package/lib/firestore/options.js +2 -0
- package/lib/firestore/util.js +39 -0
- package/lib/firestore/validator.js +38 -0
- package/lib/frameworks/angular/index.js +193 -0
- package/lib/frameworks/angular/interfaces.js +2 -0
- package/lib/frameworks/angular/utils.js +431 -0
- package/lib/frameworks/astro/index.js +73 -0
- package/lib/frameworks/astro/utils.js +40 -0
- package/lib/frameworks/compose/discover/filesystem.js +52 -0
- package/lib/frameworks/compose/discover/frameworkMatcher.js +76 -0
- package/lib/frameworks/compose/discover/frameworkSpec.js +39 -0
- package/lib/frameworks/compose/discover/index.js +32 -0
- package/lib/frameworks/compose/discover/runtime/node.js +149 -0
- package/lib/frameworks/compose/discover/types.js +2 -0
- package/lib/frameworks/compose/driver/docker.js +187 -0
- package/lib/frameworks/compose/driver/hooks.js +22 -0
- package/lib/frameworks/compose/driver/index.js +16 -0
- package/lib/frameworks/compose/driver/local.js +51 -0
- package/lib/frameworks/compose/index.js +31 -0
- package/lib/frameworks/compose/interfaces.js +21 -0
- package/lib/frameworks/constants.js +40 -0
- package/lib/frameworks/docs/index.js +2 -0
- package/lib/frameworks/express/index.js +102 -0
- package/lib/frameworks/flutter/constants.js +72 -0
- package/lib/frameworks/flutter/index.js +58 -0
- package/lib/frameworks/flutter/utils.js +11 -0
- package/lib/frameworks/frameworks.js +31 -0
- package/lib/frameworks/index.js +421 -0
- package/lib/frameworks/interfaces.js +2 -0
- package/lib/frameworks/lit/index.js +23 -0
- package/lib/frameworks/next/constants.js +12 -0
- package/lib/frameworks/next/index.js +403 -0
- package/lib/frameworks/next/interfaces.js +2 -0
- package/lib/frameworks/next/utils.js +197 -0
- package/lib/frameworks/nuxt/index.js +92 -0
- package/lib/frameworks/nuxt/interfaces.js +2 -0
- package/lib/frameworks/nuxt/utils.js +23 -0
- package/lib/frameworks/nuxt2/index.js +79 -0
- package/lib/frameworks/preact/index.js +23 -0
- package/lib/frameworks/react/index.js +23 -0
- package/lib/frameworks/svelte/index.js +23 -0
- package/lib/frameworks/sveltekit/index.js +54 -0
- package/lib/frameworks/sveltekit/interfaces.js +2 -0
- package/lib/frameworks/utils.js +260 -0
- package/lib/frameworks/vite/index.js +99 -0
- package/lib/fsAsync.js +43 -0
- package/lib/fsutils.js +35 -0
- package/lib/functional.js +87 -0
- package/lib/functions/constants.js +14 -0
- package/lib/functions/ensureTargeted.js +21 -0
- package/lib/functions/env.js +246 -0
- package/lib/functions/events/index.js +7 -0
- package/lib/functions/events/v1.js +6 -0
- package/lib/functions/events/v2.js +25 -0
- package/lib/functions/functionslog.js +35 -0
- package/lib/functions/projectConfig.js +68 -0
- package/lib/functions/python.js +23 -0
- package/lib/functions/runtimeConfigExport.js +141 -0
- package/lib/functions/secrets.js +239 -0
- package/lib/functionsConfig.js +157 -0
- package/lib/functionsConfigClone.js +68 -0
- package/lib/functionsShellCommandAction.js +112 -0
- package/lib/gcp/artifactregistry.js +16 -0
- package/lib/gcp/auth.js +16 -0
- package/lib/gcp/cloudbilling.js +25 -0
- package/lib/gcp/cloudbuild.js +50 -0
- package/lib/gcp/cloudfunctions.js +351 -0
- package/lib/gcp/cloudfunctionsv2.js +389 -0
- package/lib/gcp/cloudlogging.js +25 -0
- package/lib/gcp/cloudmonitoring.js +77 -0
- package/lib/gcp/cloudscheduler.js +155 -0
- package/lib/gcp/cloudtasks.js +162 -0
- package/lib/gcp/docker.js +80 -0
- package/lib/gcp/eventarc.js +42 -0
- package/lib/gcp/firestore.js +47 -0
- package/lib/gcp/frameworks.js +40 -0
- package/lib/gcp/iam.js +76 -0
- package/lib/gcp/identityPlatform.js +44 -0
- package/lib/gcp/index.js +11 -0
- package/lib/gcp/location.js +44 -0
- package/lib/gcp/proto.js +130 -0
- package/lib/gcp/pubsub.js +34 -0
- package/lib/gcp/resourceManager.js +74 -0
- package/lib/gcp/rules.js +156 -0
- package/lib/gcp/run.js +157 -0
- package/lib/gcp/runtimeconfig.js +127 -0
- package/lib/gcp/secretManager.js +207 -0
- package/lib/gcp/serviceusage.js +24 -0
- package/lib/gcp/storage.js +111 -0
- package/lib/getDefaultDatabaseInstance.js +10 -0
- package/lib/getDefaultHostingSite.js +32 -0
- package/lib/getProjectNumber.js +15 -0
- package/lib/handlePreviewToggles.js +38 -0
- package/lib/hosting/api.js +289 -0
- package/lib/hosting/cloudRunProxy.js +52 -0
- package/lib/hosting/config.js +189 -0
- package/lib/hosting/expireUtils.js +33 -0
- package/lib/hosting/functionsProxy.js +42 -0
- package/lib/hosting/implicitInit.js +58 -0
- package/lib/hosting/initMiddleware.js +63 -0
- package/lib/hosting/interactive.js +75 -0
- package/lib/hosting/options.js +3 -0
- package/lib/hosting/proxy.js +143 -0
- package/lib/hosting/runTags.js +114 -0
- package/lib/index.js +71 -0
- package/lib/init/features/account.js +62 -0
- package/lib/init/features/database.js +133 -0
- package/lib/init/features/emulators.js +102 -0
- package/lib/init/features/extensions/index.js +16 -0
- package/lib/init/features/firestore/index.js +36 -0
- package/lib/init/features/firestore/indexes.js +71 -0
- package/lib/init/features/firestore/rules.js +80 -0
- package/lib/init/features/frameworks/constants.js +7 -0
- package/lib/init/features/frameworks/index.js +116 -0
- package/lib/init/features/frameworks/repo.js +125 -0
- package/lib/init/features/functions/index.js +165 -0
- package/lib/init/features/functions/javascript.js +46 -0
- package/lib/init/features/functions/npm-dependencies.js +37 -0
- package/lib/init/features/functions/python.js +48 -0
- package/lib/init/features/functions/typescript.js +61 -0
- package/lib/init/features/hosting/github.js +397 -0
- package/lib/init/features/hosting/index.js +183 -0
- package/lib/init/features/index.js +27 -0
- package/lib/init/features/project.js +101 -0
- package/lib/init/features/remoteconfig.js +32 -0
- package/lib/init/features/storage.js +27 -0
- package/lib/init/index.js +45 -0
- package/lib/listFiles.js +15 -0
- package/lib/loadCJSON.js +17 -0
- package/lib/localFunction.js +222 -0
- package/lib/logError.js +29 -0
- package/lib/logger.js +31 -0
- package/lib/management/apps.js +280 -0
- package/lib/management/database.js +184 -0
- package/lib/management/projects.js +312 -0
- package/lib/metaprogramming.js +2 -0
- package/lib/monospace/index.js +82 -0
- package/lib/monospace/interfaces.js +2 -0
- package/lib/operation-poller.js +59 -0
- package/lib/options.js +2 -0
- package/lib/parseBoltRules.js +29 -0
- package/lib/profileReport.js +577 -0
- package/lib/profiler.js +99 -0
- package/lib/projectPath.js +16 -0
- package/lib/projectUtils.js +59 -0
- package/lib/prompt.js +50 -0
- package/lib/rc.js +165 -0
- package/lib/remoteconfig/get.js +49 -0
- package/lib/remoteconfig/interfaces.js +17 -0
- package/lib/remoteconfig/rollback.js +22 -0
- package/lib/remoteconfig/versionslist.js +33 -0
- package/lib/requireAuth.js +81 -0
- package/lib/requireConfig.js +13 -0
- package/lib/requireDatabaseInstance.js +26 -0
- package/lib/requireHostingSite.js +12 -0
- package/lib/requireInteractive.js +12 -0
- package/lib/requirePermissions.js +30 -0
- package/lib/responseToError.js +58 -0
- package/lib/rtdb.js +35 -0
- package/lib/rulesDeploy.js +180 -0
- package/lib/scopes.js +10 -0
- package/lib/serve/functions.js +64 -0
- package/lib/serve/hosting.js +115 -0
- package/lib/serve/index.js +53 -0
- package/lib/shortenUrl.js +29 -0
- package/lib/throttler/errors/retries-exhausted-error.js +11 -0
- package/lib/throttler/errors/task-error.js +9 -0
- package/lib/throttler/errors/timeout-error.js +9 -0
- package/lib/throttler/queue.js +23 -0
- package/lib/throttler/stack.js +28 -0
- package/lib/throttler/throttler.js +230 -0
- package/lib/track.js +196 -0
- package/lib/unzip.js +126 -0
- package/lib/utils.js +488 -0
- package/package.json +239 -0
- package/schema/extension-yaml.json +432 -0
- package/schema/firebase-config.json +2619 -0
- package/standalone/check.js +6 -0
- package/standalone/config.template.js +19 -0
- package/standalone/firepit.js +1074 -0
- package/standalone/package-lock.json +7019 -0
- package/standalone/package.json +36 -0
- package/standalone/runtime.js +122 -0
- package/standalone/welcome.js +178 -0
- package/templates/_gitignore +66 -0
- package/templates/banner.txt +6 -0
- package/templates/emulators/default_storage.rules +8 -0
- package/templates/extensions/CL-template.md +2 -0
- package/templates/extensions/POSTINSTALL.md +29 -0
- package/templates/extensions/PREINSTALL.md +22 -0
- package/templates/extensions/extension.yaml +61 -0
- package/templates/extensions/integration-test.env +2 -0
- package/templates/extensions/integration-test.json +14 -0
- package/templates/extensions/javascript/WELCOME.md +18 -0
- package/templates/extensions/javascript/_gitignore +1 -0
- package/templates/extensions/javascript/index.js +25 -0
- package/templates/extensions/javascript/integration-test.js +13 -0
- package/templates/extensions/javascript/package.lint.json +25 -0
- package/templates/extensions/javascript/package.nolint.json +19 -0
- package/templates/extensions/typescript/WELCOME.md +22 -0
- package/templates/extensions/typescript/_gitignore +8 -0
- package/templates/extensions/typescript/_mocharc +10 -0
- package/templates/extensions/typescript/index.ts +26 -0
- package/templates/extensions/typescript/integration-test.ts +13 -0
- package/templates/extensions/typescript/package.lint.json +31 -0
- package/templates/extensions/typescript/package.nolint.json +24 -0
- package/templates/extensions/typescript/tsconfig.dev.json +5 -0
- package/templates/extensions/typescript/tsconfig.json +15 -0
- package/templates/firebase.json +9 -0
- package/templates/hosting/init.js +36 -0
- package/templates/init/firestore/firestore.indexes.json +26 -0
- package/templates/init/firestore/firestore.rules +16 -0
- package/templates/init/functions/javascript/_eslintrc +28 -0
- package/templates/init/functions/javascript/_gitignore +1 -0
- package/templates/init/functions/javascript/index.js +19 -0
- package/templates/init/functions/javascript/package.lint.json +26 -0
- package/templates/init/functions/javascript/package.nolint.json +23 -0
- package/templates/init/functions/python/_gitignore +0 -0
- package/templates/init/functions/python/main.py +13 -0
- package/templates/init/functions/python/requirements.txt +1 -0
- package/templates/init/functions/typescript/_eslintrc +32 -0
- package/templates/init/functions/typescript/_gitignore +9 -0
- package/templates/init/functions/typescript/index.ts +19 -0
- package/templates/init/functions/typescript/package.lint.json +31 -0
- package/templates/init/functions/typescript/package.nolint.json +25 -0
- package/templates/init/functions/typescript/tsconfig.dev.json +5 -0
- package/templates/init/functions/typescript/tsconfig.json +15 -0
- package/templates/init/hosting/404.html +33 -0
- package/templates/init/hosting/index.html +89 -0
- package/templates/init/storage/storage.rules +12 -0
- package/templates/loginFailure.html +34 -0
- package/templates/loginSuccess.html +32 -0
- package/templates/loginSuccessGithub.html +32 -0
- package/templates/setup/web.js +5 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const command_1 = require("../command");
|
|
5
|
+
const utils = require("../utils");
|
|
6
|
+
const requireAuth_1 = require("../requireAuth");
|
|
7
|
+
const error_1 = require("../error");
|
|
8
|
+
const client_1 = require("../appdistribution/client");
|
|
9
|
+
const options_parser_util_1 = require("../appdistribution/options-parser-util");
|
|
10
|
+
const logger_1 = require("../logger");
|
|
11
|
+
exports.command = new command_1.Command("appdistribution:testers:remove [emails...]")
|
|
12
|
+
.description("remove testers from a project (or group)")
|
|
13
|
+
.option("--file <file>", "a path to a file containing a list of tester emails to be removed")
|
|
14
|
+
.option("--group-alias <group-alias>", "if specified, the testers are only removed from the group identified by this alias, but not the project")
|
|
15
|
+
.before(requireAuth_1.requireAuth)
|
|
16
|
+
.action(async (emails, options) => {
|
|
17
|
+
const projectName = await (0, options_parser_util_1.getProjectName)(options);
|
|
18
|
+
const appDistroClient = new client_1.AppDistributionClient();
|
|
19
|
+
const emailsArr = (0, options_parser_util_1.getEmails)(emails, options.file);
|
|
20
|
+
if (options.groupAlias) {
|
|
21
|
+
utils.logBullet(`Removing ${emailsArr.length} testers from group`);
|
|
22
|
+
await appDistroClient.removeTestersFromGroup(`${projectName}/groups/${options.groupAlias}`, emailsArr);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
let deleteResponse;
|
|
26
|
+
try {
|
|
27
|
+
utils.logBullet(`Deleting ${emailsArr.length} testers from project`);
|
|
28
|
+
deleteResponse = await appDistroClient.removeTesters(projectName, emailsArr);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
throw new error_1.FirebaseError(`Failed to remove testers ${err}`);
|
|
32
|
+
}
|
|
33
|
+
if (!deleteResponse.emails) {
|
|
34
|
+
utils.logSuccess(`Testers did not exist`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
logger_1.logger.debug(`Testers: ${deleteResponse.emails}, have been successfully deleted`);
|
|
38
|
+
utils.logSuccess(`${deleteResponse.emails.length} testers have successfully been deleted`);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const projectUtils_1 = require("../projectUtils");
|
|
7
|
+
const apps_1 = require("../management/apps");
|
|
8
|
+
const requireAuth_1 = require("../requireAuth");
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
function getCertHashType(shaHash) {
|
|
11
|
+
shaHash = shaHash.replace(/:/g, "");
|
|
12
|
+
const shaHashCount = shaHash.length;
|
|
13
|
+
if (shaHashCount === 40)
|
|
14
|
+
return apps_1.ShaCertificateType.SHA_1.toString();
|
|
15
|
+
if (shaHashCount === 64)
|
|
16
|
+
return apps_1.ShaCertificateType.SHA_256.toString();
|
|
17
|
+
return apps_1.ShaCertificateType.SHA_CERTIFICATE_TYPE_UNSPECIFIED.toString();
|
|
18
|
+
}
|
|
19
|
+
exports.command = new command_1.Command("apps:android:sha:create <appId> <shaHash>")
|
|
20
|
+
.description("add a SHA certificate hash for a given app id.")
|
|
21
|
+
.before(requireAuth_1.requireAuth)
|
|
22
|
+
.action(async (appId = "", shaHash = "", options) => {
|
|
23
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
24
|
+
const shaCertificate = await (0, utils_1.promiseWithSpinner)(async () => await (0, apps_1.createAppAndroidSha)(projectId, appId, {
|
|
25
|
+
shaHash: shaHash,
|
|
26
|
+
certType: getCertHashType(shaHash),
|
|
27
|
+
}), `Creating Android SHA certificate ${clc.bold(options.shaHash)}with Android app Id ${clc.bold(appId)}`);
|
|
28
|
+
return shaCertificate;
|
|
29
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const projectUtils_1 = require("../projectUtils");
|
|
7
|
+
const apps_1 = require("../management/apps");
|
|
8
|
+
const requireAuth_1 = require("../requireAuth");
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
exports.command = new command_1.Command("apps:android:sha:delete <appId> <shaId>")
|
|
11
|
+
.description("delete a SHA certificate hash for a given app id.")
|
|
12
|
+
.before(requireAuth_1.requireAuth)
|
|
13
|
+
.action(async (appId = "", shaId = "", options) => {
|
|
14
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
15
|
+
await (0, utils_1.promiseWithSpinner)(async () => await (0, apps_1.deleteAppAndroidSha)(projectId, appId, shaId), `Deleting Android SHA certificate hash with SHA id ${clc.bold(shaId)} and Android app Id ${clc.bold(appId)}`);
|
|
16
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const Table = require("cli-table");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const projectUtils_1 = require("../projectUtils");
|
|
7
|
+
const apps_1 = require("../management/apps");
|
|
8
|
+
const requireAuth_1 = require("../requireAuth");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
function logCertificatesList(certificates) {
|
|
12
|
+
if (certificates.length === 0) {
|
|
13
|
+
logger_1.logger.info("No SHA certificate hashes found.");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const tableHead = ["App Id", "SHA Id", "SHA Hash", "SHA Hash Type"];
|
|
17
|
+
const table = new Table({ head: tableHead, style: { head: ["green"] } });
|
|
18
|
+
certificates.forEach(({ name, shaHash, certType }) => {
|
|
19
|
+
const splitted = name.split("/");
|
|
20
|
+
const appId = splitted[3];
|
|
21
|
+
const shaId = splitted[5];
|
|
22
|
+
table.push([appId, shaId, shaHash, certType]);
|
|
23
|
+
});
|
|
24
|
+
logger_1.logger.info(table.toString());
|
|
25
|
+
}
|
|
26
|
+
function logCertificatesCount(count = 0) {
|
|
27
|
+
if (count === 0) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
logger_1.logger.info("");
|
|
31
|
+
logger_1.logger.info(`${count} SHA hash(es) total.`);
|
|
32
|
+
}
|
|
33
|
+
exports.command = new command_1.Command("apps:android:sha:list <appId>")
|
|
34
|
+
.description("list the SHA certificate hashes for a given app id. ")
|
|
35
|
+
.before(requireAuth_1.requireAuth)
|
|
36
|
+
.action(async (appId = "", options) => {
|
|
37
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
38
|
+
const shaCertificates = await (0, utils_1.promiseWithSpinner)(async () => await (0, apps_1.listAppAndroidSha)(projectId, appId), "Preparing the list of your Firebase Android app SHA certificate hashes");
|
|
39
|
+
logCertificatesList(shaCertificates);
|
|
40
|
+
logCertificatesCount(shaCertificates.length);
|
|
41
|
+
return shaCertificates;
|
|
42
|
+
});
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const ora = require("ora");
|
|
6
|
+
const command_1 = require("../command");
|
|
7
|
+
const projectUtils_1 = require("../projectUtils");
|
|
8
|
+
const error_1 = require("../error");
|
|
9
|
+
const apps_1 = require("../management/apps");
|
|
10
|
+
const prompt_1 = require("../prompt");
|
|
11
|
+
const requireAuth_1 = require("../requireAuth");
|
|
12
|
+
const logger_1 = require("../logger");
|
|
13
|
+
const DISPLAY_NAME_QUESTION = {
|
|
14
|
+
type: "input",
|
|
15
|
+
name: "displayName",
|
|
16
|
+
default: "",
|
|
17
|
+
message: "What would you like to call your app?",
|
|
18
|
+
};
|
|
19
|
+
function logPostAppCreationInformation(appMetadata, appPlatform) {
|
|
20
|
+
logger_1.logger.info("");
|
|
21
|
+
logger_1.logger.info(`🎉🎉🎉 Your Firebase ${appPlatform} App is ready! 🎉🎉🎉`);
|
|
22
|
+
logger_1.logger.info("");
|
|
23
|
+
logger_1.logger.info("App information:");
|
|
24
|
+
logger_1.logger.info(` - App ID: ${appMetadata.appId}`);
|
|
25
|
+
if (appMetadata.displayName) {
|
|
26
|
+
logger_1.logger.info(` - Display name: ${appMetadata.displayName}`);
|
|
27
|
+
}
|
|
28
|
+
if (appPlatform === apps_1.AppPlatform.IOS) {
|
|
29
|
+
const iosAppMetadata = appMetadata;
|
|
30
|
+
logger_1.logger.info(` - Bundle ID: ${iosAppMetadata.bundleId}`);
|
|
31
|
+
if (iosAppMetadata.appStoreId) {
|
|
32
|
+
logger_1.logger.info(` - App Store ID: ${iosAppMetadata.appStoreId}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (appPlatform === apps_1.AppPlatform.ANDROID) {
|
|
36
|
+
logger_1.logger.info(` - Package name: ${appMetadata.packageName}`);
|
|
37
|
+
}
|
|
38
|
+
logger_1.logger.info("");
|
|
39
|
+
logger_1.logger.info("You can run this command to print out your new app's Google Services config:");
|
|
40
|
+
logger_1.logger.info(` firebase apps:sdkconfig ${appPlatform} ${appMetadata.appId}`);
|
|
41
|
+
}
|
|
42
|
+
async function initiateIosAppCreation(options) {
|
|
43
|
+
if (!options.nonInteractive) {
|
|
44
|
+
await (0, prompt_1.prompt)(options, [
|
|
45
|
+
DISPLAY_NAME_QUESTION,
|
|
46
|
+
{
|
|
47
|
+
type: "input",
|
|
48
|
+
default: "",
|
|
49
|
+
name: "bundleId",
|
|
50
|
+
message: "Please specify your iOS app bundle ID:",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "input",
|
|
54
|
+
default: "",
|
|
55
|
+
name: "appStoreId",
|
|
56
|
+
message: "Please specify your iOS app App Store ID:",
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
if (!options.bundleId) {
|
|
61
|
+
throw new error_1.FirebaseError("Bundle ID for iOS app cannot be empty");
|
|
62
|
+
}
|
|
63
|
+
const spinner = ora("Creating your iOS app").start();
|
|
64
|
+
try {
|
|
65
|
+
const appData = await (0, apps_1.createIosApp)(options.project, {
|
|
66
|
+
displayName: options.displayName,
|
|
67
|
+
bundleId: options.bundleId,
|
|
68
|
+
appStoreId: options.appStoreId,
|
|
69
|
+
});
|
|
70
|
+
spinner.succeed();
|
|
71
|
+
return appData;
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
spinner.fail();
|
|
75
|
+
throw err;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async function initiateAndroidAppCreation(options) {
|
|
79
|
+
if (!options.nonInteractive) {
|
|
80
|
+
await (0, prompt_1.prompt)(options, [
|
|
81
|
+
DISPLAY_NAME_QUESTION,
|
|
82
|
+
{
|
|
83
|
+
type: "input",
|
|
84
|
+
default: "",
|
|
85
|
+
name: "packageName",
|
|
86
|
+
message: "Please specify your Android app package name:",
|
|
87
|
+
},
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
if (!options.packageName) {
|
|
91
|
+
throw new error_1.FirebaseError("Package name for Android app cannot be empty");
|
|
92
|
+
}
|
|
93
|
+
const spinner = ora("Creating your Android app").start();
|
|
94
|
+
try {
|
|
95
|
+
const appData = await (0, apps_1.createAndroidApp)(options.project, {
|
|
96
|
+
displayName: options.displayName,
|
|
97
|
+
packageName: options.packageName,
|
|
98
|
+
});
|
|
99
|
+
spinner.succeed();
|
|
100
|
+
return appData;
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
spinner.fail();
|
|
104
|
+
throw err;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function initiateWebAppCreation(options) {
|
|
108
|
+
if (!options.nonInteractive) {
|
|
109
|
+
await (0, prompt_1.prompt)(options, [DISPLAY_NAME_QUESTION]);
|
|
110
|
+
}
|
|
111
|
+
if (!options.displayName) {
|
|
112
|
+
throw new error_1.FirebaseError("Display name for Web app cannot be empty");
|
|
113
|
+
}
|
|
114
|
+
const spinner = ora("Creating your Web app").start();
|
|
115
|
+
try {
|
|
116
|
+
const appData = await (0, apps_1.createWebApp)(options.project, { displayName: options.displayName });
|
|
117
|
+
spinner.succeed();
|
|
118
|
+
return appData;
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
spinner.fail();
|
|
122
|
+
throw err;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.command = new command_1.Command("apps:create [platform] [displayName]")
|
|
126
|
+
.description("create a new Firebase app. [platform] can be IOS, ANDROID or WEB (case insensitive).")
|
|
127
|
+
.option("-a, --package-name <packageName>", "required package name for the Android app")
|
|
128
|
+
.option("-b, --bundle-id <bundleId>", "required bundle id for the iOS app")
|
|
129
|
+
.option("-s, --app-store-id <appStoreId>", "(optional) app store id for the iOS app")
|
|
130
|
+
.before(requireAuth_1.requireAuth)
|
|
131
|
+
.action(async (platform = "", displayName, options) => {
|
|
132
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
133
|
+
if (!options.nonInteractive && !platform) {
|
|
134
|
+
platform = await (0, prompt_1.promptOnce)({
|
|
135
|
+
type: "list",
|
|
136
|
+
message: "Please choose the platform of the app:",
|
|
137
|
+
choices: [
|
|
138
|
+
{ name: "iOS", value: apps_1.AppPlatform.IOS },
|
|
139
|
+
{ name: "Android", value: apps_1.AppPlatform.ANDROID },
|
|
140
|
+
{ name: "Web", value: apps_1.AppPlatform.WEB },
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
const appPlatform = (0, apps_1.getAppPlatform)(platform);
|
|
145
|
+
if (appPlatform === apps_1.AppPlatform.ANY) {
|
|
146
|
+
throw new error_1.FirebaseError("App platform must be provided");
|
|
147
|
+
}
|
|
148
|
+
logger_1.logger.info(`Create your ${appPlatform} app in project ${clc.bold(projectId)}:`);
|
|
149
|
+
options.displayName = displayName;
|
|
150
|
+
let appData;
|
|
151
|
+
switch (appPlatform) {
|
|
152
|
+
case apps_1.AppPlatform.IOS:
|
|
153
|
+
appData = await initiateIosAppCreation(options);
|
|
154
|
+
break;
|
|
155
|
+
case apps_1.AppPlatform.ANDROID:
|
|
156
|
+
appData = await initiateAndroidAppCreation(options);
|
|
157
|
+
break;
|
|
158
|
+
case apps_1.AppPlatform.WEB:
|
|
159
|
+
appData = await initiateWebAppCreation(options);
|
|
160
|
+
break;
|
|
161
|
+
default:
|
|
162
|
+
throw new error_1.FirebaseError("Unexpected error. This should not happen");
|
|
163
|
+
}
|
|
164
|
+
logPostAppCreationInformation(appData, appPlatform);
|
|
165
|
+
return appData;
|
|
166
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const ora = require("ora");
|
|
6
|
+
const Table = require("cli-table");
|
|
7
|
+
const command_1 = require("../command");
|
|
8
|
+
const projectUtils_1 = require("../projectUtils");
|
|
9
|
+
const apps_1 = require("../management/apps");
|
|
10
|
+
const requireAuth_1 = require("../requireAuth");
|
|
11
|
+
const logger_1 = require("../logger");
|
|
12
|
+
const NOT_SPECIFIED = clc.yellow("[Not specified]");
|
|
13
|
+
function logAppsList(apps) {
|
|
14
|
+
if (apps.length === 0) {
|
|
15
|
+
logger_1.logger.info(clc.bold("No apps found."));
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const tableHead = ["App Display Name", "App ID", "Platform"];
|
|
19
|
+
const table = new Table({ head: tableHead, style: { head: ["green"] } });
|
|
20
|
+
apps.forEach(({ appId, displayName, platform }) => {
|
|
21
|
+
table.push([displayName || NOT_SPECIFIED, appId, platform]);
|
|
22
|
+
});
|
|
23
|
+
logger_1.logger.info(table.toString());
|
|
24
|
+
}
|
|
25
|
+
function logAppCount(count = 0) {
|
|
26
|
+
if (count === 0) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
logger_1.logger.info("");
|
|
30
|
+
logger_1.logger.info(`${count} app(s) total.`);
|
|
31
|
+
}
|
|
32
|
+
exports.command = new command_1.Command("apps:list [platform]")
|
|
33
|
+
.description("list the registered apps of a Firebase project. " +
|
|
34
|
+
"Optionally filter apps by [platform]: IOS, ANDROID or WEB (case insensitive)")
|
|
35
|
+
.before(requireAuth_1.requireAuth)
|
|
36
|
+
.action(async (platform, options) => {
|
|
37
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
38
|
+
const appPlatform = (0, apps_1.getAppPlatform)(platform || "");
|
|
39
|
+
let apps;
|
|
40
|
+
const spinner = ora("Preparing the list of your Firebase " +
|
|
41
|
+
`${appPlatform === apps_1.AppPlatform.ANY ? "" : appPlatform + " "}apps`).start();
|
|
42
|
+
try {
|
|
43
|
+
apps = await (0, apps_1.listFirebaseApps)(projectId, appPlatform);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
spinner.fail();
|
|
47
|
+
throw err;
|
|
48
|
+
}
|
|
49
|
+
spinner.succeed();
|
|
50
|
+
logAppsList(apps);
|
|
51
|
+
logAppCount(apps.length);
|
|
52
|
+
return apps;
|
|
53
|
+
});
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const ora = require("ora");
|
|
5
|
+
const fs = require("fs-extra");
|
|
6
|
+
const command_1 = require("../command");
|
|
7
|
+
const apps_1 = require("../management/apps");
|
|
8
|
+
const projectUtils_1 = require("../projectUtils");
|
|
9
|
+
const projects_1 = require("../management/projects");
|
|
10
|
+
const error_1 = require("../error");
|
|
11
|
+
const requireAuth_1 = require("../requireAuth");
|
|
12
|
+
const logger_1 = require("../logger");
|
|
13
|
+
const prompt_1 = require("../prompt");
|
|
14
|
+
function checkForApps(apps, appPlatform) {
|
|
15
|
+
if (!apps.length) {
|
|
16
|
+
throw new error_1.FirebaseError(`There are no ${appPlatform === apps_1.AppPlatform.ANY ? "" : appPlatform + " "}apps ` +
|
|
17
|
+
"associated with this Firebase project");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function selectAppInteractively(apps, appPlatform) {
|
|
21
|
+
checkForApps(apps, appPlatform);
|
|
22
|
+
const choices = apps.map((app) => {
|
|
23
|
+
return {
|
|
24
|
+
name: `${app.displayName || app.bundleId || app.packageName}` +
|
|
25
|
+
` - ${app.appId} (${app.platform})`,
|
|
26
|
+
value: app,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return await (0, prompt_1.promptOnce)({
|
|
30
|
+
type: "list",
|
|
31
|
+
message: `Select the ${appPlatform === apps_1.AppPlatform.ANY ? "" : appPlatform + " "}` +
|
|
32
|
+
"app to get the configuration data:",
|
|
33
|
+
choices,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.command = new command_1.Command("apps:sdkconfig [platform] [appId]")
|
|
37
|
+
.description("print the Google Services config of a Firebase app. " +
|
|
38
|
+
"[platform] can be IOS, ANDROID or WEB (case insensitive)")
|
|
39
|
+
.option("-o, --out [file]", "(optional) write config output to a file")
|
|
40
|
+
.before(requireAuth_1.requireAuth)
|
|
41
|
+
.action(async (platform = "", appId = "", options) => {
|
|
42
|
+
let appPlatform = (0, apps_1.getAppPlatform)(platform);
|
|
43
|
+
if (!appId) {
|
|
44
|
+
let projectId = (0, projectUtils_1.needProjectId)(options);
|
|
45
|
+
if (options.nonInteractive && !projectId) {
|
|
46
|
+
throw new error_1.FirebaseError("Must supply app and project ids in non-interactive mode.");
|
|
47
|
+
}
|
|
48
|
+
else if (!projectId) {
|
|
49
|
+
const result = await (0, projects_1.getOrPromptProject)(options);
|
|
50
|
+
projectId = result.projectId;
|
|
51
|
+
}
|
|
52
|
+
const apps = await (0, apps_1.listFirebaseApps)(projectId, appPlatform);
|
|
53
|
+
checkForApps(apps, appPlatform);
|
|
54
|
+
if (apps.length === 1) {
|
|
55
|
+
appId = apps[0].appId;
|
|
56
|
+
appPlatform = apps[0].platform;
|
|
57
|
+
}
|
|
58
|
+
else if (options.nonInteractive) {
|
|
59
|
+
throw new error_1.FirebaseError(`Project ${projectId} has multiple apps, must specify an app id.`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const appMetadata = await selectAppInteractively(apps, appPlatform);
|
|
63
|
+
appId = appMetadata.appId;
|
|
64
|
+
appPlatform = appMetadata.platform;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
let configData;
|
|
68
|
+
const spinner = ora(`Downloading configuration data of your Firebase ${appPlatform} app`).start();
|
|
69
|
+
try {
|
|
70
|
+
configData = await (0, apps_1.getAppConfig)(appId, appPlatform);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
spinner.fail();
|
|
74
|
+
throw err;
|
|
75
|
+
}
|
|
76
|
+
spinner.succeed();
|
|
77
|
+
const fileInfo = (0, apps_1.getAppConfigFile)(configData, appPlatform);
|
|
78
|
+
if (appPlatform === apps_1.AppPlatform.WEB) {
|
|
79
|
+
fileInfo.sdkConfig = configData;
|
|
80
|
+
}
|
|
81
|
+
if (options.out === undefined) {
|
|
82
|
+
logger_1.logger.info(fileInfo.fileContents);
|
|
83
|
+
return fileInfo;
|
|
84
|
+
}
|
|
85
|
+
const shouldUseDefaultFilename = options.out === true || options.out === "";
|
|
86
|
+
const filename = shouldUseDefaultFilename ? configData.fileName : options.out;
|
|
87
|
+
if (fs.existsSync(filename)) {
|
|
88
|
+
if (options.nonInteractive) {
|
|
89
|
+
throw new error_1.FirebaseError(`${filename} already exists`);
|
|
90
|
+
}
|
|
91
|
+
const overwrite = await (0, prompt_1.promptOnce)({
|
|
92
|
+
type: "confirm",
|
|
93
|
+
default: false,
|
|
94
|
+
message: `${filename} already exists. Do you want to overwrite?`,
|
|
95
|
+
});
|
|
96
|
+
if (!overwrite) {
|
|
97
|
+
return configData;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
fs.writeFileSync(filename, fileInfo.fileContents);
|
|
101
|
+
logger_1.logger.info(`App configuration is written in ${filename}`);
|
|
102
|
+
return configData;
|
|
103
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
const command_1 = require("../command");
|
|
8
|
+
const logger_1 = require("../logger");
|
|
9
|
+
const projectUtils_1 = require("../projectUtils");
|
|
10
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
11
|
+
const accountExporter_1 = require("../accountExporter");
|
|
12
|
+
const MAX_BATCH_SIZE = 1000;
|
|
13
|
+
exports.command = new command_1.Command("auth:export [dataFile]")
|
|
14
|
+
.description("Export accounts from your Firebase project into a data file")
|
|
15
|
+
.option("--format <format>", "Format of exported data (csv, json). Ignored if <dataFile> has format extension.")
|
|
16
|
+
.before(requirePermissions_1.requirePermissions, ["firebaseauth.users.get"])
|
|
17
|
+
.action((dataFile, options) => {
|
|
18
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
19
|
+
const checkRes = (0, accountExporter_1.validateOptions)(options, dataFile);
|
|
20
|
+
if (!checkRes.format) {
|
|
21
|
+
return checkRes;
|
|
22
|
+
}
|
|
23
|
+
const writeStream = fs.createWriteStream(dataFile);
|
|
24
|
+
if (checkRes.format === "json") {
|
|
25
|
+
writeStream.write('{"users": [' + os.EOL);
|
|
26
|
+
}
|
|
27
|
+
const exportOptions = {
|
|
28
|
+
format: checkRes.format,
|
|
29
|
+
writeStream,
|
|
30
|
+
batchSize: MAX_BATCH_SIZE,
|
|
31
|
+
};
|
|
32
|
+
logger_1.logger.info("Exporting accounts to " + clc.bold(dataFile));
|
|
33
|
+
return (0, accountExporter_1.serialExportUsers)(projectId, exportOptions).then(() => {
|
|
34
|
+
if (exportOptions.format === "json") {
|
|
35
|
+
writeStream.write("]}");
|
|
36
|
+
}
|
|
37
|
+
writeStream.end();
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
writeStream.on("finish", resolve);
|
|
40
|
+
writeStream.on("close", resolve);
|
|
41
|
+
writeStream.on("error", reject);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const csv_parse_1 = require("csv-parse");
|
|
5
|
+
const Chain = require("stream-chain");
|
|
6
|
+
const clc = require("colorette");
|
|
7
|
+
const fs = require("fs-extra");
|
|
8
|
+
const Pick = require("stream-json/filters/Pick");
|
|
9
|
+
const StreamArray = require("stream-json/streamers/StreamArray");
|
|
10
|
+
const command_1 = require("../command");
|
|
11
|
+
const error_1 = require("../error");
|
|
12
|
+
const logger_1 = require("../logger");
|
|
13
|
+
const projectUtils_1 = require("../projectUtils");
|
|
14
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
15
|
+
const accountImporter_1 = require("../accountImporter");
|
|
16
|
+
const MAX_BATCH_SIZE = 1000;
|
|
17
|
+
exports.command = new command_1.Command("auth:import [dataFile]")
|
|
18
|
+
.description("import users into your Firebase project from a data file(.csv or .json)")
|
|
19
|
+
.option("--hash-algo <hashAlgo>", "specify the hash algorithm used in password for these accounts")
|
|
20
|
+
.option("--hash-key <hashKey>", "specify the key used in hash algorithm")
|
|
21
|
+
.option("--salt-separator <saltSeparator>", "specify the salt separator which will be appended to salt when verifying password. only used by SCRYPT now.")
|
|
22
|
+
.option("--rounds <rounds>", "specify how many rounds for hash calculation.")
|
|
23
|
+
.option("--mem-cost <memCost>", "specify the memory cost for firebase scrypt, or cpu/memory cost for standard scrypt")
|
|
24
|
+
.option("--parallelization <parallelization>", "specify the parallelization for standard scrypt.")
|
|
25
|
+
.option("--block-size <blockSize>", "specify the block size (normally is 8) for standard scrypt.")
|
|
26
|
+
.option("--dk-len <dkLen>", "specify derived key length for standard scrypt.")
|
|
27
|
+
.option("--hash-input-order <hashInputOrder>", "specify the order of password and salt. Possible values are SALT_FIRST and PASSWORD_FIRST. " +
|
|
28
|
+
"MD5, SHA1, SHA256, SHA512, HMAC_MD5, HMAC_SHA1, HMAC_SHA256, HMAC_SHA512 support this flag.")
|
|
29
|
+
.before(requirePermissions_1.requirePermissions, ["firebaseauth.users.create", "firebaseauth.users.update"])
|
|
30
|
+
.action(async (dataFile, options) => {
|
|
31
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
32
|
+
const checkRes = (0, accountImporter_1.validateOptions)(options);
|
|
33
|
+
if (!checkRes.valid) {
|
|
34
|
+
return checkRes;
|
|
35
|
+
}
|
|
36
|
+
const hashOptions = checkRes;
|
|
37
|
+
if (!dataFile.endsWith(".csv") && !dataFile.endsWith(".json")) {
|
|
38
|
+
throw new error_1.FirebaseError("Data file must end with .csv or .json");
|
|
39
|
+
}
|
|
40
|
+
const stats = await fs.stat(dataFile);
|
|
41
|
+
const fileSizeInBytes = stats.size;
|
|
42
|
+
logger_1.logger.info(`Processing ${clc.bold(dataFile)} (${fileSizeInBytes} bytes)`);
|
|
43
|
+
const batches = [];
|
|
44
|
+
let currentBatch = [];
|
|
45
|
+
let counter = 0;
|
|
46
|
+
let userListArr = [];
|
|
47
|
+
const inStream = fs.createReadStream(dataFile);
|
|
48
|
+
if (dataFile.endsWith(".csv")) {
|
|
49
|
+
userListArr = await new Promise((resolve, reject) => {
|
|
50
|
+
const parser = (0, csv_parse_1.parse)();
|
|
51
|
+
parser
|
|
52
|
+
.on("readable", () => {
|
|
53
|
+
let record = [];
|
|
54
|
+
while ((record = parser.read()) !== null) {
|
|
55
|
+
counter++;
|
|
56
|
+
const trimmed = record.map((s) => {
|
|
57
|
+
const str = s.trim().replace(/^["|'](.*)["|']$/, "$1");
|
|
58
|
+
return str === "" ? undefined : str;
|
|
59
|
+
});
|
|
60
|
+
const user = (0, accountImporter_1.transArrayToUser)(trimmed);
|
|
61
|
+
const err = user.error;
|
|
62
|
+
if (err) {
|
|
63
|
+
return reject(new error_1.FirebaseError(`Line ${counter} (${record.join(",")}) has invalid data format: ${err}`));
|
|
64
|
+
}
|
|
65
|
+
currentBatch.push(user);
|
|
66
|
+
if (currentBatch.length === MAX_BATCH_SIZE) {
|
|
67
|
+
batches.push(currentBatch);
|
|
68
|
+
currentBatch = [];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
.on("end", () => {
|
|
73
|
+
if (currentBatch.length) {
|
|
74
|
+
batches.push(currentBatch);
|
|
75
|
+
}
|
|
76
|
+
resolve(batches);
|
|
77
|
+
});
|
|
78
|
+
inStream.pipe(parser);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
userListArr = await new Promise((resolve, reject) => {
|
|
83
|
+
const pipeline = new Chain([
|
|
84
|
+
Pick.withParser({ filter: /^users$/ }),
|
|
85
|
+
StreamArray.streamArray(),
|
|
86
|
+
({ value }) => {
|
|
87
|
+
counter++;
|
|
88
|
+
const user = (0, accountImporter_1.validateUserJson)(value);
|
|
89
|
+
const err = user.error;
|
|
90
|
+
if (err) {
|
|
91
|
+
throw new error_1.FirebaseError(`Validation Error: ${err}`);
|
|
92
|
+
}
|
|
93
|
+
currentBatch.push(value);
|
|
94
|
+
if (currentBatch.length === MAX_BATCH_SIZE) {
|
|
95
|
+
batches.push(currentBatch);
|
|
96
|
+
currentBatch = [];
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
]);
|
|
100
|
+
pipeline.once("error", reject);
|
|
101
|
+
pipeline.on("finish", () => {
|
|
102
|
+
if (currentBatch.length) {
|
|
103
|
+
batches.push(currentBatch);
|
|
104
|
+
}
|
|
105
|
+
resolve(batches);
|
|
106
|
+
});
|
|
107
|
+
inStream.pipe(pipeline);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
logger_1.logger.debug(`Preparing to import ${counter} user records in ${userListArr.length} batches.`);
|
|
111
|
+
if (userListArr.length) {
|
|
112
|
+
return (0, accountImporter_1.serialImportUsers)(projectId, hashOptions, userListArr, 0);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const command_1 = require("../command");
|
|
5
|
+
const utils = require("../utils");
|
|
6
|
+
const buildToolsJarHelper_1 = require("../crashlytics/buildToolsJarHelper");
|
|
7
|
+
const error_1 = require("../error");
|
|
8
|
+
exports.command = new command_1.Command("crashlytics:mappingfile:generateid")
|
|
9
|
+
.description("generate a mapping file id and write it to an Android resource file, which will be built into the app")
|
|
10
|
+
.option("--resource-file <resourceFile>", "path to the Android resource XML file that will be created or updated.")
|
|
11
|
+
.action(async (options) => {
|
|
12
|
+
const debug = !!options.debug;
|
|
13
|
+
const resourceFilePath = options.resourceFile;
|
|
14
|
+
if (!resourceFilePath) {
|
|
15
|
+
throw new error_1.FirebaseError("set --resource-file <resourceFile> to an Android resource file path, e.g. app/src/main/res/values/crashlytics.xml");
|
|
16
|
+
}
|
|
17
|
+
const jarFile = await (0, buildToolsJarHelper_1.fetchBuildtoolsJar)();
|
|
18
|
+
const jarOptions = { resourceFilePath };
|
|
19
|
+
utils.logBullet(`Updating resource file: ${resourceFilePath}`);
|
|
20
|
+
const generateIdArgs = buildArgs(jarOptions);
|
|
21
|
+
(0, buildToolsJarHelper_1.runBuildtoolsCommand)(jarFile, generateIdArgs, debug);
|
|
22
|
+
utils.logBullet("Successfully updated mapping file id");
|
|
23
|
+
});
|
|
24
|
+
function buildArgs(options) {
|
|
25
|
+
return ["-injectMappingFileIdIntoResource", options.resourceFilePath, "-verbose"];
|
|
26
|
+
}
|