firebase-tools 15.1.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/accountExporter.js +3 -5
- package/lib/accountImporter.js +4 -5
- package/lib/api.js +3 -3
- package/lib/apiv2.js +9 -13
- package/lib/appUtils.js +19 -21
- package/lib/appdistribution/client.js +4 -8
- package/lib/appdistribution/distribution.js +4 -4
- package/lib/appdistribution/options-parser-util.js +8 -9
- package/lib/appdistribution/types.js +2 -2
- package/lib/appdistribution/yaml_helper.js +33 -17
- package/lib/apphosting/app.js +8 -13
- package/lib/apphosting/backend.js +34 -24
- package/lib/apphosting/config.js +14 -14
- package/lib/apphosting/githubConnections.js +38 -35
- package/lib/apphosting/localbuilds.js +4 -6
- package/lib/apphosting/repo.js +24 -20
- package/lib/apphosting/rollout.js +12 -5
- package/lib/apphosting/secrets/dialogs.js +9 -9
- package/lib/apphosting/secrets/index.js +9 -11
- package/lib/apphosting/utils.js +2 -3
- package/lib/apphosting/yaml.js +12 -11
- package/lib/apptesting/ensureProjectConfigured.js +1 -2
- package/lib/apptesting/invokeTests.js +2 -3
- package/lib/apptesting/parseTestFiles.js +5 -6
- package/lib/apptesting/types.js +2 -2
- package/lib/archiveDirectory.js +1 -2
- package/lib/auth.js +36 -40
- package/lib/bin/cli.js +2 -3
- package/lib/bin/mcp.js +1 -2
- package/lib/checkMinRequiredVersion.js +1 -2
- package/lib/checkValidTargetFilters.js +1 -2
- package/lib/command.js +6 -9
- package/lib/commands/appdistribution-testers-list.js +2 -3
- package/lib/commands/apphosting-backends-list.js +4 -6
- package/lib/commands/apphosting-builds-create.js +2 -3
- package/lib/commands/apphosting-builds-get.js +1 -2
- package/lib/commands/apphosting-rollouts-list.js +1 -2
- package/lib/commands/apps-init.js +1 -1
- package/lib/commands/{apptesting-execute.js → apptesting-wata.js} +3 -4
- package/lib/commands/crashlytics-symbols-upload.js +2 -2
- package/lib/commands/dataconnect-execute.js +4 -4
- package/lib/commands/dataconnect-sdk-generate.js +5 -6
- package/lib/commands/dataconnect-services-list.js +7 -8
- package/lib/commands/dataconnect-sql-diff.js +1 -2
- package/lib/commands/dataconnect-sql-migrate.js +4 -3
- package/lib/commands/dataconnect-sql-setup.js +2 -2
- package/lib/commands/dataconnect-sql-shell.js +5 -1
- package/lib/commands/emulators-start.js +1 -2
- package/lib/commands/ext-configure.js +6 -4
- package/lib/commands/ext-dev-list.js +2 -3
- package/lib/commands/ext-dev-upload.js +2 -2
- package/lib/commands/ext-export.js +1 -1
- package/lib/commands/ext-info.js +2 -3
- package/lib/commands/ext-install.js +5 -7
- package/lib/commands/firestore-backups-list.js +1 -2
- package/lib/commands/firestore-backups-schedules-list.js +1 -2
- package/lib/commands/firestore-indexes-list.js +1 -2
- package/lib/commands/firestore-utils.js +1 -2
- package/lib/commands/functions-artifacts-setpolicy.js +1 -2
- package/lib/commands/functions-config-export.js +2 -3
- package/lib/commands/hosting-channel-deploy.js +2 -2
- package/lib/commands/hosting-clone.js +2 -3
- package/lib/commands/hosting-sites-create.js +1 -1
- package/lib/commands/index.js +2 -3
- package/lib/commands/init.js +4 -5
- package/lib/commands/internaltesting-functions-discover.js +1 -1
- package/lib/commands/login.js +4 -5
- package/lib/commands/logout.js +3 -3
- package/lib/commands/projects-create.js +1 -1
- package/lib/commands/remoteconfig-experiments-list.js +2 -3
- package/lib/commands/remoteconfig-get.js +1 -1
- package/lib/commands/remoteconfig-rollback.js +1 -2
- package/lib/commands/remoteconfig-rollouts-list.js +2 -3
- package/lib/commands/remoteconfig-versions-list.js +3 -4
- package/lib/commands/use.js +3 -3
- package/lib/config.js +4 -5
- package/lib/crashlytics/buildToolsJarHelper.js +3 -5
- package/lib/crashlytics/events.js +4 -7
- package/lib/crashlytics/filters.js +10 -12
- package/lib/crashlytics/issues.js +2 -3
- package/lib/crashlytics/notes.js +3 -4
- package/lib/crashlytics/reports.js +21 -15
- package/lib/crashlytics/types.js +7 -7
- package/lib/crashlytics/utils.js +4 -4
- package/lib/database/api.js +2 -3
- package/lib/database/import.js +4 -4
- package/lib/database/metadata.js +5 -6
- package/lib/database/rulesConfig.js +2 -3
- package/lib/dataconnect/build.js +10 -13
- package/lib/dataconnect/checkIam.js +1 -2
- package/lib/dataconnect/client.js +15 -18
- package/lib/dataconnect/dataplaneClient.js +6 -6
- package/lib/dataconnect/ensureApis.js +2 -3
- package/lib/dataconnect/errors.js +8 -11
- package/lib/dataconnect/filters.js +2 -3
- package/lib/dataconnect/freeTrial.js +3 -4
- package/lib/dataconnect/graphqlError.js +5 -8
- package/lib/dataconnect/load.js +10 -11
- package/lib/dataconnect/names.js +14 -18
- package/lib/dataconnect/prompts.js +1 -2
- package/lib/dataconnect/provisionCloudSql.js +13 -17
- package/lib/dataconnect/schemaMigration.js +60 -27
- package/lib/dataconnect/types.js +10 -12
- package/lib/dataconnect/webhook.js +3 -3
- package/lib/defaultCredentials.js +3 -4
- package/lib/deploy/apphosting/deploy.js +2 -3
- package/lib/deploy/apphosting/prepare.js +3 -5
- package/lib/deploy/apphosting/release.js +1 -1
- package/lib/deploy/apphosting/util.js +1 -2
- package/lib/deploy/database/deploy.js +1 -2
- package/lib/deploy/database/prepare.js +1 -2
- package/lib/deploy/database/release.js +1 -2
- package/lib/deploy/dataconnect/context.js +15 -4
- package/lib/deploy/dataconnect/deploy.js +5 -6
- package/lib/deploy/dataconnect/prepare.js +7 -9
- package/lib/deploy/dataconnect/release.js +7 -10
- package/lib/deploy/extensions/deploy.js +7 -9
- package/lib/deploy/extensions/deploymentSummary.js +6 -7
- package/lib/deploy/extensions/planner.js +15 -18
- package/lib/deploy/extensions/prepare.js +9 -11
- package/lib/deploy/extensions/release.js +10 -12
- package/lib/deploy/extensions/secrets.js +8 -11
- package/lib/deploy/extensions/tasks.js +6 -8
- package/lib/deploy/extensions/v2FunctionHelper.js +2 -3
- package/lib/deploy/extensions/validate.js +1 -2
- package/lib/deploy/firestore/deploy.js +3 -5
- package/lib/deploy/firestore/prepare.js +2 -3
- package/lib/deploy/firestore/release.js +3 -4
- package/lib/deploy/functions/backend.js +52 -42
- package/lib/deploy/functions/build.js +41 -15
- package/lib/deploy/functions/cache/applyHash.js +3 -5
- package/lib/deploy/functions/cache/hash.js +4 -5
- package/lib/deploy/functions/cel.js +3 -3
- package/lib/deploy/functions/checkIam.js +8 -8
- package/lib/deploy/functions/containerCleaner.js +10 -6
- package/lib/deploy/functions/deploy.js +6 -8
- package/lib/deploy/functions/ensure.js +6 -9
- package/lib/deploy/functions/functionsDeployHelper.js +10 -11
- package/lib/deploy/functions/params.js +10 -10
- package/lib/deploy/functions/prepare.js +41 -36
- package/lib/deploy/functions/prepareFunctionsUpload.js +24 -10
- package/lib/deploy/functions/pricing.js +3 -3
- package/lib/deploy/functions/prompts.js +7 -10
- package/lib/deploy/functions/release/executor.js +5 -6
- package/lib/deploy/functions/release/fabricator.js +76 -29
- package/lib/deploy/functions/release/index.js +23 -14
- package/lib/deploy/functions/release/planner.js +15 -14
- package/lib/deploy/functions/release/reporter.js +20 -20
- package/lib/deploy/functions/release/sourceTokenScraper.js +4 -5
- package/lib/deploy/functions/remoteSource.js +3 -4
- package/lib/deploy/functions/runtimes/discovery/index.js +9 -12
- package/lib/deploy/functions/runtimes/discovery/parsing.js +2 -3
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +29 -10
- package/lib/deploy/functions/runtimes/index.js +1 -2
- package/lib/deploy/functions/runtimes/node/index.js +18 -9
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +2 -2
- package/lib/deploy/functions/runtimes/node/validate.js +1 -2
- package/lib/deploy/functions/runtimes/node/versioning.js +6 -7
- package/lib/deploy/functions/runtimes/python/index.js +12 -12
- package/lib/deploy/functions/runtimes/supported/index.js +5 -6
- package/lib/deploy/functions/services/auth.js +49 -36
- package/lib/deploy/functions/services/database.js +1 -2
- package/lib/deploy/functions/services/dataconnect.js +16 -2
- package/lib/deploy/functions/services/firebaseAlerts.js +1 -2
- package/lib/deploy/functions/services/firestore.js +3 -5
- package/lib/deploy/functions/services/index.js +2 -2
- package/lib/deploy/functions/services/remoteConfig.js +1 -2
- package/lib/deploy/functions/services/storage.js +3 -5
- package/lib/deploy/functions/services/testLab.js +1 -2
- package/lib/deploy/functions/triggerRegionHelper.js +1 -2
- package/lib/deploy/functions/validate.js +12 -11
- package/lib/deploy/hosting/convertConfig.js +38 -22
- package/lib/deploy/hosting/deploy.js +4 -7
- package/lib/deploy/hosting/hashcache.js +2 -3
- package/lib/deploy/hosting/prepare.js +14 -14
- package/lib/deploy/hosting/release.js +1 -2
- package/lib/deploy/index.js +7 -8
- package/lib/deploy/lifecycleHooks.js +3 -5
- package/lib/deploy/remoteconfig/deploy.js +1 -1
- package/lib/deploy/remoteconfig/functions.js +5 -6
- package/lib/deploy/remoteconfig/prepare.js +2 -3
- package/lib/deploy/remoteconfig/release.js +2 -2
- package/lib/deploy/storage/deploy.js +1 -1
- package/lib/deploy/storage/prepare.js +1 -1
- package/lib/deploy/storage/release.js +1 -1
- package/lib/deploymentTool.js +5 -6
- package/lib/detectProjectRoot.js +1 -2
- package/lib/downloadUtils.js +2 -3
- package/lib/emulator/adminSdkConfig.js +2 -3
- package/lib/emulator/apphosting/config.js +1 -2
- package/lib/emulator/apphosting/developmentServer.js +3 -3
- package/lib/emulator/apphosting/serve.js +20 -14
- package/lib/emulator/auth/cloudFunctions.js +2 -3
- package/lib/emulator/auth/errors.js +2 -2
- package/lib/emulator/auth/handlers.js +3 -4
- package/lib/emulator/auth/index.js +6 -6
- package/lib/emulator/auth/operations.js +171 -129
- package/lib/emulator/auth/server.js +30 -22
- package/lib/emulator/auth/state.js +26 -36
- package/lib/emulator/auth/utils.js +12 -13
- package/lib/emulator/commandUtils.js +20 -20
- package/lib/emulator/controller.js +32 -29
- package/lib/emulator/databaseEmulator.js +1 -2
- package/lib/emulator/dataconnect/pgliteServer.js +48 -104
- package/lib/emulator/dataconnectEmulator.js +6 -9
- package/lib/emulator/download.js +2 -3
- package/lib/emulator/downloadableEmulatorInfo.json +7 -7
- package/lib/emulator/downloadableEmulators.js +49 -24
- package/lib/emulator/emulatorLogger.js +19 -4
- package/lib/emulator/env.js +6 -8
- package/lib/emulator/eventarcEmulator.js +2 -3
- package/lib/emulator/eventarcEmulatorUtils.js +3 -6
- package/lib/emulator/extensions/postinstall.js +1 -2
- package/lib/emulator/extensions/validation.js +4 -7
- package/lib/emulator/extensionsEmulator.js +6 -9
- package/lib/emulator/functionsEmulator.js +89 -46
- package/lib/emulator/functionsEmulatorRuntime.js +1 -1
- package/lib/emulator/functionsEmulatorShared.js +30 -30
- package/lib/emulator/functionsEmulatorShell.js +4 -6
- package/lib/emulator/functionsEmulatorUtils.js +8 -9
- package/lib/emulator/functionsRuntimeWorker.js +18 -9
- package/lib/emulator/hub.js +41 -34
- package/lib/emulator/hubClient.js +1 -1
- package/lib/emulator/initEmulators.js +2 -3
- package/lib/emulator/loggingEmulator.js +2 -2
- package/lib/emulator/portUtils.js +4 -5
- package/lib/emulator/registry.js +10 -4
- package/lib/emulator/shared/request.js +1 -2
- package/lib/emulator/storage/apis/firebase.js +16 -20
- package/lib/emulator/storage/apis/gcloud.js +6 -9
- package/lib/emulator/storage/apis/shared.js +1 -2
- package/lib/emulator/storage/crc.js +2 -3
- package/lib/emulator/storage/files.js +18 -41
- package/lib/emulator/storage/metadata.js +10 -4
- package/lib/emulator/storage/multipart.js +1 -2
- package/lib/emulator/storage/rfc.js +1 -2
- package/lib/emulator/storage/rules/config.js +1 -2
- package/lib/emulator/storage/rules/manager.js +3 -5
- package/lib/emulator/storage/rules/runtime.js +15 -13
- package/lib/emulator/storage/rules/types.js +2 -2
- package/lib/emulator/storage/rules/utils.js +5 -6
- package/lib/emulator/storage/server.js +1 -2
- package/lib/emulator/storage/upload.js +3 -4
- package/lib/emulator/taskQueue.js +11 -4
- package/lib/emulator/tasksEmulator.js +11 -12
- package/lib/emulator/types.js +6 -6
- package/lib/emulator/ui.js +6 -1
- package/lib/ensureApiEnabled.js +7 -9
- package/lib/env.js +2 -3
- package/lib/error.js +11 -13
- package/lib/errorOut.js +1 -2
- package/lib/experiments.js +15 -18
- package/lib/extensions/askUserForEventsConfig.js +12 -13
- package/lib/extensions/askUserForParam.js +11 -12
- package/lib/extensions/change-log.js +4 -5
- package/lib/extensions/checkProjectBilling.js +1 -2
- package/lib/extensions/diagnose.js +1 -2
- package/lib/extensions/displayExtensionInfo.js +25 -32
- package/lib/extensions/emulator/optionsHelper.js +6 -8
- package/lib/extensions/emulator/specHelper.js +15 -16
- package/lib/extensions/emulator/triggerHelper.js +3 -5
- package/lib/extensions/etags.js +2 -3
- package/lib/extensions/export.js +7 -9
- package/lib/extensions/extensionsApi.js +23 -29
- package/lib/extensions/extensionsHelper.js +52 -80
- package/lib/extensions/listExtensions.js +3 -5
- package/lib/extensions/localHelper.js +5 -5
- package/lib/extensions/manifest.js +15 -16
- package/lib/extensions/metricsUtils.js +3 -4
- package/lib/extensions/paramHelper.js +21 -18
- package/lib/extensions/provisioningHelper.js +17 -21
- package/lib/extensions/publishHelpers.js +1 -2
- package/lib/extensions/publisherApi.js +11 -13
- package/lib/extensions/refs.js +6 -7
- package/lib/extensions/runtimes/common.js +18 -19
- package/lib/extensions/runtimes/node.js +5 -6
- package/lib/extensions/secretsUtils.js +8 -8
- package/lib/extensions/tos.js +7 -8
- package/lib/extensions/types.js +3 -3
- package/lib/extensions/updateHelper.js +6 -7
- package/lib/extensions/utils.js +6 -8
- package/lib/extensions/versionHelper.js +1 -2
- package/lib/extensions/warnings.js +6 -8
- package/lib/fetchMOTD.js +1 -2
- package/lib/fetchWebSetup.js +3 -4
- package/lib/filterTargets.js +1 -2
- package/lib/firebaseConfigValidate.js +2 -3
- package/lib/firestore/api-sort.js +8 -9
- package/lib/firestore/api-types.js +15 -15
- package/lib/firestore/api.js +15 -13
- package/lib/firestore/backupUtils.js +3 -3
- package/lib/firestore/checkDatabaseType.js +1 -2
- package/lib/firestore/delete.js +1 -2
- package/lib/firestore/encodeFirestoreValue.js +1 -2
- package/lib/firestore/fsConfig.js +1 -2
- package/lib/firestore/options.js +1 -1
- package/lib/firestore/util.js +5 -6
- package/lib/firestore/validator.js +4 -5
- package/lib/frameworks/angular/index.js +14 -15
- package/lib/frameworks/angular/utils.js +21 -23
- package/lib/frameworks/astro/index.js +7 -7
- package/lib/frameworks/astro/utils.js +4 -6
- package/lib/frameworks/compose/discover/filesystem.js +3 -3
- package/lib/frameworks/compose/discover/frameworkMatcher.js +4 -5
- package/lib/frameworks/compose/discover/index.js +1 -2
- package/lib/frameworks/compose/discover/runtime/node.js +8 -11
- package/lib/frameworks/compose/driver/docker.js +3 -5
- package/lib/frameworks/compose/driver/hooks.js +2 -2
- package/lib/frameworks/compose/driver/index.js +2 -2
- package/lib/frameworks/compose/driver/local.js +2 -3
- package/lib/frameworks/compose/index.js +5 -7
- package/lib/frameworks/constants.js +3 -3
- package/lib/frameworks/express/index.js +7 -8
- package/lib/frameworks/flutter/index.js +6 -7
- package/lib/frameworks/flutter/utils.js +4 -5
- package/lib/frameworks/index.js +21 -22
- package/lib/frameworks/next/constants.js +5 -2
- package/lib/frameworks/next/index.js +34 -32
- package/lib/frameworks/next/utils.js +40 -39
- package/lib/frameworks/nuxt/index.js +9 -9
- package/lib/frameworks/nuxt/utils.js +4 -6
- package/lib/frameworks/nuxt2/index.js +7 -7
- package/lib/frameworks/sveltekit/index.js +6 -8
- package/lib/frameworks/utils.js +26 -24
- package/lib/frameworks/vite/index.js +8 -9
- package/lib/fsAsync.js +1 -2
- package/lib/fsutils.js +5 -6
- package/lib/functional.js +11 -11
- package/lib/functions/artifacts.js +25 -22
- package/lib/functions/ensureTargeted.js +1 -2
- package/lib/functions/env.js +13 -14
- package/lib/functions/functionslog.js +2 -3
- package/lib/functions/projectConfig.js +29 -33
- package/lib/functions/python.js +10 -4
- package/lib/functions/secrets.js +32 -18
- package/lib/functionsConfig.js +14 -14
- package/lib/functionsConfigClone.js +1 -2
- package/lib/functionsShellCommandAction.js +2 -3
- package/lib/gcp/apphosting.js +43 -28
- package/lib/gcp/apptesting.js +2 -2
- package/lib/gcp/artifactregistry.js +5 -5
- package/lib/gcp/auth.js +11 -13
- package/lib/gcp/cloudbilling.js +4 -5
- package/lib/gcp/cloudbuild.js +10 -11
- package/lib/gcp/cloudfunctions.js +61 -45
- package/lib/gcp/cloudfunctionsv2.js +81 -43
- package/lib/gcp/cloudlogging.js +2 -4
- package/lib/gcp/cloudmonitoring.js +7 -7
- package/lib/gcp/cloudscheduler.js +12 -14
- package/lib/gcp/cloudsql/cloudsqladmin.js +18 -20
- package/lib/gcp/cloudsql/connect.js +14 -9
- package/lib/gcp/cloudsql/fbToolsAuthClient.js +5 -3
- package/lib/gcp/cloudsql/interactive.js +2 -3
- package/lib/gcp/cloudsql/permissions.js +8 -8
- package/lib/gcp/cloudsql/permissionsSetup.js +9 -9
- package/lib/gcp/cloudtasks.js +19 -18
- package/lib/gcp/computeEngine.js +1 -2
- package/lib/gcp/devConnect.js +32 -29
- package/lib/gcp/docker.js +2 -4
- package/lib/gcp/eventarc.js +5 -5
- package/lib/gcp/firedata.js +4 -4
- package/lib/gcp/firestore.js +16 -16
- package/lib/gcp/iam.js +11 -12
- package/lib/gcp/identityPlatform.js +4 -5
- package/lib/gcp/k8s.js +1 -2
- package/lib/gcp/location.js +2 -2
- package/lib/gcp/proto.js +10 -11
- package/lib/gcp/pubsub.js +4 -5
- package/lib/gcp/resourceManager.js +5 -5
- package/lib/gcp/rules.js +13 -14
- package/lib/gcp/run.js +24 -31
- package/lib/gcp/runv2.js +39 -27
- package/lib/gcp/secretManager.js +60 -39
- package/lib/gcp/serviceusage.js +8 -4
- package/lib/gcp/storage.js +22 -20
- package/lib/gemini/fdcExperience.js +5 -5
- package/lib/getDefaultDatabaseInstance.js +2 -4
- package/lib/getDefaultHostingSite.js +3 -4
- package/lib/getProjectNumber.js +1 -2
- package/lib/hosting/api.js +32 -36
- package/lib/hosting/cloudRunProxy.js +2 -3
- package/lib/hosting/config.js +17 -17
- package/lib/hosting/expireUtils.js +3 -3
- package/lib/hosting/functionsProxy.js +1 -2
- package/lib/hosting/implicitInit.js +1 -2
- package/lib/hosting/initMiddleware.js +1 -2
- package/lib/hosting/interactive.js +1 -2
- package/lib/hosting/proxy.js +3 -5
- package/lib/hosting/runTags.js +8 -11
- package/lib/init/features/account.js +1 -2
- package/lib/init/features/ailogic/index.js +3 -5
- package/lib/init/features/ailogic/utils.js +6 -8
- package/lib/init/features/aitools/claude.js +1 -2
- package/lib/init/features/aitools/cursor.js +1 -2
- package/lib/init/features/aitools/gemini.js +1 -1
- package/lib/init/features/aitools/promptUpdater.js +10 -12
- package/lib/init/features/aitools.js +1 -2
- package/lib/init/features/apphosting.js +3 -4
- package/lib/init/features/apptesting/index.js +9 -9
- package/lib/init/features/database.js +4 -5
- package/lib/init/features/dataconnect/create_app.js +3 -4
- package/lib/init/features/dataconnect/index.js +25 -22
- package/lib/init/features/dataconnect/resolver.js +6 -10
- package/lib/init/features/dataconnect/sdk.js +31 -24
- package/lib/init/features/emulators.js +7 -6
- package/lib/init/features/extensions/index.js +3 -5
- package/lib/init/features/firestore/index.js +7 -9
- package/lib/init/features/firestore/indexes.js +2 -2
- package/lib/init/features/firestore/rules.js +3 -3
- package/lib/init/features/functions/index.js +3 -5
- package/lib/init/features/functions/javascript.js +1 -2
- package/lib/init/features/functions/npm-dependencies.js +1 -2
- package/lib/init/features/functions/python.js +1 -2
- package/lib/init/features/functions/typescript.js +1 -2
- package/lib/init/features/genkit/index.js +44 -18
- package/lib/init/features/hosting/github.js +6 -8
- package/lib/init/features/hosting/index.js +10 -13
- package/lib/init/features/project.js +4 -7
- package/lib/init/features/remoteconfig.js +1 -2
- package/lib/init/features/storage.js +3 -5
- package/lib/init/index.js +4 -7
- package/lib/init/spawn.js +7 -9
- package/lib/listFiles.js +1 -2
- package/lib/loadCJSON.js +1 -2
- package/lib/localFunction.js +14 -15
- package/lib/logError.js +1 -2
- package/lib/logger.js +7 -7
- package/lib/management/apps.js +22 -22
- package/lib/management/database.js +11 -12
- package/lib/management/projects.js +57 -56
- package/lib/management/provisioning/errorHandler.js +3 -5
- package/lib/management/provisioning/provision.js +15 -9
- package/lib/management/studio.js +2 -3
- package/lib/mcp/errors.js +4 -4
- package/lib/mcp/index.js +16 -23
- package/lib/mcp/prompt.js +1 -2
- package/lib/mcp/prompts/core/consult.js +2 -3
- package/lib/mcp/prompts/crashlytics/connect.js +15 -122
- package/lib/mcp/prompts/dataconnect/schema.js +3 -3
- package/lib/mcp/prompts/index.js +8 -10
- package/lib/mcp/resource.js +3 -15
- package/lib/mcp/resources/guides/app_id.js +39 -0
- package/lib/mcp/resources/guides/crashlytics_connect.js +51 -0
- package/lib/mcp/resources/guides/crashlytics_investigations.js +51 -0
- package/lib/mcp/resources/guides/crashlytics_issues.js +42 -0
- package/lib/mcp/resources/guides/crashlytics_reports.js +112 -0
- package/lib/mcp/resources/index.js +11 -3
- package/lib/mcp/tool.js +3 -15
- package/lib/mcp/tools/apphosting/fetch_logs.js +3 -4
- package/lib/mcp/tools/apphosting/list_backends.js +1 -1
- package/lib/mcp/tools/auth/get_users.js +5 -16
- package/lib/mcp/tools/core/create_android_sha.js +4 -1
- package/lib/mcp/tools/core/get_environment.js +3 -3
- package/lib/mcp/tools/core/get_sdk_config.js +4 -5
- package/lib/mcp/tools/core/get_security_rules.js +1 -2
- package/lib/mcp/tools/core/init.js +2 -2
- package/lib/mcp/tools/core/logout.js +1 -1
- package/lib/mcp/tools/core/read_resources.js +2 -2
- package/lib/mcp/tools/core/validate_security_rules.js +1 -2
- package/lib/mcp/tools/crashlytics/events.js +43 -19
- package/lib/mcp/tools/crashlytics/index.js +1 -6
- package/lib/mcp/tools/crashlytics/issues.js +33 -12
- package/lib/mcp/tools/crashlytics/reports.js +66 -117
- package/lib/mcp/tools/dataconnect/list_services.js +2 -3
- package/lib/mcp/tools/firestore/converter.js +3 -5
- package/lib/mcp/tools/firestore/delete_document.js +1 -1
- package/lib/mcp/tools/functions/get_logs.js +14 -12
- package/lib/mcp/tools/functions/list_functions.js +1 -1
- package/lib/mcp/tools/index.js +17 -9
- package/lib/mcp/util/apptesting/availability.js +1 -2
- package/lib/mcp/util/availability.js +1 -2
- package/lib/mcp/util/crashlytics/availability.js +1 -2
- package/lib/mcp/util/dataconnect/compile.js +7 -6
- package/lib/mcp/util/dataconnect/converter.js +7 -10
- package/lib/mcp/util/dataconnect/emulator.js +1 -2
- package/lib/mcp/util.js +9 -11
- package/lib/messaging/sendMessage.js +1 -2
- package/lib/metaprogramming.js +1 -2
- package/lib/operation-poller.js +2 -2
- package/lib/profileReport.js +6 -6
- package/lib/profiler.js +1 -2
- package/lib/projectPath.js +1 -2
- package/lib/projectUtils.js +5 -6
- package/lib/prompt.js +22 -13
- package/lib/rc.js +5 -7
- package/lib/remoteconfig/deleteExperiment.js +1 -2
- package/lib/remoteconfig/deleteRollout.js +1 -2
- package/lib/remoteconfig/get.js +2 -3
- package/lib/remoteconfig/getExperiment.js +2 -2
- package/lib/remoteconfig/getRollout.js +2 -2
- package/lib/remoteconfig/interfaces.js +1 -1
- package/lib/remoteconfig/listExperiments.js +2 -2
- package/lib/remoteconfig/listRollouts.js +2 -2
- package/lib/remoteconfig/publish.js +1 -2
- package/lib/remoteconfig/rollback.js +1 -2
- package/lib/remoteconfig/versionslist.js +1 -2
- package/lib/requireAuth.js +4 -6
- package/lib/requireConfig.js +5 -8
- package/lib/requireDatabaseInstance.js +2 -2
- package/lib/requireHostingSite.js +1 -2
- package/lib/requireInteractive.js +1 -1
- package/lib/requirePermissions.js +1 -2
- package/lib/requireTosAcceptance.js +1 -2
- package/lib/responseToError.js +1 -2
- package/lib/rtdb.js +2 -3
- package/lib/rulesDeploy.js +3 -4
- package/lib/serve/functions.js +9 -1
- package/lib/serve/hosting.js +4 -5
- package/lib/serve/index.js +1 -2
- package/lib/shortenUrl.js +1 -2
- package/lib/templates.js +3 -4
- package/lib/throttler/throttler.js +3 -3
- package/lib/timeout.js +2 -3
- package/lib/track.js +23 -14
- package/lib/tsconfig.publish.tsbuildinfo +1 -0
- package/lib/unzip.js +2 -3
- package/lib/utils.js +62 -63
- package/lib/vsCodeUtils.js +2 -3
- package/package.json +6 -6
- package/templates/extensions/typescript/index.ts +1 -1
- package/templates/extensions/typescript/package.lint.json +1 -1
- package/templates/extensions/typescript/package.nolint.json +1 -1
- package/templates/extensions/typescript/tsconfig.json +2 -1
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
3
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4
|
-
var m = o[Symbol.asyncIterator], i;
|
|
5
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
6
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
7
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
8
|
-
};
|
|
9
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
3
|
+
exports.resourceTypeToNiceName = exports.AUTOPOPULATED_PARAM_PLACEHOLDERS = exports.EXTENSIONS_BUCKET_NAME = exports.URL_REGEX = exports.logPrefix = exports.SourceOrigin = exports.SpecParamType = void 0;
|
|
4
|
+
exports.getDBInstanceFromURL = getDBInstanceFromURL;
|
|
5
|
+
exports.getFirebaseProjectParams = getFirebaseProjectParams;
|
|
6
|
+
exports.substituteParams = substituteParams;
|
|
7
|
+
exports.substituteSecretParams = substituteSecretParams;
|
|
8
|
+
exports.populateDefaultParams = populateDefaultParams;
|
|
9
|
+
exports.validateCommandLineParams = validateCommandLineParams;
|
|
10
|
+
exports.validateSpec = validateSpec;
|
|
11
|
+
exports.promptForValidInstanceId = promptForValidInstanceId;
|
|
12
|
+
exports.promptForValidRepoURI = promptForValidRepoURI;
|
|
13
|
+
exports.promptForExtensionRoot = promptForExtensionRoot;
|
|
14
|
+
exports.checkExtensionsApiEnabled = checkExtensionsApiEnabled;
|
|
15
|
+
exports.ensureExtensionsApiEnabled = ensureExtensionsApiEnabled;
|
|
16
|
+
exports.ensureExtensionsPublisherApiEnabled = ensureExtensionsPublisherApiEnabled;
|
|
17
|
+
exports.getNextVersionByStage = getNextVersionByStage;
|
|
18
|
+
exports.unpackExtensionState = unpackExtensionState;
|
|
19
|
+
exports.uploadExtensionVersionFromGitHubSource = uploadExtensionVersionFromGitHubSource;
|
|
20
|
+
exports.uploadExtensionVersionFromLocalSource = uploadExtensionVersionFromLocalSource;
|
|
21
|
+
exports.getMissingPublisherError = getMissingPublisherError;
|
|
22
|
+
exports.createSourceFromLocation = createSourceFromLocation;
|
|
23
|
+
exports.getPublisherProjectFromName = getPublisherProjectFromName;
|
|
24
|
+
exports.displayReleaseNotes = displayReleaseNotes;
|
|
25
|
+
exports.promptForRepeatInstance = promptForRepeatInstance;
|
|
26
|
+
exports.instanceIdExists = instanceIdExists;
|
|
27
|
+
exports.isUrlPath = isUrlPath;
|
|
28
|
+
exports.isLocalPath = isLocalPath;
|
|
29
|
+
exports.isLocalOrURLPath = isLocalOrURLPath;
|
|
30
|
+
exports.getSourceOrigin = getSourceOrigin;
|
|
31
|
+
exports.diagnoseAndFixProject = diagnoseAndFixProject;
|
|
11
32
|
const clc = require("colorette");
|
|
12
33
|
const ora = require("ora");
|
|
13
34
|
const semver = require("semver");
|
|
@@ -46,7 +67,7 @@ var SpecParamType;
|
|
|
46
67
|
SpecParamType["STRING"] = "string";
|
|
47
68
|
SpecParamType["SELECTRESOURCE"] = "selectResource";
|
|
48
69
|
SpecParamType["SECRET"] = "secret";
|
|
49
|
-
})(SpecParamType
|
|
70
|
+
})(SpecParamType || (exports.SpecParamType = SpecParamType = {}));
|
|
50
71
|
var SourceOrigin;
|
|
51
72
|
(function (SourceOrigin) {
|
|
52
73
|
SourceOrigin["OFFICIAL_EXTENSION"] = "official extension";
|
|
@@ -55,7 +76,7 @@ var SourceOrigin;
|
|
|
55
76
|
SourceOrigin["PUBLISHED_EXTENSION_VERSION"] = "specific version of a published extension";
|
|
56
77
|
SourceOrigin["URL"] = "unpublished extension (URL source)";
|
|
57
78
|
SourceOrigin["OFFICIAL_EXTENSION_VERSION"] = "specific version of an official extension";
|
|
58
|
-
})(SourceOrigin
|
|
79
|
+
})(SourceOrigin || (exports.SourceOrigin = SourceOrigin = {}));
|
|
59
80
|
exports.logPrefix = "extensions";
|
|
60
81
|
const VALID_LICENSES = ["apache-2.0"];
|
|
61
82
|
exports.URL_REGEX = /^https:/;
|
|
@@ -87,9 +108,7 @@ function getDBInstanceFromURL(databaseUrl = "") {
|
|
|
87
108
|
}
|
|
88
109
|
return "";
|
|
89
110
|
}
|
|
90
|
-
exports.getDBInstanceFromURL = getDBInstanceFromURL;
|
|
91
111
|
async function getFirebaseProjectParams(projectId, emulatorMode = false) {
|
|
92
|
-
var _a, _b;
|
|
93
112
|
if (!projectId) {
|
|
94
113
|
return {};
|
|
95
114
|
}
|
|
@@ -108,8 +127,8 @@ async function getFirebaseProjectParams(projectId, emulatorMode = false) {
|
|
|
108
127
|
" Continuing with a fake project number - secrets and other features that require production access may behave unexpectedly.");
|
|
109
128
|
}
|
|
110
129
|
}
|
|
111
|
-
const databaseURL =
|
|
112
|
-
const storageBucket =
|
|
130
|
+
const databaseURL = body?.databaseURL ?? `https://${projectId}.firebaseio.com`;
|
|
131
|
+
const storageBucket = body?.storageBucket ?? `${projectId}.appspot.com`;
|
|
113
132
|
const FIREBASE_CONFIG = JSON.stringify({
|
|
114
133
|
projectId,
|
|
115
134
|
databaseURL,
|
|
@@ -124,7 +143,6 @@ async function getFirebaseProjectParams(projectId, emulatorMode = false) {
|
|
|
124
143
|
DATABASE_INSTANCE: getDBInstanceFromURL(databaseURL),
|
|
125
144
|
};
|
|
126
145
|
}
|
|
127
|
-
exports.getFirebaseProjectParams = getFirebaseProjectParams;
|
|
128
146
|
function substituteParams(original, params) {
|
|
129
147
|
const startingString = JSON.stringify(original);
|
|
130
148
|
const applySubstitution = (str, paramVal, paramKey) => {
|
|
@@ -139,39 +157,19 @@ function substituteParams(original, params) {
|
|
|
139
157
|
const s = Object.entries(params).reduce((str, [key, val]) => applySubstitution(str, val, key), startingString);
|
|
140
158
|
return JSON.parse(s);
|
|
141
159
|
}
|
|
142
|
-
exports.substituteParams = substituteParams;
|
|
143
160
|
async function substituteSecretParams(projectNumber, params) {
|
|
144
|
-
var _a, e_1, _b, _c;
|
|
145
161
|
const newParams = {};
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
try {
|
|
151
|
-
const [key, value] = _c;
|
|
152
|
-
if (typeof value !== "string") {
|
|
153
|
-
newParams[key] =
|
|
154
|
-
`projects/${projectNumber}/secrets/${value.name}/versions/latest`;
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
newParams[key] = value;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
finally {
|
|
161
|
-
_d = true;
|
|
162
|
-
}
|
|
162
|
+
for await (const [key, value] of Object.entries(params)) {
|
|
163
|
+
if (typeof value !== "string") {
|
|
164
|
+
newParams[key] =
|
|
165
|
+
`projects/${projectNumber}/secrets/${value.name}/versions/latest`;
|
|
163
166
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
finally {
|
|
167
|
-
try {
|
|
168
|
-
if (!_d && !_a && (_b = _e.return)) await _b.call(_e);
|
|
167
|
+
else {
|
|
168
|
+
newParams[key] = value;
|
|
169
169
|
}
|
|
170
|
-
finally { if (e_1) throw e_1.error; }
|
|
171
170
|
}
|
|
172
171
|
return newParams;
|
|
173
172
|
}
|
|
174
|
-
exports.substituteSecretParams = substituteSecretParams;
|
|
175
173
|
function populateDefaultParams(paramVars, paramSpecs) {
|
|
176
174
|
const newParams = paramVars;
|
|
177
175
|
for (const param of paramSpecs) {
|
|
@@ -187,7 +185,6 @@ function populateDefaultParams(paramVars, paramSpecs) {
|
|
|
187
185
|
}
|
|
188
186
|
return newParams;
|
|
189
187
|
}
|
|
190
|
-
exports.populateDefaultParams = populateDefaultParams;
|
|
191
188
|
function validateCommandLineParams(envVars, paramSpec) {
|
|
192
189
|
const paramNames = paramSpec.map((p) => p.param);
|
|
193
190
|
const misnamedParams = Object.keys(envVars).filter((key) => {
|
|
@@ -207,7 +204,6 @@ function validateCommandLineParams(envVars, paramSpec) {
|
|
|
207
204
|
throw new error_1.FirebaseError(`Some param values are not valid. Please check your params file.`);
|
|
208
205
|
}
|
|
209
206
|
}
|
|
210
|
-
exports.validateCommandLineParams = validateCommandLineParams;
|
|
211
207
|
function validateSpec(spec) {
|
|
212
208
|
const errors = [];
|
|
213
209
|
if (!spec.name) {
|
|
@@ -301,7 +297,6 @@ function validateSpec(spec) {
|
|
|
301
297
|
throw new error_1.FirebaseError(message);
|
|
302
298
|
}
|
|
303
299
|
}
|
|
304
|
-
exports.validateSpec = validateSpec;
|
|
305
300
|
async function promptForValidInstanceId(instanceId) {
|
|
306
301
|
let instanceIdIsValid = false;
|
|
307
302
|
let newInstanceId = "";
|
|
@@ -324,7 +319,6 @@ async function promptForValidInstanceId(instanceId) {
|
|
|
324
319
|
}
|
|
325
320
|
return newInstanceId;
|
|
326
321
|
}
|
|
327
|
-
exports.promptForValidInstanceId = promptForValidInstanceId;
|
|
328
322
|
async function promptForValidRepoURI() {
|
|
329
323
|
let repoIsValid = false;
|
|
330
324
|
let extensionRoot = "";
|
|
@@ -339,14 +333,12 @@ async function promptForValidRepoURI() {
|
|
|
339
333
|
}
|
|
340
334
|
return extensionRoot;
|
|
341
335
|
}
|
|
342
|
-
exports.promptForValidRepoURI = promptForValidRepoURI;
|
|
343
336
|
async function promptForExtensionRoot(defaultRoot) {
|
|
344
337
|
return await (0, prompt_1.input)({
|
|
345
338
|
message: "Enter this extension's root directory in the repo (defaults to previous root if set):",
|
|
346
339
|
default: defaultRoot,
|
|
347
340
|
});
|
|
348
341
|
}
|
|
349
|
-
exports.promptForExtensionRoot = promptForExtensionRoot;
|
|
350
342
|
async function promptForReleaseStage(args) {
|
|
351
343
|
let stage = "rc";
|
|
352
344
|
if (!args.nonInteractive) {
|
|
@@ -392,7 +384,6 @@ async function checkExtensionsApiEnabled(options) {
|
|
|
392
384
|
}
|
|
393
385
|
return await (0, ensureApiEnabled_1.check)(projectId, (0, api_1.extensionsOrigin)(), "extensions", options.markdown);
|
|
394
386
|
}
|
|
395
|
-
exports.checkExtensionsApiEnabled = checkExtensionsApiEnabled;
|
|
396
387
|
async function ensureExtensionsApiEnabled(options) {
|
|
397
388
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
398
389
|
if (!projectId) {
|
|
@@ -400,7 +391,6 @@ async function ensureExtensionsApiEnabled(options) {
|
|
|
400
391
|
}
|
|
401
392
|
return await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.extensionsOrigin)(), "extensions", options.markdown);
|
|
402
393
|
}
|
|
403
|
-
exports.ensureExtensionsApiEnabled = ensureExtensionsApiEnabled;
|
|
404
394
|
async function ensureExtensionsPublisherApiEnabled(options) {
|
|
405
395
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
406
396
|
if (!projectId) {
|
|
@@ -408,7 +398,6 @@ async function ensureExtensionsPublisherApiEnabled(options) {
|
|
|
408
398
|
}
|
|
409
399
|
return await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.extensionsPublisherOrigin)(), "extensions", options.markdown);
|
|
410
400
|
}
|
|
411
|
-
exports.ensureExtensionsPublisherApiEnabled = ensureExtensionsPublisherApiEnabled;
|
|
412
401
|
async function archiveAndUploadSource(extPath, bucketName) {
|
|
413
402
|
const zippedSource = await (0, archiveDirectory_1.archiveDirectory)(extPath, {
|
|
414
403
|
ignore: ["node_modules", ".git"],
|
|
@@ -441,7 +430,6 @@ async function getNextVersionByStage(extensionRef, newVersion) {
|
|
|
441
430
|
versionByStage.set("stable", newVersion);
|
|
442
431
|
return { versionByStage, hasVersions: extensionVersions.length > 0 };
|
|
443
432
|
}
|
|
444
|
-
exports.getNextVersionByStage = getNextVersionByStage;
|
|
445
433
|
async function validateExtensionSpec(rootDirectory, extensionId) {
|
|
446
434
|
const extensionSpec = await (0, localHelper_1.getLocalExtensionSpec)(rootDirectory);
|
|
447
435
|
if (extensionSpec.name !== extensionId) {
|
|
@@ -500,20 +488,18 @@ function unpackExtensionState(extension) {
|
|
|
500
488
|
return "-";
|
|
501
489
|
}
|
|
502
490
|
}
|
|
503
|
-
exports.unpackExtensionState = unpackExtensionState;
|
|
504
491
|
function displayExtensionHeader(extensionRef, extension, extensionRoot) {
|
|
505
|
-
var _a, _b;
|
|
506
492
|
if (extension) {
|
|
507
493
|
let source = "Local source";
|
|
508
494
|
if (extension.repoUri) {
|
|
509
495
|
const uri = new URL(extension.repoUri);
|
|
510
|
-
uri.pathname = path.join(uri.pathname, extensionRoot
|
|
496
|
+
uri.pathname = path.join(uri.pathname, extensionRoot ?? "");
|
|
511
497
|
source = `${uri.toString()} (use --repo and --root to modify)`;
|
|
512
498
|
}
|
|
513
499
|
logger_1.logger.info(`\n${clc.bold("Extension:")} ${extension.ref}\n` +
|
|
514
500
|
`${clc.bold("State:")} ${unpackExtensionState(extension)}\n` +
|
|
515
|
-
`${clc.bold("Latest Version:")} ${
|
|
516
|
-
`${clc.bold("Version in Extensions Hub:")} ${
|
|
501
|
+
`${clc.bold("Latest Version:")} ${extension.latestVersion ?? "-"}\n` +
|
|
502
|
+
`${clc.bold("Version in Extensions Hub:")} ${extension.latestApprovedVersion ?? "-"}\n` +
|
|
517
503
|
`${clc.bold("Source in GitHub:")} ${source}\n`);
|
|
518
504
|
}
|
|
519
505
|
else {
|
|
@@ -550,7 +536,6 @@ async function fetchExtensionSource(repoUri, sourceRef, extensionRoot) {
|
|
|
550
536
|
return rootDirectory;
|
|
551
537
|
}
|
|
552
538
|
async function uploadExtensionVersionFromGitHubSource(args) {
|
|
553
|
-
var _a, _b, _c;
|
|
554
539
|
const extensionRef = `${args.publisherId}/${args.extensionId}`;
|
|
555
540
|
let extension;
|
|
556
541
|
let latestVersion;
|
|
@@ -560,14 +545,14 @@ async function uploadExtensionVersionFromGitHubSource(args) {
|
|
|
560
545
|
}
|
|
561
546
|
catch (err) {
|
|
562
547
|
}
|
|
563
|
-
displayExtensionHeader(extensionRef, extension, latestVersion
|
|
548
|
+
displayExtensionHeader(extensionRef, extension, latestVersion?.extensionRoot);
|
|
564
549
|
if (args.stage && !stageOptions.includes(args.stage)) {
|
|
565
550
|
throw new error_1.FirebaseError(`--stage only supports the following values: ${stageOptions.join(", ")}`);
|
|
566
551
|
}
|
|
567
552
|
if (args.repoUri && !repoRegex.test(args.repoUri)) {
|
|
568
553
|
throw new error_1.FirebaseError("Repo URI must follow this format: https://github.com/<user>/<repo>");
|
|
569
554
|
}
|
|
570
|
-
let repoUri = args.repoUri ||
|
|
555
|
+
let repoUri = args.repoUri || extension?.repoUri;
|
|
571
556
|
if (!repoUri) {
|
|
572
557
|
if (!args.nonInteractive) {
|
|
573
558
|
repoUri = await promptForValidRepoURI();
|
|
@@ -576,7 +561,7 @@ async function uploadExtensionVersionFromGitHubSource(args) {
|
|
|
576
561
|
throw new error_1.FirebaseError("Repo URI is required but not currently set.");
|
|
577
562
|
}
|
|
578
563
|
}
|
|
579
|
-
let extensionRoot = args.extensionRoot ||
|
|
564
|
+
let extensionRoot = args.extensionRoot || latestVersion?.extensionRoot;
|
|
580
565
|
if (!extensionRoot) {
|
|
581
566
|
const defaultRoot = "/";
|
|
582
567
|
if (!args.nonInteractive) {
|
|
@@ -606,12 +591,12 @@ async function uploadExtensionVersionFromGitHubSource(args) {
|
|
|
606
591
|
}
|
|
607
592
|
const rootDirectory = await fetchExtensionSource(repoUri, sourceRef, extensionRoot);
|
|
608
593
|
const extensionSpec = await validateExtensionSpec(rootDirectory, args.extensionId);
|
|
609
|
-
validateVersion(extensionRef, extensionSpec.version, extension
|
|
594
|
+
validateVersion(extensionRef, extensionSpec.version, extension?.latestVersion);
|
|
610
595
|
const { versionByStage, hasVersions } = await getNextVersionByStage(extensionRef, extensionSpec.version);
|
|
611
|
-
const autoReview = !!
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
596
|
+
const autoReview = !!extension?.latestApprovedVersion ||
|
|
597
|
+
latestVersion?.listing?.state === "PENDING" ||
|
|
598
|
+
latestVersion?.listing?.state === "APPROVED" ||
|
|
599
|
+
latestVersion?.listing?.state === "REJECTED";
|
|
615
600
|
let stage = args.stage;
|
|
616
601
|
if (!stage) {
|
|
617
602
|
stage = await promptForReleaseStage({
|
|
@@ -664,7 +649,6 @@ async function uploadExtensionVersionFromGitHubSource(args) {
|
|
|
664
649
|
}
|
|
665
650
|
return res;
|
|
666
651
|
}
|
|
667
|
-
exports.uploadExtensionVersionFromGitHubSource = uploadExtensionVersionFromGitHubSource;
|
|
668
652
|
async function uploadExtensionVersionFromLocalSource(args) {
|
|
669
653
|
const extensionRef = `${args.publisherId}/${args.extensionId}`;
|
|
670
654
|
let extension;
|
|
@@ -675,13 +659,13 @@ async function uploadExtensionVersionFromLocalSource(args) {
|
|
|
675
659
|
}
|
|
676
660
|
catch (err) {
|
|
677
661
|
}
|
|
678
|
-
displayExtensionHeader(extensionRef, extension, latestVersion
|
|
662
|
+
displayExtensionHeader(extensionRef, extension, latestVersion?.extensionRoot);
|
|
679
663
|
const localStageOptions = ["rc", "alpha", "beta"];
|
|
680
664
|
if (args.stage && !localStageOptions.includes(args.stage)) {
|
|
681
665
|
throw new error_1.FirebaseError(`--stage only supports the following values when used with --local: ${localStageOptions.join(", ")}`);
|
|
682
666
|
}
|
|
683
667
|
const extensionSpec = await validateExtensionSpec(args.rootDirectory, args.extensionId);
|
|
684
|
-
validateVersion(extensionRef, extensionSpec.version, extension
|
|
668
|
+
validateVersion(extensionRef, extensionSpec.version, extension?.latestVersion);
|
|
685
669
|
const { versionByStage } = await getNextVersionByStage(extensionRef, extensionSpec.version);
|
|
686
670
|
let stage = args.stage;
|
|
687
671
|
if (!stage) {
|
|
@@ -744,11 +728,9 @@ async function uploadExtensionVersionFromLocalSource(args) {
|
|
|
744
728
|
await deleteUploadedSource(objectPath);
|
|
745
729
|
return res;
|
|
746
730
|
}
|
|
747
|
-
exports.uploadExtensionVersionFromLocalSource = uploadExtensionVersionFromLocalSource;
|
|
748
731
|
function getMissingPublisherError(publisherId) {
|
|
749
732
|
return new error_1.FirebaseError(`Couldn't find publisher ID '${clc.bold(publisherId)}'. Please ensure that you have registered this ID. For step-by-step instructions on getting started as a publisher, see https://firebase.google.com/docs/extensions/publishers/get-started.`);
|
|
750
733
|
}
|
|
751
|
-
exports.getMissingPublisherError = getMissingPublisherError;
|
|
752
734
|
async function createSourceFromLocation(projectId, sourceUri) {
|
|
753
735
|
const extensionRoot = "/";
|
|
754
736
|
let packageUri;
|
|
@@ -771,7 +753,6 @@ async function createSourceFromLocation(projectId, sourceUri) {
|
|
|
771
753
|
});
|
|
772
754
|
}
|
|
773
755
|
}
|
|
774
|
-
exports.createSourceFromLocation = createSourceFromLocation;
|
|
775
756
|
async function deleteUploadedSource(objectPath) {
|
|
776
757
|
if (objectPath.length) {
|
|
777
758
|
try {
|
|
@@ -791,7 +772,6 @@ function getPublisherProjectFromName(publisherName) {
|
|
|
791
772
|
}
|
|
792
773
|
throw new error_1.FirebaseError(`Could not find publisher with name '${publisherName}'.`);
|
|
793
774
|
}
|
|
794
|
-
exports.getPublisherProjectFromName = getPublisherProjectFromName;
|
|
795
775
|
function displayReleaseNotes(args) {
|
|
796
776
|
const source = args.sourceUri || "Local source";
|
|
797
777
|
const releaseNotesMessage = args.releaseNotes
|
|
@@ -806,7 +786,6 @@ function displayReleaseNotes(args) {
|
|
|
806
786
|
`Once an extension version is uploaded, it becomes installable by other users and cannot be changed. If you wish to make changes after uploading, you will need to upload a new version.\n`;
|
|
807
787
|
logger_1.logger.info(message);
|
|
808
788
|
}
|
|
809
|
-
exports.displayReleaseNotes = displayReleaseNotes;
|
|
810
789
|
async function promptForRepeatInstance(projectName, extensionName) {
|
|
811
790
|
const message = `An extension with the ID '${clc.bold(extensionName)}' already exists in the project '${clc.bold(projectName)}'. What would you like to do?`;
|
|
812
791
|
return await (0, prompt_1.select)({
|
|
@@ -818,7 +797,6 @@ async function promptForRepeatInstance(projectName, extensionName) {
|
|
|
818
797
|
],
|
|
819
798
|
});
|
|
820
799
|
}
|
|
821
|
-
exports.promptForRepeatInstance = promptForRepeatInstance;
|
|
822
800
|
async function instanceIdExists(projectId, instanceId) {
|
|
823
801
|
try {
|
|
824
802
|
await (0, extensionsApi_1.getInstance)(projectId, instanceId);
|
|
@@ -839,11 +817,9 @@ async function instanceIdExists(projectId, instanceId) {
|
|
|
839
817
|
}
|
|
840
818
|
return true;
|
|
841
819
|
}
|
|
842
|
-
exports.instanceIdExists = instanceIdExists;
|
|
843
820
|
function isUrlPath(extInstallPath) {
|
|
844
821
|
return extInstallPath.startsWith("https:");
|
|
845
822
|
}
|
|
846
|
-
exports.isUrlPath = isUrlPath;
|
|
847
823
|
function isLocalPath(extInstallPath) {
|
|
848
824
|
const trimmedPath = extInstallPath.trim();
|
|
849
825
|
return (trimmedPath.startsWith(`~${path.sep}`) ||
|
|
@@ -856,11 +832,9 @@ function isLocalPath(extInstallPath) {
|
|
|
856
832
|
trimmedPath.startsWith(`/`) ||
|
|
857
833
|
[".", ".."].includes(trimmedPath));
|
|
858
834
|
}
|
|
859
|
-
exports.isLocalPath = isLocalPath;
|
|
860
835
|
function isLocalOrURLPath(extInstallPath) {
|
|
861
836
|
return isLocalPath(extInstallPath) || isUrlPath(extInstallPath);
|
|
862
837
|
}
|
|
863
|
-
exports.isLocalOrURLPath = isLocalOrURLPath;
|
|
864
838
|
function getSourceOrigin(sourceOrVersion) {
|
|
865
839
|
if (isLocalPath(sourceOrVersion)) {
|
|
866
840
|
return SourceOrigin.LOCAL;
|
|
@@ -884,7 +858,6 @@ function getSourceOrigin(sourceOrVersion) {
|
|
|
884
858
|
}
|
|
885
859
|
throw new error_1.FirebaseError(`Could not find source '${clc.bold(sourceOrVersion)}'. Check to make sure the source is correct, and then please try again.`);
|
|
886
860
|
}
|
|
887
|
-
exports.getSourceOrigin = getSourceOrigin;
|
|
888
861
|
async function diagnoseAndFixProject(options) {
|
|
889
862
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
890
863
|
if (!projectId) {
|
|
@@ -895,4 +868,3 @@ async function diagnoseAndFixProject(options) {
|
|
|
895
868
|
throw new error_1.FirebaseError("Unable to proceed until all issues are resolved.");
|
|
896
869
|
}
|
|
897
870
|
}
|
|
898
|
-
exports.diagnoseAndFixProject = diagnoseAndFixProject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listExtensions =
|
|
3
|
+
exports.listExtensions = listExtensions;
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const Table = require("cli-table3");
|
|
6
6
|
const extensionsApi_1 = require("./extensionsApi");
|
|
@@ -21,7 +21,6 @@ async function listExtensions(projectId) {
|
|
|
21
21
|
const sorted = instances.sort((a, b) => new Date(b.createTime).valueOf() - new Date(a.createTime).valueOf());
|
|
22
22
|
const formatted = [];
|
|
23
23
|
sorted.forEach((instance) => {
|
|
24
|
-
var _a, _b, _c, _d;
|
|
25
24
|
let extension = instance.config.extensionRef || "";
|
|
26
25
|
let publisher;
|
|
27
26
|
if (extension === "") {
|
|
@@ -31,10 +30,10 @@ async function listExtensions(projectId) {
|
|
|
31
30
|
else {
|
|
32
31
|
publisher = extension.split("/")[0];
|
|
33
32
|
}
|
|
34
|
-
const instanceId = (
|
|
33
|
+
const instanceId = (0, utils_1.last)(instance.name.split("/")) ?? "";
|
|
35
34
|
const state = instance.state +
|
|
36
35
|
((instance.config.source.state || "ACTIVE") === "DELETED" ? " (UNPUBLISHED)" : "");
|
|
37
|
-
const version =
|
|
36
|
+
const version = instance?.config?.source?.spec?.version;
|
|
38
37
|
const updateTime = extensionsUtils.formatTimestamp(instance.updateTime);
|
|
39
38
|
table.push([extension, publisher, instanceId, state, version, updateTime]);
|
|
40
39
|
formatted.push({
|
|
@@ -50,4 +49,3 @@ async function listExtensions(projectId) {
|
|
|
50
49
|
logger_1.logger.info(table.toString());
|
|
51
50
|
return formatted;
|
|
52
51
|
}
|
|
53
|
-
exports.listExtensions = listExtensions;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.EXTENSIONS_SPEC_FILE = void 0;
|
|
4
|
+
exports.getLocalExtensionSpec = getLocalExtensionSpec;
|
|
5
|
+
exports.findExtensionYaml = findExtensionYaml;
|
|
6
|
+
exports.readFile = readFile;
|
|
7
|
+
exports.isLocalExtension = isLocalExtension;
|
|
4
8
|
const fs = require("fs-extra");
|
|
5
9
|
const path = require("path");
|
|
6
10
|
const yaml = require("yaml");
|
|
@@ -29,7 +33,6 @@ async function getLocalExtensionSpec(directory) {
|
|
|
29
33
|
}
|
|
30
34
|
return spec;
|
|
31
35
|
}
|
|
32
|
-
exports.getLocalExtensionSpec = getLocalExtensionSpec;
|
|
33
36
|
function fixLifecycleEvents(lifecycleEvents) {
|
|
34
37
|
const stages = {
|
|
35
38
|
onInstall: "ON_INSTALL",
|
|
@@ -62,7 +65,6 @@ function findExtensionYaml(directory) {
|
|
|
62
65
|
}
|
|
63
66
|
return directory;
|
|
64
67
|
}
|
|
65
|
-
exports.findExtensionYaml = findExtensionYaml;
|
|
66
68
|
function readFile(pathToFile) {
|
|
67
69
|
try {
|
|
68
70
|
return fs.readFileSync(pathToFile, "utf8");
|
|
@@ -74,7 +76,6 @@ function readFile(pathToFile) {
|
|
|
74
76
|
throw new error_1.FirebaseError(`Failed to read file at "${pathToFile}"`, { original: err });
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
|
-
exports.readFile = readFile;
|
|
78
79
|
function isLocalExtension(extensionName) {
|
|
79
80
|
try {
|
|
80
81
|
fs.readdirSync(extensionName);
|
|
@@ -84,7 +85,6 @@ function isLocalExtension(extensionName) {
|
|
|
84
85
|
}
|
|
85
86
|
return true;
|
|
86
87
|
}
|
|
87
|
-
exports.isLocalExtension = isLocalExtension;
|
|
88
88
|
function parseYAML(source) {
|
|
89
89
|
try {
|
|
90
90
|
return yaml.parse(source);
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ENV_DIRECTORY = void 0;
|
|
4
|
+
exports.writeToManifest = writeToManifest;
|
|
5
|
+
exports.writeEmptyManifest = writeEmptyManifest;
|
|
6
|
+
exports.writeLocalSecrets = writeLocalSecrets;
|
|
7
|
+
exports.removeFromManifest = removeFromManifest;
|
|
8
|
+
exports.loadConfig = loadConfig;
|
|
9
|
+
exports.instanceExists = instanceExists;
|
|
10
|
+
exports.getInstanceTarget = getInstanceTarget;
|
|
11
|
+
exports.getInstanceRef = getInstanceRef;
|
|
12
|
+
exports.writeExtensionsToFirebaseJson = writeExtensionsToFirebaseJson;
|
|
13
|
+
exports.readInstanceParam = readInstanceParam;
|
|
4
14
|
const path = require("path");
|
|
5
15
|
const fs = require("fs-extra");
|
|
6
16
|
const refs = require("./refs");
|
|
@@ -38,7 +48,6 @@ async function writeToManifest(specs, config, options, allowOverwrite = false) {
|
|
|
38
48
|
await writeEnvFiles(specs, config, options.force);
|
|
39
49
|
await writeLocalSecrets(specs, config, options.force);
|
|
40
50
|
}
|
|
41
|
-
exports.writeToManifest = writeToManifest;
|
|
42
51
|
async function writeEmptyManifest(config, options) {
|
|
43
52
|
if (!fs.existsSync(config.path("extensions"))) {
|
|
44
53
|
fs.mkdirSync(config.path("extensions"));
|
|
@@ -49,8 +58,8 @@ async function writeEmptyManifest(config, options) {
|
|
|
49
58
|
.join("\n\t");
|
|
50
59
|
if (!(await (0, prompt_1.confirm)({
|
|
51
60
|
message: `firebase.json already contains extensions:\n${currentExtensions}\nWould you like to overwrite them?`,
|
|
52
|
-
nonInteractive: options
|
|
53
|
-
force: options
|
|
61
|
+
nonInteractive: options?.nonInteractive,
|
|
62
|
+
force: options?.force,
|
|
54
63
|
default: false,
|
|
55
64
|
}))) {
|
|
56
65
|
return;
|
|
@@ -58,7 +67,6 @@ async function writeEmptyManifest(config, options) {
|
|
|
58
67
|
}
|
|
59
68
|
config.set("extensions", {});
|
|
60
69
|
}
|
|
61
|
-
exports.writeEmptyManifest = writeEmptyManifest;
|
|
62
70
|
async function writeLocalSecrets(specs, config, force) {
|
|
63
71
|
for (const spec of specs) {
|
|
64
72
|
const extensionSpec = await (0, planner_1.getExtensionSpec)(spec);
|
|
@@ -66,7 +74,7 @@ async function writeLocalSecrets(specs, config, force) {
|
|
|
66
74
|
continue;
|
|
67
75
|
}
|
|
68
76
|
const writeBuffer = {};
|
|
69
|
-
const locallyOverridenSecretParams = extensionSpec.params.filter((p) =>
|
|
77
|
+
const locallyOverridenSecretParams = extensionSpec.params.filter((p) => p.type === types_1.ParamType.SECRET && spec.params[p.param]?.local);
|
|
70
78
|
for (const paramSpec of locallyOverridenSecretParams) {
|
|
71
79
|
const key = paramSpec.param;
|
|
72
80
|
const localValue = spec.params[key].local;
|
|
@@ -83,7 +91,6 @@ async function writeLocalSecrets(specs, config, force) {
|
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
}
|
|
86
|
-
exports.writeLocalSecrets = writeLocalSecrets;
|
|
87
94
|
function removeFromManifest(instanceId, config) {
|
|
88
95
|
if (!instanceExists(instanceId, config)) {
|
|
89
96
|
throw new error_1.FirebaseError(`Extension instance ${instanceId} not found in firebase.json.`);
|
|
@@ -104,7 +111,6 @@ function removeFromManifest(instanceId, config) {
|
|
|
104
111
|
logger_1.logger.info(`Removed extension instance local secret config extensions/${instanceId}.secret.local`);
|
|
105
112
|
}
|
|
106
113
|
}
|
|
107
|
-
exports.removeFromManifest = removeFromManifest;
|
|
108
114
|
function loadConfig(options) {
|
|
109
115
|
const existingConfig = config_1.Config.load(options, true);
|
|
110
116
|
if (!existingConfig) {
|
|
@@ -112,18 +118,15 @@ function loadConfig(options) {
|
|
|
112
118
|
}
|
|
113
119
|
return existingConfig;
|
|
114
120
|
}
|
|
115
|
-
exports.loadConfig = loadConfig;
|
|
116
121
|
function instanceExists(instanceId, config) {
|
|
117
122
|
return !!config.get("extensions", {})[instanceId];
|
|
118
123
|
}
|
|
119
|
-
exports.instanceExists = instanceExists;
|
|
120
124
|
function getInstanceTarget(instanceId, config) {
|
|
121
125
|
if (!instanceExists(instanceId, config)) {
|
|
122
126
|
throw new error_1.FirebaseError(`Could not find extension instance ${instanceId} in firebase.json`);
|
|
123
127
|
}
|
|
124
128
|
return config.get("extensions", {})[instanceId];
|
|
125
129
|
}
|
|
126
|
-
exports.getInstanceTarget = getInstanceTarget;
|
|
127
130
|
function getInstanceRef(instanceId, config) {
|
|
128
131
|
const source = getInstanceTarget(instanceId, config);
|
|
129
132
|
if ((0, extensionsHelper_1.isLocalPath)(source)) {
|
|
@@ -131,7 +134,6 @@ function getInstanceRef(instanceId, config) {
|
|
|
131
134
|
}
|
|
132
135
|
return refs.parse(source);
|
|
133
136
|
}
|
|
134
|
-
exports.getInstanceRef = getInstanceRef;
|
|
135
137
|
function writeExtensionsToFirebaseJson(specs, config) {
|
|
136
138
|
const extensions = config.get("extensions", {});
|
|
137
139
|
for (const s of specs) {
|
|
@@ -150,7 +152,6 @@ function writeExtensionsToFirebaseJson(specs, config) {
|
|
|
150
152
|
config.set("extensions", extensions);
|
|
151
153
|
config.writeProjectFile("firebase.json", config.src);
|
|
152
154
|
}
|
|
153
|
-
exports.writeExtensionsToFirebaseJson = writeExtensionsToFirebaseJson;
|
|
154
155
|
async function writeEnvFiles(specs, config, force) {
|
|
155
156
|
for (const spec of specs) {
|
|
156
157
|
const content = Object.entries(spec.params)
|
|
@@ -164,8 +165,7 @@ async function writeEnvFiles(specs, config, force) {
|
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
167
|
function readInstanceParam(args) {
|
|
167
|
-
|
|
168
|
-
const aliases = (_a = args.aliases) !== null && _a !== void 0 ? _a : [];
|
|
168
|
+
const aliases = args.aliases ?? [];
|
|
169
169
|
const filesToCheck = [
|
|
170
170
|
`${args.instanceId}.env`,
|
|
171
171
|
...aliases.map((alias) => `${args.instanceId}.env.${alias}`),
|
|
@@ -193,7 +193,6 @@ function readInstanceParam(args) {
|
|
|
193
193
|
}
|
|
194
194
|
return combinedParams;
|
|
195
195
|
}
|
|
196
|
-
exports.readInstanceParam = readInstanceParam;
|
|
197
196
|
function readParamsFile(projectDir, fileName) {
|
|
198
197
|
const paramPath = path.join(projectDir, exports.ENV_DIRECTORY, fileName);
|
|
199
198
|
const params = (0, paramHelper_1.readEnvFile)(paramPath);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseTimeseriesResponse = parseTimeseriesResponse;
|
|
4
|
+
exports.parseBucket = parseBucket;
|
|
5
|
+
exports.buildMetricsTableRow = buildMetricsTableRow;
|
|
4
6
|
const semver = require("semver");
|
|
5
7
|
const clc = require("colorette");
|
|
6
8
|
function parseTimeseriesResponse(series) {
|
|
@@ -40,7 +42,6 @@ function parseTimeseriesResponse(series) {
|
|
|
40
42
|
});
|
|
41
43
|
return ret;
|
|
42
44
|
}
|
|
43
|
-
exports.parseTimeseriesResponse = parseTimeseriesResponse;
|
|
44
45
|
function parseBucket(value) {
|
|
45
46
|
const v = Number(value);
|
|
46
47
|
if (v >= 200) {
|
|
@@ -51,7 +52,6 @@ function parseBucket(value) {
|
|
|
51
52
|
}
|
|
52
53
|
return { low: 0, high: 0 };
|
|
53
54
|
}
|
|
54
|
-
exports.parseBucket = parseBucket;
|
|
55
55
|
function buildMetricsTableRow(metric) {
|
|
56
56
|
const ret = [metric.ref.version];
|
|
57
57
|
if (metric.valueToday) {
|
|
@@ -64,7 +64,6 @@ function buildMetricsTableRow(metric) {
|
|
|
64
64
|
ret.push(renderChangeCell(metric.value28dAgo, metric.valueToday));
|
|
65
65
|
return ret;
|
|
66
66
|
}
|
|
67
|
-
exports.buildMetricsTableRow = buildMetricsTableRow;
|
|
68
67
|
function renderChangeCell(before, after) {
|
|
69
68
|
if (!(before && after)) {
|
|
70
69
|
return "Insufficient data";
|