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,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
exports.printVersionsTable = printVersionsTable;
|
|
4
5
|
const logger_1 = require("../logger");
|
|
5
6
|
const rcVersion = require("../remoteconfig/versionslist");
|
|
6
7
|
const command_1 = require("../command");
|
|
@@ -11,9 +12,8 @@ const utils_1 = require("../utils");
|
|
|
11
12
|
const Table = require("cli-table3");
|
|
12
13
|
const tableHead = ["Update User", "Version Number", "Update Time"];
|
|
13
14
|
function pushTableContents(table, version) {
|
|
14
|
-
var _a;
|
|
15
15
|
return table.push([
|
|
16
|
-
|
|
16
|
+
version.updateUser?.email,
|
|
17
17
|
version.versionNumber,
|
|
18
18
|
version.updateTime ? (0, utils_1.datetimeString)(new Date(version.updateTime)) : "",
|
|
19
19
|
]);
|
|
@@ -35,4 +35,3 @@ function printVersionsTable(versionsList) {
|
|
|
35
35
|
}
|
|
36
36
|
logger_1.logger.info(table.toString());
|
|
37
37
|
}
|
|
38
|
-
exports.printVersionsTable = printVersionsTable;
|
package/lib/commands/use.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.command =
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
exports.setNewActive = setNewActive;
|
|
4
5
|
const clc = require("colorette");
|
|
5
6
|
const command_1 = require("../command");
|
|
6
7
|
const projects_1 = require("../management/projects");
|
|
@@ -40,7 +41,7 @@ async function setNewActive(projectOrAlias, aliasOpt, rc, projectRoot) {
|
|
|
40
41
|
try {
|
|
41
42
|
project = await (0, projects_1.getProject)(resolvedProject);
|
|
42
43
|
}
|
|
43
|
-
catch
|
|
44
|
+
catch {
|
|
44
45
|
throw new error_1.FirebaseError("Invalid project selection, " + verifyMessage(projectOrAlias));
|
|
45
46
|
}
|
|
46
47
|
if ((0, env_1.isFirebaseStudio)()) {
|
|
@@ -68,7 +69,6 @@ async function setNewActive(projectOrAlias, aliasOpt, rc, projectRoot) {
|
|
|
68
69
|
throw new error_1.FirebaseError(`Invalid project selection, ${verifyMessage(projectOrAlias)}`);
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
exports.setNewActive = setNewActive;
|
|
72
72
|
function unalias(alias, options) {
|
|
73
73
|
if (options.rc.hasProjectAlias(alias)) {
|
|
74
74
|
options.rc.removeProjectAlias(alias);
|
package/lib/config.js
CHANGED
|
@@ -16,7 +16,6 @@ const logger_1 = require("./logger");
|
|
|
16
16
|
const loadCJSON_1 = require("./loadCJSON");
|
|
17
17
|
class Config {
|
|
18
18
|
constructor(src, options = {}) {
|
|
19
|
-
var _a, _b;
|
|
20
19
|
this.data = {};
|
|
21
20
|
this.defaults = {};
|
|
22
21
|
this.notes = {};
|
|
@@ -30,8 +29,8 @@ class Config {
|
|
|
30
29
|
clc.bold("firebase use --add") +
|
|
31
30
|
" instead");
|
|
32
31
|
}
|
|
33
|
-
if (
|
|
34
|
-
this._src.database =
|
|
32
|
+
if (this._src?.rules) {
|
|
33
|
+
this._src.database = { ...this._src.database, rules: this._src.rules };
|
|
35
34
|
}
|
|
36
35
|
Config.MATERIALIZE_TARGETS.forEach((target) => {
|
|
37
36
|
if (_.get(this._src, target)) {
|
|
@@ -64,8 +63,8 @@ class Config {
|
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
|
-
if (
|
|
68
|
-
(Array.isArray(this._src.dataconnect) && this._src.dataconnect.some((c) => c
|
|
66
|
+
if (this._src.dataconnect?.location ||
|
|
67
|
+
(Array.isArray(this._src.dataconnect) && this._src.dataconnect.some((c) => c?.location))) {
|
|
69
68
|
utils.logLabeledWarning("dataconnect", "'location' has been moved from 'firebase.json' to 'dataconnect.yaml'. " +
|
|
70
69
|
"Please remove 'dataconnect.location' from 'firebase.json' and add it as top level field to 'dataconnect.yaml' instead ");
|
|
71
70
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fetchBuildtoolsJar = fetchBuildtoolsJar;
|
|
4
|
+
exports.runBuildtoolsCommand = runBuildtoolsCommand;
|
|
4
5
|
const fs = require("fs-extra");
|
|
5
6
|
const os = require("os");
|
|
6
7
|
const path = require("path");
|
|
@@ -34,18 +35,15 @@ async function fetchBuildtoolsJar() {
|
|
|
34
35
|
fs.copySync(tmpfile, jarPath);
|
|
35
36
|
return jarPath;
|
|
36
37
|
}
|
|
37
|
-
exports.fetchBuildtoolsJar = fetchBuildtoolsJar;
|
|
38
38
|
function runBuildtoolsCommand(jarFile, args, debug) {
|
|
39
|
-
var _a;
|
|
40
39
|
const fullArgs = ["-jar", jarFile, ...args, "-clientName", "firebase-cli;crashlytics-buildtools"];
|
|
41
40
|
const outputs = spawn.sync("java", fullArgs, {
|
|
42
41
|
stdio: debug ? "inherit" : "pipe",
|
|
43
42
|
});
|
|
44
43
|
if (outputs.status !== 0) {
|
|
45
44
|
if (!debug) {
|
|
46
|
-
utils.logWarning(
|
|
45
|
+
utils.logWarning(outputs.stdout?.toString() || "An unknown error occurred");
|
|
47
46
|
}
|
|
48
47
|
throw new error_1.FirebaseError(`java command failed with args: ${fullArgs}`);
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
exports.runBuildtoolsCommand = runBuildtoolsCommand;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.listEvents = listEvents;
|
|
4
|
+
exports.batchGetEvents = batchGetEvents;
|
|
4
5
|
const logger_1 = require("../logger");
|
|
5
6
|
const error_1 = require("../error");
|
|
6
7
|
const utils_1 = require("./utils");
|
|
7
8
|
const filters_1 = require("./filters");
|
|
8
9
|
async function listEvents(appId, filter, pageSize = 1) {
|
|
9
10
|
var _a;
|
|
10
|
-
var _b;
|
|
11
11
|
const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
|
|
12
12
|
const queryParams = (0, filters_1.filterToUrlSearchParams)(filter);
|
|
13
13
|
queryParams.set("page_size", `${pageSize}`);
|
|
@@ -21,13 +21,11 @@ async function listEvents(appId, filter, pageSize = 1) {
|
|
|
21
21
|
queryParams: queryParams,
|
|
22
22
|
timeout: utils_1.TIMEOUT,
|
|
23
23
|
});
|
|
24
|
-
(_a =
|
|
24
|
+
(_a = response.body).events ?? (_a.events = []);
|
|
25
25
|
return response.body;
|
|
26
26
|
}
|
|
27
|
-
exports.listEvents = listEvents;
|
|
28
27
|
async function batchGetEvents(appId, eventNames) {
|
|
29
28
|
var _a;
|
|
30
|
-
var _b;
|
|
31
29
|
const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
|
|
32
30
|
if (eventNames.length > 100)
|
|
33
31
|
throw new error_1.FirebaseError("Too many events in batchGet request");
|
|
@@ -45,7 +43,6 @@ async function batchGetEvents(appId, eventNames) {
|
|
|
45
43
|
queryParams: queryParams,
|
|
46
44
|
timeout: utils_1.TIMEOUT,
|
|
47
45
|
});
|
|
48
|
-
(_a =
|
|
46
|
+
(_a = response.body).events ?? (_a.events = []);
|
|
49
47
|
return response.body;
|
|
50
48
|
}
|
|
51
|
-
exports.batchGetEvents = batchGetEvents;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.EventFilterSchema = exports.IssueIdSchema = exports.ApplicationIdSchema = void 0;
|
|
4
|
+
exports.filterToUrlSearchParams = filterToUrlSearchParams;
|
|
5
|
+
exports.validateEventFilters = validateEventFilters;
|
|
4
6
|
const zod_1 = require("zod");
|
|
5
7
|
const error_1 = require("../error");
|
|
6
8
|
exports.ApplicationIdSchema = zod_1.z
|
|
7
9
|
.string()
|
|
8
|
-
.describe("Firebase
|
|
9
|
-
|
|
10
|
-
"the current package name. For an iOS Application, read the GOOGLE_APP_ID " +
|
|
11
|
-
"from GoogleService-Info.plist. If neither is available, ask the user to " +
|
|
12
|
-
"provide the app id.");
|
|
13
|
-
exports.IssueIdSchema = zod_1.z.string().describe("Crashlytics issue id, as hexidecimal uuid");
|
|
10
|
+
.describe("Firebase App Id. Strictly required for all API calls.");
|
|
11
|
+
exports.IssueIdSchema = zod_1.z.string().describe("Crashlytics issue id, as hexidecimal UUID");
|
|
14
12
|
exports.EventFilterSchema = zod_1.z
|
|
15
13
|
.object({
|
|
16
14
|
intervalStartTime: zod_1.z
|
|
@@ -81,11 +79,11 @@ function filterToUrlSearchParams(filter) {
|
|
|
81
79
|
}
|
|
82
80
|
return params;
|
|
83
81
|
}
|
|
84
|
-
exports.filterToUrlSearchParams = filterToUrlSearchParams;
|
|
85
82
|
const displayNamePattern = /^[^()]+\s+\([^()]+\)$/;
|
|
86
|
-
function validateEventFilters(filter) {
|
|
87
|
-
if (!filter)
|
|
88
|
-
|
|
83
|
+
function validateEventFilters(filter = {}) {
|
|
84
|
+
if (!!filter.intervalStartTime && !filter.intervalEndTime) {
|
|
85
|
+
filter.intervalEndTime = new Date().toISOString();
|
|
86
|
+
}
|
|
89
87
|
const ninetyDaysAgo = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000);
|
|
90
88
|
if (filter.intervalStartTime && new Date(filter.intervalStartTime) < ninetyDaysAgo) {
|
|
91
89
|
throw new error_1.FirebaseError("intervalStartTime must be less than 90 days in the past");
|
|
@@ -111,5 +109,5 @@ function validateEventFilters(filter) {
|
|
|
111
109
|
}
|
|
112
110
|
});
|
|
113
111
|
}
|
|
112
|
+
return filter;
|
|
114
113
|
}
|
|
115
|
-
exports.validateEventFilters = validateEventFilters;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getIssue = getIssue;
|
|
4
|
+
exports.updateIssue = updateIssue;
|
|
4
5
|
const logger_1 = require("../logger");
|
|
5
6
|
const utils_1 = require("./utils");
|
|
6
7
|
async function getIssue(appId, issueId) {
|
|
@@ -16,7 +17,6 @@ async function getIssue(appId, issueId) {
|
|
|
16
17
|
});
|
|
17
18
|
return response.body;
|
|
18
19
|
}
|
|
19
|
-
exports.getIssue = getIssue;
|
|
20
20
|
async function updateIssue(appId, issueId, state) {
|
|
21
21
|
const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
|
|
22
22
|
logger_1.logger.debug(`[crashlytics] updateIssue called with appId: ${appId}, issueId: ${issueId}, state: ${state}`);
|
|
@@ -32,4 +32,3 @@ async function updateIssue(appId, issueId, state) {
|
|
|
32
32
|
});
|
|
33
33
|
return response.body;
|
|
34
34
|
}
|
|
35
|
-
exports.updateIssue = updateIssue;
|
package/lib/crashlytics/notes.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createNote = createNote;
|
|
4
|
+
exports.deleteNote = deleteNote;
|
|
5
|
+
exports.listNotes = listNotes;
|
|
4
6
|
const logger_1 = require("../logger");
|
|
5
7
|
const error_1 = require("../error");
|
|
6
8
|
const utils_1 = require("./utils");
|
|
@@ -25,7 +27,6 @@ async function createNote(appId, issueId, note) {
|
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
|
-
exports.createNote = createNote;
|
|
29
30
|
async function deleteNote(appId, issueId, noteId) {
|
|
30
31
|
const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
|
|
31
32
|
logger_1.logger.debug(`[crashlytics] deleteNote called with appId: ${appId}, issueId: ${issueId}, noteId: ${noteId}`);
|
|
@@ -36,7 +37,6 @@ async function deleteNote(appId, issueId, noteId) {
|
|
|
36
37
|
});
|
|
37
38
|
return `Deleted note ${noteId}`;
|
|
38
39
|
}
|
|
39
|
-
exports.deleteNote = deleteNote;
|
|
40
40
|
async function listNotes(appId, issueId, pageSize = 20) {
|
|
41
41
|
const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
|
|
42
42
|
const queryParams = new URLSearchParams();
|
|
@@ -53,4 +53,3 @@ async function listNotes(appId, issueId, pageSize = 20) {
|
|
|
53
53
|
});
|
|
54
54
|
return response.body.notes || [];
|
|
55
55
|
}
|
|
56
|
-
exports.listNotes = listNotes;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ReportInputSchema = exports.CrashlyticsReportSchema = exports.CrashlyticsReport = void 0;
|
|
4
|
+
exports.simplifyReport = simplifyReport;
|
|
5
|
+
exports.getReport = getReport;
|
|
4
6
|
const zod_1 = require("zod");
|
|
5
7
|
const lodash_1 = require("lodash");
|
|
6
8
|
const logger_1 = require("../logger");
|
|
7
9
|
const utils_1 = require("./utils");
|
|
8
10
|
const filters_1 = require("./filters");
|
|
11
|
+
const error_1 = require("../error");
|
|
9
12
|
const DEFAULT_PAGE_SIZE = 10;
|
|
13
|
+
var CrashlyticsReport;
|
|
14
|
+
(function (CrashlyticsReport) {
|
|
15
|
+
CrashlyticsReport["TOP_ISSUES"] = "topIssues";
|
|
16
|
+
CrashlyticsReport["TOP_VARIANTS"] = "topVariants";
|
|
17
|
+
CrashlyticsReport["TOP_VERSIONS"] = "topVersions";
|
|
18
|
+
CrashlyticsReport["TOP_OPERATING_SYSTEMS"] = "topOperatingSystems";
|
|
19
|
+
CrashlyticsReport["TOP_APPLE_DEVICES"] = "topAppleDevices";
|
|
20
|
+
CrashlyticsReport["TOP_ANDROID_DEVICES"] = "topAndroidDevices";
|
|
21
|
+
})(CrashlyticsReport || (exports.CrashlyticsReport = CrashlyticsReport = {}));
|
|
22
|
+
exports.CrashlyticsReportSchema = zod_1.z.nativeEnum(CrashlyticsReport);
|
|
10
23
|
exports.ReportInputSchema = zod_1.z.object({
|
|
11
24
|
appId: filters_1.ApplicationIdSchema,
|
|
25
|
+
report: exports.CrashlyticsReportSchema,
|
|
12
26
|
filter: filters_1.EventFilterSchema,
|
|
13
27
|
pageSize: zod_1.z.number().optional().describe("Number of rows to return").default(DEFAULT_PAGE_SIZE),
|
|
14
28
|
});
|
|
15
|
-
var CrashlyticsReport;
|
|
16
|
-
(function (CrashlyticsReport) {
|
|
17
|
-
CrashlyticsReport["TopIssues"] = "topIssues";
|
|
18
|
-
CrashlyticsReport["TopVariants"] = "topVariants";
|
|
19
|
-
CrashlyticsReport["TopVersions"] = "topVersions";
|
|
20
|
-
CrashlyticsReport["TopOperatingSystems"] = "topOperatingSystems";
|
|
21
|
-
CrashlyticsReport["TopAppleDevices"] = "topAppleDevices";
|
|
22
|
-
CrashlyticsReport["TopAndroidDevices"] = "topAndroidDevices";
|
|
23
|
-
})(CrashlyticsReport = exports.CrashlyticsReport || (exports.CrashlyticsReport = {}));
|
|
24
29
|
function simplifyReport(report) {
|
|
25
30
|
const simplifiedReport = (0, lodash_1.cloneDeep)(report);
|
|
26
31
|
if (!simplifiedReport.groups)
|
|
@@ -41,21 +46,22 @@ function simplifyReport(report) {
|
|
|
41
46
|
});
|
|
42
47
|
return simplifiedReport;
|
|
43
48
|
}
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
async function getReport(reportName, appId, filter, pageSize = DEFAULT_PAGE_SIZE) {
|
|
50
|
+
if (!reportName) {
|
|
51
|
+
throw new error_1.FirebaseError("Invalid Crashlytics report " + reportName);
|
|
52
|
+
}
|
|
46
53
|
const requestProjectNumber = (0, utils_1.parseProjectNumber)(appId);
|
|
47
54
|
const queryParams = (0, filters_1.filterToUrlSearchParams)(filter);
|
|
48
55
|
queryParams.set("page_size", `${pageSize}`);
|
|
49
|
-
logger_1.logger.debug(`[crashlytics] report ${
|
|
56
|
+
logger_1.logger.debug(`[crashlytics] report ${reportName} called with appId: ${appId} filter: ${queryParams.toString()}, page_size: ${pageSize}`);
|
|
50
57
|
const response = await utils_1.CRASHLYTICS_API_CLIENT.request({
|
|
51
58
|
method: "GET",
|
|
52
59
|
headers: {
|
|
53
60
|
"Content-Type": "application/json",
|
|
54
61
|
},
|
|
55
|
-
path: `/projects/${requestProjectNumber}/apps/${appId}/reports/${
|
|
62
|
+
path: `/projects/${requestProjectNumber}/apps/${appId}/reports/${reportName}`,
|
|
56
63
|
queryParams: queryParams,
|
|
57
64
|
timeout: utils_1.TIMEOUT,
|
|
58
65
|
});
|
|
59
66
|
return response.body;
|
|
60
67
|
}
|
|
61
|
-
exports.getReport = getReport;
|
package/lib/crashlytics/types.js
CHANGED
|
@@ -7,7 +7,7 @@ var ErrorType;
|
|
|
7
7
|
ErrorType["FATAL"] = "FATAL";
|
|
8
8
|
ErrorType["NON_FATAL"] = "NON_FATAL";
|
|
9
9
|
ErrorType["ANR"] = "ANR";
|
|
10
|
-
})(ErrorType
|
|
10
|
+
})(ErrorType || (exports.ErrorType = ErrorType = {}));
|
|
11
11
|
var TrackType;
|
|
12
12
|
(function (TrackType) {
|
|
13
13
|
TrackType["TRACK_TYPE_UNSPECIFIED"] = "TRACK_TYPE_UNSPECIFIED";
|
|
@@ -16,7 +16,7 @@ var TrackType;
|
|
|
16
16
|
TrackType["TRACK_TYPE_OPEN_TESTING"] = "TRACK_TYPE_OPEN_TESTING";
|
|
17
17
|
TrackType["TRACK_TYPE_CLOSED_TESTING"] = "TRACK_TYPE_CLOSED_TESTING";
|
|
18
18
|
TrackType["TRACK_TYPE_EARLY_ACCESS"] = "TRACK_TYPE_EARLY_ACCESS";
|
|
19
|
-
})(TrackType
|
|
19
|
+
})(TrackType || (exports.TrackType = TrackType = {}));
|
|
20
20
|
var FormFactor;
|
|
21
21
|
(function (FormFactor) {
|
|
22
22
|
FormFactor["FORM_FACTOR_UNSPECIFIED"] = "FORM_FACTOR_UNSPECIFIED";
|
|
@@ -25,19 +25,19 @@ var FormFactor;
|
|
|
25
25
|
FormFactor["DESKTOP"] = "DESKTOP";
|
|
26
26
|
FormFactor["TV"] = "TV";
|
|
27
27
|
FormFactor["WATCH"] = "WATCH";
|
|
28
|
-
})(FormFactor
|
|
28
|
+
})(FormFactor || (exports.FormFactor = FormFactor = {}));
|
|
29
29
|
var SessionEventType;
|
|
30
30
|
(function (SessionEventType) {
|
|
31
31
|
SessionEventType["SESSION_EVENT_TYPE_UNKNOWN"] = "SESSION_EVENT_TYPE_UNKNOWN";
|
|
32
32
|
SessionEventType["SESSION_START"] = "SESSION_START";
|
|
33
|
-
})(SessionEventType
|
|
33
|
+
})(SessionEventType || (exports.SessionEventType = SessionEventType = {}));
|
|
34
34
|
var State;
|
|
35
35
|
(function (State) {
|
|
36
36
|
State["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
|
|
37
37
|
State["OPEN"] = "OPEN";
|
|
38
38
|
State["CLOSED"] = "CLOSED";
|
|
39
39
|
State["MUTED"] = "MUTED";
|
|
40
|
-
})(State
|
|
40
|
+
})(State || (exports.State = State = {}));
|
|
41
41
|
var Signal;
|
|
42
42
|
(function (Signal) {
|
|
43
43
|
Signal["SIGNAL_UNSPECIFIED"] = "SIGNAL_UNSPECIFIED";
|
|
@@ -45,7 +45,7 @@ var Signal;
|
|
|
45
45
|
Signal["SIGNAL_FRESH"] = "SIGNAL_FRESH";
|
|
46
46
|
Signal["SIGNAL_REGRESSED"] = "SIGNAL_REGRESSED";
|
|
47
47
|
Signal["SIGNAL_REPETITIVE"] = "SIGNAL_REPETITIVE";
|
|
48
|
-
})(Signal
|
|
48
|
+
})(Signal || (exports.Signal = Signal = {}));
|
|
49
49
|
var ThreadState;
|
|
50
50
|
(function (ThreadState) {
|
|
51
51
|
ThreadState["STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED";
|
|
@@ -57,4 +57,4 @@ var ThreadState;
|
|
|
57
57
|
ThreadState["THREAD_STATE_NEW"] = "THREAD_STATE_NEW";
|
|
58
58
|
ThreadState["THREAD_STATE_NATIVE_RUNNABLE"] = "THREAD_STATE_NATIVE_RUNNABLE";
|
|
59
59
|
ThreadState["THREAD_STATE_NATIVE_WAITING"] = "THREAD_STATE_NATIVE_WAITING";
|
|
60
|
-
})(ThreadState
|
|
60
|
+
})(ThreadState || (exports.ThreadState = ThreadState = {}));
|
package/lib/crashlytics/utils.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PLATFORM_PATH = exports.CRASHLYTICS_API_CLIENT = exports.TIMEOUT = void 0;
|
|
4
|
+
exports.parseProjectNumber = parseProjectNumber;
|
|
5
|
+
exports.parsePlatform = parsePlatform;
|
|
4
6
|
const error_1 = require("../error");
|
|
5
7
|
const apiv2_1 = require("../apiv2");
|
|
6
8
|
const api_1 = require("../api");
|
|
@@ -13,7 +15,7 @@ var PLATFORM_PATH;
|
|
|
13
15
|
(function (PLATFORM_PATH) {
|
|
14
16
|
PLATFORM_PATH["ANDROID"] = "topAndroidDevices";
|
|
15
17
|
PLATFORM_PATH["IOS"] = "topAppleDevices";
|
|
16
|
-
})(PLATFORM_PATH
|
|
18
|
+
})(PLATFORM_PATH || (exports.PLATFORM_PATH = PLATFORM_PATH = {}));
|
|
17
19
|
function parseProjectNumber(appId) {
|
|
18
20
|
const appIdParts = appId.split(":");
|
|
19
21
|
if (appIdParts.length > 1) {
|
|
@@ -21,7 +23,6 @@ function parseProjectNumber(appId) {
|
|
|
21
23
|
}
|
|
22
24
|
throw new error_1.FirebaseError("Unable to get the projectId from the AppId.");
|
|
23
25
|
}
|
|
24
|
-
exports.parseProjectNumber = parseProjectNumber;
|
|
25
26
|
function parsePlatform(appId) {
|
|
26
27
|
const appIdParts = appId.split(":");
|
|
27
28
|
if (appIdParts.length < 3) {
|
|
@@ -35,4 +36,3 @@ function parsePlatform(appId) {
|
|
|
35
36
|
}
|
|
36
37
|
throw new error_1.FirebaseError(`Only android or ios apps are supported.`);
|
|
37
38
|
}
|
|
38
|
-
exports.parsePlatform = parsePlatform;
|
package/lib/database/api.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.realtimeOriginOrEmulatorOrCustomUrl = realtimeOriginOrEmulatorOrCustomUrl;
|
|
4
|
+
exports.realtimeOriginOrCustomUrl = realtimeOriginOrCustomUrl;
|
|
4
5
|
const utils_1 = require("../utils");
|
|
5
6
|
const constants_1 = require("../emulator/constants");
|
|
6
7
|
function realtimeOriginOrEmulatorOrCustomUrl(host) {
|
|
7
8
|
return (0, utils_1.envOverride)(constants_1.Constants.FIREBASE_DATABASE_EMULATOR_HOST, (0, utils_1.envOverride)("FIREBASE_REALTIME_URL", host), addHttpIfRequired);
|
|
8
9
|
}
|
|
9
|
-
exports.realtimeOriginOrEmulatorOrCustomUrl = realtimeOriginOrEmulatorOrCustomUrl;
|
|
10
10
|
function realtimeOriginOrCustomUrl(host) {
|
|
11
11
|
return (0, utils_1.envOverride)("FIREBASE_REALTIME_URL", host);
|
|
12
12
|
}
|
|
13
|
-
exports.realtimeOriginOrCustomUrl = realtimeOriginOrCustomUrl;
|
|
14
13
|
function addHttpIfRequired(val) {
|
|
15
14
|
if (val.startsWith("http")) {
|
|
16
15
|
return val;
|
package/lib/database/import.js
CHANGED
|
@@ -11,7 +11,7 @@ const error_1 = require("../error");
|
|
|
11
11
|
const pLimit = require("p-limit");
|
|
12
12
|
class BatchChunks extends stream.Transform {
|
|
13
13
|
constructor(maxSize, opts) {
|
|
14
|
-
super(
|
|
14
|
+
super({ ...opts, objectMode: true });
|
|
15
15
|
this.maxSize = maxSize;
|
|
16
16
|
this.batch = [];
|
|
17
17
|
this.size = 0;
|
|
@@ -51,7 +51,7 @@ class BatchChunks extends stream.Transform {
|
|
|
51
51
|
return { json: { [lastToken]: json }, pathname: tokens.join("/"), size };
|
|
52
52
|
}
|
|
53
53
|
if (Array.isArray(json)) {
|
|
54
|
-
return { json:
|
|
54
|
+
return { json: { ...json }, pathname, size };
|
|
55
55
|
}
|
|
56
56
|
return { json, pathname, size };
|
|
57
57
|
}
|
|
@@ -119,7 +119,7 @@ class DatabaseImporter {
|
|
|
119
119
|
readChunks._transform = function (chunk, _, done) {
|
|
120
120
|
const data = { json: chunk.value, pathname: getJoinedPath(dbUrl.pathname, chunk.key) };
|
|
121
121
|
const chunkedData = chunkData(data);
|
|
122
|
-
const chunks = chunkedData.chunks || [
|
|
122
|
+
const chunks = chunkedData.chunks || [{ ...data, size: JSON.stringify(data.json).length }];
|
|
123
123
|
for (const chunk of chunks) {
|
|
124
124
|
this.push(chunk);
|
|
125
125
|
}
|
|
@@ -197,7 +197,7 @@ class DatabaseImporter {
|
|
|
197
197
|
chunks.push(...childChunks.chunks);
|
|
198
198
|
}
|
|
199
199
|
else {
|
|
200
|
-
chunks.push(
|
|
200
|
+
chunks.push({ ...child, size: childChunks.size });
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
if (hasChunkedChild || size >= this.payloadSize) {
|
package/lib/database/metadata.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.listAllRulesets = listAllRulesets;
|
|
4
|
+
exports.getRuleset = getRuleset;
|
|
5
|
+
exports.getRulesetLabels = getRulesetLabels;
|
|
6
|
+
exports.createRuleset = createRuleset;
|
|
7
|
+
exports.setRulesetLabels = setRulesetLabels;
|
|
4
8
|
const api_1 = require("../api");
|
|
5
9
|
const apiv2_1 = require("../apiv2");
|
|
6
10
|
const logger_1 = require("../logger");
|
|
@@ -22,7 +26,6 @@ async function listAllRulesets(databaseName) {
|
|
|
22
26
|
}
|
|
23
27
|
return handleErrorResponse(response);
|
|
24
28
|
}
|
|
25
|
-
exports.listAllRulesets = listAllRulesets;
|
|
26
29
|
async function getRuleset(databaseName, rulesetId) {
|
|
27
30
|
const response = await apiClient.get(`/namespaces/${databaseName}/rulesets/${rulesetId}`, { resolveOnHTTPError: true });
|
|
28
31
|
if (response.status === 200) {
|
|
@@ -30,7 +33,6 @@ async function getRuleset(databaseName, rulesetId) {
|
|
|
30
33
|
}
|
|
31
34
|
return handleErrorResponse(response);
|
|
32
35
|
}
|
|
33
|
-
exports.getRuleset = getRuleset;
|
|
34
36
|
async function getRulesetLabels(databaseName) {
|
|
35
37
|
const response = await apiClient.get(`/namespaces/${databaseName}/ruleset_labels`, {
|
|
36
38
|
resolveOnHTTPError: true,
|
|
@@ -40,7 +42,6 @@ async function getRulesetLabels(databaseName) {
|
|
|
40
42
|
}
|
|
41
43
|
return handleErrorResponse(response);
|
|
42
44
|
}
|
|
43
|
-
exports.getRulesetLabels = getRulesetLabels;
|
|
44
45
|
async function createRuleset(databaseName, source) {
|
|
45
46
|
const localApiClient = new apiv2_1.Client({
|
|
46
47
|
urlPrefix: utils.addSubdomain((0, api_1.realtimeOrigin)(), databaseName),
|
|
@@ -51,7 +52,6 @@ async function createRuleset(databaseName, source) {
|
|
|
51
52
|
}
|
|
52
53
|
return handleErrorResponse(response);
|
|
53
54
|
}
|
|
54
|
-
exports.createRuleset = createRuleset;
|
|
55
55
|
async function setRulesetLabels(databaseName, labels) {
|
|
56
56
|
const localApiClient = new apiv2_1.Client({
|
|
57
57
|
urlPrefix: utils.addSubdomain((0, api_1.realtimeOrigin)(), databaseName),
|
|
@@ -64,4 +64,3 @@ async function setRulesetLabels(databaseName, labels) {
|
|
|
64
64
|
}
|
|
65
65
|
return handleErrorResponse(response);
|
|
66
66
|
}
|
|
67
|
-
exports.setRulesetLabels = setRulesetLabels;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.normalizeRulesConfig = normalizeRulesConfig;
|
|
4
|
+
exports.getRulesConfig = getRulesConfig;
|
|
4
5
|
const error_1 = require("../error");
|
|
5
6
|
const logger_1 = require("../logger");
|
|
6
7
|
const utils = require("../utils");
|
|
@@ -13,7 +14,6 @@ function normalizeRulesConfig(rulesConfig, options) {
|
|
|
13
14
|
};
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
|
-
exports.normalizeRulesConfig = normalizeRulesConfig;
|
|
17
17
|
function getRulesConfig(projectId, options) {
|
|
18
18
|
const dbConfig = options.config.src.database;
|
|
19
19
|
if (dbConfig === undefined) {
|
|
@@ -76,4 +76,3 @@ function getRulesConfig(projectId, options) {
|
|
|
76
76
|
}
|
|
77
77
|
return results;
|
|
78
78
|
}
|
|
79
|
-
exports.getRulesConfig = getRulesConfig;
|
package/lib/dataconnect/build.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.build = build;
|
|
4
|
+
exports.handleBuildErrors = handleBuildErrors;
|
|
4
5
|
const dataconnectEmulator_1 = require("../emulator/dataconnectEmulator");
|
|
5
6
|
const error_1 = require("../error");
|
|
6
7
|
const prompt_1 = require("../prompt");
|
|
@@ -8,23 +9,21 @@ const utils = require("../utils");
|
|
|
8
9
|
const graphqlError_1 = require("./graphqlError");
|
|
9
10
|
const auth_1 = require("../auth");
|
|
10
11
|
async function build(options, configDir, deployStats) {
|
|
11
|
-
var _a, _b;
|
|
12
12
|
const account = (0, auth_1.getProjectDefaultAccount)(options.projectRoot);
|
|
13
13
|
const args = { configDir, account };
|
|
14
14
|
if (options.projectId) {
|
|
15
15
|
args.projectId = options.projectId;
|
|
16
16
|
}
|
|
17
17
|
const buildResult = await dataconnectEmulator_1.DataConnectEmulator.build(args);
|
|
18
|
-
if (
|
|
18
|
+
if (buildResult?.errors?.length) {
|
|
19
19
|
buildResult.errors.forEach((e) => {
|
|
20
|
-
|
|
21
|
-
if ((_a = e.extensions) === null || _a === void 0 ? void 0 : _a.warningLevel) {
|
|
20
|
+
if (e.extensions?.warningLevel) {
|
|
22
21
|
let key = e.extensions.warningLevel.toLowerCase();
|
|
23
22
|
const msgSp = e.message.split(": ");
|
|
24
23
|
if (msgSp.length >= 2) {
|
|
25
24
|
key += `_${msgSp[0].toLowerCase()}`;
|
|
26
25
|
}
|
|
27
|
-
deployStats.numBuildWarnings.set(key, (
|
|
26
|
+
deployStats.numBuildWarnings.set(key, (deployStats.numBuildWarnings.get(key) ?? 0) + 1);
|
|
28
27
|
}
|
|
29
28
|
else {
|
|
30
29
|
deployStats.numBuildErrors += 1;
|
|
@@ -32,21 +31,20 @@ async function build(options, configDir, deployStats) {
|
|
|
32
31
|
});
|
|
33
32
|
await handleBuildErrors(buildResult.errors, options.nonInteractive, options.force, options.dryRun);
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return buildResult?.metadata ?? {};
|
|
36
35
|
}
|
|
37
|
-
exports.build = build;
|
|
38
36
|
async function handleBuildErrors(errors, nonInteractive, force, dryRun) {
|
|
39
|
-
if (errors.filter((w) =>
|
|
37
|
+
if (errors.filter((w) => !w.extensions?.warningLevel).length) {
|
|
40
38
|
throw new error_1.FirebaseError(`There are errors in your schema and connector files:\n${errors.map(graphqlError_1.prettify).join("\n")}`);
|
|
41
39
|
}
|
|
42
|
-
const requiredForces = errors.filter((w) =>
|
|
40
|
+
const requiredForces = errors.filter((w) => w.extensions?.warningLevel === "REQUIRE_FORCE");
|
|
43
41
|
if (requiredForces.length && !force) {
|
|
44
42
|
utils.logLabeledError("dataconnect", `There are changes in your schema or connectors that will result in broken behavior:\n` +
|
|
45
43
|
(0, graphqlError_1.prettifyTable)(requiredForces));
|
|
46
44
|
throw new error_1.FirebaseError("Rerun this command with --force to deploy these changes.");
|
|
47
45
|
}
|
|
48
|
-
const interactiveAcks = errors.filter((w) =>
|
|
49
|
-
const requiredAcks = errors.filter((w) =>
|
|
46
|
+
const interactiveAcks = errors.filter((w) => w.extensions?.warningLevel === "INTERACTIVE_ACK");
|
|
47
|
+
const requiredAcks = errors.filter((w) => w.extensions?.warningLevel === "REQUIRE_ACK");
|
|
50
48
|
const choices = [
|
|
51
49
|
{ name: "Acknowledge all changes and proceed", value: "proceed" },
|
|
52
50
|
{ name: "Reject changes and abort", value: "abort" },
|
|
@@ -83,4 +81,3 @@ async function handleBuildErrors(errors, nonInteractive, force, dryRun) {
|
|
|
83
81
|
}
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
|
-
exports.handleBuildErrors = handleBuildErrors;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.grantRolesToCloudSqlServiceAccount =
|
|
3
|
+
exports.grantRolesToCloudSqlServiceAccount = grantRolesToCloudSqlServiceAccount;
|
|
4
4
|
const iam = require("../gcp/iam");
|
|
5
5
|
const resourceManager_1 = require("../gcp/resourceManager");
|
|
6
6
|
const cloudSqlAdmin = require("../gcp/cloudsql/cloudsqladmin");
|
|
@@ -27,4 +27,3 @@ async function grantRolesToCloudSqlServiceAccount(projectId, instanceId, roles)
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
exports.grantRolesToCloudSqlServiceAccount = grantRolesToCloudSqlServiceAccount;
|