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
package/lib/extensions/types.js
CHANGED
|
@@ -9,12 +9,12 @@ var RegistryLaunchStage;
|
|
|
9
9
|
RegistryLaunchStage["GA"] = "GA";
|
|
10
10
|
RegistryLaunchStage["DEPRECATED"] = "DEPRECATED";
|
|
11
11
|
RegistryLaunchStage["REGISTRY_LAUNCH_STAGE_UNSPECIFIED"] = "REGISTRY_LAUNCH_STAGE_UNSPECIFIED";
|
|
12
|
-
})(RegistryLaunchStage
|
|
12
|
+
})(RegistryLaunchStage || (exports.RegistryLaunchStage = RegistryLaunchStage = {}));
|
|
13
13
|
var Visibility;
|
|
14
14
|
(function (Visibility) {
|
|
15
15
|
Visibility["UNLISTED"] = "unlisted";
|
|
16
16
|
Visibility["PUBLIC"] = "public";
|
|
17
|
-
})(Visibility
|
|
17
|
+
})(Visibility || (exports.Visibility = Visibility = {}));
|
|
18
18
|
const extensionInstanceState = [
|
|
19
19
|
"STATE_UNSPECIFIED",
|
|
20
20
|
"DEPLOYING",
|
|
@@ -40,7 +40,7 @@ var ParamType;
|
|
|
40
40
|
ParamType["MULTISELECT"] = "MULTISELECT";
|
|
41
41
|
ParamType["SELECT_RESOURCE"] = "SELECT_RESOURCE";
|
|
42
42
|
ParamType["SECRET"] = "SECRET";
|
|
43
|
-
})(ParamType
|
|
43
|
+
})(ParamType || (exports.ParamType = ParamType = {}));
|
|
44
44
|
const isParam = (param) => {
|
|
45
45
|
return ((0, error_1.isObject)(param) && typeof param["param"] === "string" && typeof param["label"] === "string");
|
|
46
46
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getExistingSourceOrigin = getExistingSourceOrigin;
|
|
4
|
+
exports.warningUpdateToOtherSource = warningUpdateToOtherSource;
|
|
5
|
+
exports.update = update;
|
|
6
|
+
exports.updateFromLocalSource = updateFromLocalSource;
|
|
7
|
+
exports.updateFromUrlSource = updateFromUrlSource;
|
|
8
|
+
exports.inferUpdateSource = inferUpdateSource;
|
|
4
9
|
const clc = require("colorette");
|
|
5
10
|
const semver = require("semver");
|
|
6
11
|
const error_1 = require("../error");
|
|
@@ -20,7 +25,6 @@ async function getExistingSourceOrigin(projectId, instanceId) {
|
|
|
20
25
|
? extensionsHelper_1.SourceOrigin.PUBLISHED_EXTENSION
|
|
21
26
|
: extensionsHelper_1.SourceOrigin.LOCAL;
|
|
22
27
|
}
|
|
23
|
-
exports.getExistingSourceOrigin = getExistingSourceOrigin;
|
|
24
28
|
function showUpdateVersionInfo(instanceId, from, to, source) {
|
|
25
29
|
if (source) {
|
|
26
30
|
source = clc.bold(source);
|
|
@@ -48,7 +52,6 @@ function warningUpdateToOtherSource(sourceOrigin) {
|
|
|
48
52
|
const warning = `All the instance's resources and logic will be overwritten to use the source code and files from the ${targetText}.\n`;
|
|
49
53
|
logger_1.logger.info(warning);
|
|
50
54
|
}
|
|
51
|
-
exports.warningUpdateToOtherSource = warningUpdateToOtherSource;
|
|
52
55
|
async function update(updateOptions) {
|
|
53
56
|
const { projectId, instanceId, source, extRef, params, canEmitEvents, allowedEventTypes, eventarcChannel, } = updateOptions;
|
|
54
57
|
if (extRef) {
|
|
@@ -75,7 +78,6 @@ async function update(updateOptions) {
|
|
|
75
78
|
}
|
|
76
79
|
throw new error_1.FirebaseError(`Neither a source nor a version of the extension was supplied for ${instanceId}. Please make sure this is a valid extension and try again.`);
|
|
77
80
|
}
|
|
78
|
-
exports.update = update;
|
|
79
81
|
async function updateFromLocalSource(projectId, instanceId, localSource, existingSpec) {
|
|
80
82
|
await (0, displayExtensionInfo_1.displayExtensionVersionInfo)({ spec: existingSpec });
|
|
81
83
|
let source;
|
|
@@ -90,7 +92,6 @@ async function updateFromLocalSource(projectId, instanceId, localSource, existin
|
|
|
90
92
|
warningUpdateToOtherSource(extensionsHelper_1.SourceOrigin.LOCAL);
|
|
91
93
|
return source.name;
|
|
92
94
|
}
|
|
93
|
-
exports.updateFromLocalSource = updateFromLocalSource;
|
|
94
95
|
async function updateFromUrlSource(projectId, instanceId, urlSource, existingSpec) {
|
|
95
96
|
await (0, displayExtensionInfo_1.displayExtensionVersionInfo)({ spec: existingSpec });
|
|
96
97
|
let source;
|
|
@@ -105,7 +106,6 @@ async function updateFromUrlSource(projectId, instanceId, urlSource, existingSpe
|
|
|
105
106
|
warningUpdateToOtherSource(extensionsHelper_1.SourceOrigin.URL);
|
|
106
107
|
return source.name;
|
|
107
108
|
}
|
|
108
|
-
exports.updateFromUrlSource = updateFromUrlSource;
|
|
109
109
|
function inferUpdateSource(updateSource, existingRef) {
|
|
110
110
|
if (!updateSource) {
|
|
111
111
|
return `${existingRef}@latest`;
|
|
@@ -123,4 +123,3 @@ function inferUpdateSource(updateSource, existingRef) {
|
|
|
123
123
|
}
|
|
124
124
|
return updateSource;
|
|
125
125
|
}
|
|
126
|
-
exports.inferUpdateSource = inferUpdateSource;
|
package/lib/extensions/utils.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.convertExtensionOptionToLabeledList = convertExtensionOptionToLabeledList;
|
|
4
|
+
exports.getRandomString = getRandomString;
|
|
5
|
+
exports.formatTimestamp = formatTimestamp;
|
|
6
|
+
exports.getResourceRuntime = getResourceRuntime;
|
|
4
7
|
const types_1 = require("./types");
|
|
5
8
|
function convertExtensionOptionToLabeledList(options) {
|
|
6
9
|
return options.map((option) => {
|
|
@@ -11,7 +14,6 @@ function convertExtensionOptionToLabeledList(options) {
|
|
|
11
14
|
};
|
|
12
15
|
});
|
|
13
16
|
}
|
|
14
|
-
exports.convertExtensionOptionToLabeledList = convertExtensionOptionToLabeledList;
|
|
15
17
|
function getRandomString(length) {
|
|
16
18
|
const SUFFIX_CHAR_SET = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
17
19
|
let result = "";
|
|
@@ -20,7 +22,6 @@ function getRandomString(length) {
|
|
|
20
22
|
}
|
|
21
23
|
return result;
|
|
22
24
|
}
|
|
23
|
-
exports.getRandomString = getRandomString;
|
|
24
25
|
function formatTimestamp(timestamp) {
|
|
25
26
|
if (!timestamp) {
|
|
26
27
|
return "";
|
|
@@ -28,16 +29,13 @@ function formatTimestamp(timestamp) {
|
|
|
28
29
|
const withoutMs = timestamp.split(".")[0];
|
|
29
30
|
return withoutMs.replace("T", " ");
|
|
30
31
|
}
|
|
31
|
-
exports.formatTimestamp = formatTimestamp;
|
|
32
32
|
function getResourceRuntime(resource) {
|
|
33
|
-
var _a, _b, _c;
|
|
34
33
|
switch (resource.type) {
|
|
35
34
|
case types_1.FUNCTIONS_RESOURCE_TYPE:
|
|
36
|
-
return
|
|
35
|
+
return resource.properties?.runtime;
|
|
37
36
|
case types_1.FUNCTIONS_V2_RESOURCE_TYPE:
|
|
38
|
-
return
|
|
37
|
+
return resource.properties?.buildConfig?.runtime;
|
|
39
38
|
default:
|
|
40
39
|
return undefined;
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
exports.getResourceRuntime = getResourceRuntime;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseVersionPredicate =
|
|
3
|
+
exports.parseVersionPredicate = parseVersionPredicate;
|
|
4
4
|
const error_1 = require("../error");
|
|
5
5
|
function parseVersionPredicate(versionPredicate) {
|
|
6
6
|
const versionPredicateRegex = "^(?<comparator>>=|<=|>|<)?(?<targetSemVer>.*)";
|
|
@@ -11,4 +11,3 @@ function parseVersionPredicate(versionPredicate) {
|
|
|
11
11
|
const comparator = matches.groups.comparator || "=";
|
|
12
12
|
return { comparator, targetSemVer: matches.groups.targetSemVer };
|
|
13
13
|
}
|
|
14
|
-
exports.parseVersionPredicate = parseVersionPredicate;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.displayWarningsForDeploy = displayWarningsForDeploy;
|
|
4
|
+
exports.outOfBandChangesWarning = outOfBandChangesWarning;
|
|
4
5
|
const clc = require("colorette");
|
|
5
6
|
const extensionsHelper_1 = require("./extensionsHelper");
|
|
6
7
|
const deploymentSummary_1 = require("../deploy/extensions/deploymentSummary");
|
|
@@ -8,11 +9,10 @@ const planner_1 = require("../deploy/extensions/planner");
|
|
|
8
9
|
const logger_1 = require("../logger");
|
|
9
10
|
const utils = require("../utils");
|
|
10
11
|
const toListEntry = (i) => {
|
|
11
|
-
var _a, _b, _c, _d, _e, _f;
|
|
12
12
|
const idAndRef = (0, deploymentSummary_1.humanReadable)(i);
|
|
13
|
-
const sourceCodeLink = `\n\t[Source Code](${
|
|
14
|
-
const githubLink =
|
|
15
|
-
? `\n\t[Publisher Contact](${
|
|
13
|
+
const sourceCodeLink = `\n\t[Source Code](${i.extensionVersion?.buildSourceUri ?? i.extensionVersion?.sourceDownloadUri})`;
|
|
14
|
+
const githubLink = i.extensionVersion?.spec?.sourceUrl
|
|
15
|
+
? `\n\t[Publisher Contact](${i.extensionVersion?.spec.sourceUrl})`
|
|
16
16
|
: "";
|
|
17
17
|
return `${idAndRef}${sourceCodeLink}${githubLink}`;
|
|
18
18
|
};
|
|
@@ -21,7 +21,7 @@ async function displayWarningsForDeploy(instancesToCreate) {
|
|
|
21
21
|
for (const i of uploadedExtensionInstances) {
|
|
22
22
|
await (0, planner_1.getExtensionVersion)(i);
|
|
23
23
|
}
|
|
24
|
-
const unpublishedExtensions = uploadedExtensionInstances.filter((i) =>
|
|
24
|
+
const unpublishedExtensions = uploadedExtensionInstances.filter((i) => i.extensionVersion?.listing?.state !== "APPROVED");
|
|
25
25
|
if (unpublishedExtensions.length) {
|
|
26
26
|
const humanReadableList = unpublishedExtensions.map(toListEntry).join("\n");
|
|
27
27
|
utils.logLabeledBullet(extensionsHelper_1.logPrefix, `The following extension versions have not been published to the Firebase Extensions Hub:\n${humanReadableList}\n.` +
|
|
@@ -30,7 +30,6 @@ async function displayWarningsForDeploy(instancesToCreate) {
|
|
|
30
30
|
}
|
|
31
31
|
return unpublishedExtensions.length > 0;
|
|
32
32
|
}
|
|
33
|
-
exports.displayWarningsForDeploy = displayWarningsForDeploy;
|
|
34
33
|
function outOfBandChangesWarning(instanceIds, isDynamic) {
|
|
35
34
|
const extra = isDynamic
|
|
36
35
|
? ""
|
|
@@ -39,4 +38,3 @@ function outOfBandChangesWarning(instanceIds, isDynamic) {
|
|
|
39
38
|
clc.bold(instanceIds.join("\n\t")) +
|
|
40
39
|
`\nIf you proceed with this deployment, those changes will be overwritten.${extra}`);
|
|
41
40
|
}
|
|
42
|
-
exports.outOfBandChangesWarning = outOfBandChangesWarning;
|
package/lib/fetchMOTD.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchMOTD =
|
|
3
|
+
exports.fetchMOTD = fetchMOTD;
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const semver = require("semver");
|
|
6
6
|
const apiv2_1 = require("./apiv2");
|
|
@@ -43,4 +43,3 @@ function fetchMOTD() {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
exports.fetchMOTD = fetchMOTD;
|
package/lib/fetchWebSetup.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getCachedWebSetup = getCachedWebSetup;
|
|
4
|
+
exports.constructDefaultWebSetup = constructDefaultWebSetup;
|
|
5
|
+
exports.fetchWebSetup = fetchWebSetup;
|
|
4
6
|
const apiv2_1 = require("./apiv2");
|
|
5
7
|
const configstore_1 = require("./configstore");
|
|
6
8
|
const api_1 = require("./api");
|
|
@@ -24,7 +26,6 @@ function getCachedWebSetup(options) {
|
|
|
24
26
|
const allConfigs = configstore_1.configstore.get(CONFIGSTORE_KEY) || {};
|
|
25
27
|
return allConfigs[projectId];
|
|
26
28
|
}
|
|
27
|
-
exports.getCachedWebSetup = getCachedWebSetup;
|
|
28
29
|
async function listAllSites(projectId, nextPageToken) {
|
|
29
30
|
const queryParams = nextPageToken ? { pageToken: nextPageToken } : {};
|
|
30
31
|
const res = await hostingApiClient.get(`/projects/${projectId}/sites`, {
|
|
@@ -46,7 +47,6 @@ function constructDefaultWebSetup(projectId) {
|
|
|
46
47
|
authDomain: `${projectId}.firebaseapp.com`,
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
|
-
exports.constructDefaultWebSetup = constructDefaultWebSetup;
|
|
50
50
|
async function fetchWebSetup(options) {
|
|
51
51
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
52
52
|
if (constants_1.Constants.isDemoProject(projectId)) {
|
|
@@ -73,4 +73,3 @@ async function fetchWebSetup(options) {
|
|
|
73
73
|
setCachedWebSetup(config.projectId, config);
|
|
74
74
|
return config;
|
|
75
75
|
}
|
|
76
|
-
exports.fetchWebSetup = fetchWebSetup;
|
package/lib/filterTargets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filterTargets =
|
|
3
|
+
exports.filterTargets = filterTargets;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const error_1 = require("./error");
|
|
6
6
|
function filterTargets(options, validTargets) {
|
|
@@ -31,4 +31,3 @@ function filterTargets(options, validTargets) {
|
|
|
31
31
|
}
|
|
32
32
|
return targets;
|
|
33
33
|
}
|
|
34
|
-
exports.filterTargets = filterTargets;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getValidator = getValidator;
|
|
4
|
+
exports.getErrorMessage = getErrorMessage;
|
|
4
5
|
const fs = require("fs");
|
|
5
6
|
const path = require("path");
|
|
6
7
|
const ajv_1 = require("ajv");
|
|
@@ -16,7 +17,6 @@ function getValidator() {
|
|
|
16
17
|
}
|
|
17
18
|
return _VALIDATOR;
|
|
18
19
|
}
|
|
19
|
-
exports.getValidator = getValidator;
|
|
20
20
|
function getErrorMessage(e) {
|
|
21
21
|
if (e.keyword === "additionalProperties") {
|
|
22
22
|
return `Object "${e.instancePath}" in "firebase.json" has unknown property: ${JSON.stringify(e.params)}`;
|
|
@@ -28,4 +28,3 @@ function getErrorMessage(e) {
|
|
|
28
28
|
return `Field "${e.instancePath}" in "firebase.json" is possibly invalid: ${e.message}`;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
exports.getErrorMessage = getErrorMessage;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.compareSpecIndex = compareSpecIndex;
|
|
4
|
+
exports.compareApiIndex = compareApiIndex;
|
|
5
|
+
exports.compareApiDatabase = compareApiDatabase;
|
|
6
|
+
exports.compareLocation = compareLocation;
|
|
7
|
+
exports.compareApiBackup = compareApiBackup;
|
|
8
|
+
exports.compareApiBackupSchedule = compareApiBackupSchedule;
|
|
9
|
+
exports.compareApiField = compareApiField;
|
|
10
|
+
exports.compareFieldOverride = compareFieldOverride;
|
|
4
11
|
const API = require("./api-types");
|
|
5
12
|
const util = require("./util");
|
|
6
13
|
const QUERY_SCOPE_SEQUENCE = [
|
|
@@ -48,7 +55,6 @@ function compareSpecIndex(a, b) {
|
|
|
48
55
|
}
|
|
49
56
|
return compareBoolean(a.unique, b.unique);
|
|
50
57
|
}
|
|
51
|
-
exports.compareSpecIndex = compareSpecIndex;
|
|
52
58
|
function compareApiIndex(a, b) {
|
|
53
59
|
if (a.name && b.name) {
|
|
54
60
|
const aName = util.parseIndexName(a.name);
|
|
@@ -78,15 +84,12 @@ function compareApiIndex(a, b) {
|
|
|
78
84
|
}
|
|
79
85
|
return compareBoolean(a.unique, b.unique);
|
|
80
86
|
}
|
|
81
|
-
exports.compareApiIndex = compareApiIndex;
|
|
82
87
|
function compareApiDatabase(a, b) {
|
|
83
88
|
return a.name > b.name ? 1 : -1;
|
|
84
89
|
}
|
|
85
|
-
exports.compareApiDatabase = compareApiDatabase;
|
|
86
90
|
function compareLocation(a, b) {
|
|
87
91
|
return a.locationId > b.locationId ? 1 : -1;
|
|
88
92
|
}
|
|
89
|
-
exports.compareLocation = compareLocation;
|
|
90
93
|
function compareApiBackup(a, b) {
|
|
91
94
|
const aLocation = a.name.split("/")[3];
|
|
92
95
|
const bLocation = b.name.split("/")[3];
|
|
@@ -98,7 +101,6 @@ function compareApiBackup(a, b) {
|
|
|
98
101
|
}
|
|
99
102
|
return a.name > b.name ? 1 : -1;
|
|
100
103
|
}
|
|
101
|
-
exports.compareApiBackup = compareApiBackup;
|
|
102
104
|
function compareApiBackupSchedule(a, b) {
|
|
103
105
|
if (a.dailyRecurrence && !b.dailyRecurrence) {
|
|
104
106
|
return -1;
|
|
@@ -108,7 +110,6 @@ function compareApiBackupSchedule(a, b) {
|
|
|
108
110
|
}
|
|
109
111
|
return a.name > b.name ? 1 : -1;
|
|
110
112
|
}
|
|
111
|
-
exports.compareApiBackupSchedule = compareApiBackupSchedule;
|
|
112
113
|
function compareApiField(a, b) {
|
|
113
114
|
const aName = util.parseFieldName(a.name);
|
|
114
115
|
const bName = util.parseFieldName(b.name);
|
|
@@ -120,7 +121,6 @@ function compareApiField(a, b) {
|
|
|
120
121
|
}
|
|
121
122
|
return compareArraysSorted(a.indexConfig.indexes || [], b.indexConfig.indexes || [], compareApiIndex);
|
|
122
123
|
}
|
|
123
|
-
exports.compareApiField = compareApiField;
|
|
124
124
|
function compareFieldOverride(a, b) {
|
|
125
125
|
if (a.collectionGroup !== b.collectionGroup) {
|
|
126
126
|
return a.collectionGroup.localeCompare(b.collectionGroup);
|
|
@@ -134,7 +134,6 @@ function compareFieldOverride(a, b) {
|
|
|
134
134
|
}
|
|
135
135
|
return compareArraysSorted(a.indexes, b.indexes, compareFieldIndex);
|
|
136
136
|
}
|
|
137
|
-
exports.compareFieldOverride = compareFieldOverride;
|
|
138
137
|
function compareIndexField(a, b) {
|
|
139
138
|
if (a.fieldPath !== b.fieldPath) {
|
|
140
139
|
return a.fieldPath.localeCompare(b.fieldPath);
|
|
@@ -6,79 +6,79 @@ var Mode;
|
|
|
6
6
|
Mode["ASCENDING"] = "ASCENDING";
|
|
7
7
|
Mode["DESCENDING"] = "DESCENDING";
|
|
8
8
|
Mode["ARRAY_CONTAINS"] = "ARRAY_CONTAINS";
|
|
9
|
-
})(Mode
|
|
9
|
+
})(Mode || (exports.Mode = Mode = {}));
|
|
10
10
|
var QueryScope;
|
|
11
11
|
(function (QueryScope) {
|
|
12
12
|
QueryScope["COLLECTION"] = "COLLECTION";
|
|
13
13
|
QueryScope["COLLECTION_GROUP"] = "COLLECTION_GROUP";
|
|
14
|
-
})(QueryScope
|
|
14
|
+
})(QueryScope || (exports.QueryScope = QueryScope = {}));
|
|
15
15
|
var ApiScope;
|
|
16
16
|
(function (ApiScope) {
|
|
17
17
|
ApiScope["ANY_API"] = "ANY_API";
|
|
18
18
|
ApiScope["DATASTORE_MODE_API"] = "DATASTORE_MODE_API";
|
|
19
19
|
ApiScope["MONGODB_COMPATIBLE_API"] = "MONGODB_COMPATIBLE_API";
|
|
20
|
-
})(ApiScope
|
|
20
|
+
})(ApiScope || (exports.ApiScope = ApiScope = {}));
|
|
21
21
|
var Density;
|
|
22
22
|
(function (Density) {
|
|
23
23
|
Density["DENSITY_UNSPECIFIED"] = "DENSITY_UNSPECIFIED";
|
|
24
24
|
Density["SPARSE_ALL"] = "SPARSE_ALL";
|
|
25
25
|
Density["SPARSE_ANY"] = "SPARSE_ANY";
|
|
26
26
|
Density["DENSE"] = "DENSE";
|
|
27
|
-
})(Density
|
|
27
|
+
})(Density || (exports.Density = Density = {}));
|
|
28
28
|
var Order;
|
|
29
29
|
(function (Order) {
|
|
30
30
|
Order["ASCENDING"] = "ASCENDING";
|
|
31
31
|
Order["DESCENDING"] = "DESCENDING";
|
|
32
|
-
})(Order
|
|
32
|
+
})(Order || (exports.Order = Order = {}));
|
|
33
33
|
var ArrayConfig;
|
|
34
34
|
(function (ArrayConfig) {
|
|
35
35
|
ArrayConfig["CONTAINS"] = "CONTAINS";
|
|
36
|
-
})(ArrayConfig
|
|
36
|
+
})(ArrayConfig || (exports.ArrayConfig = ArrayConfig = {}));
|
|
37
37
|
var State;
|
|
38
38
|
(function (State) {
|
|
39
39
|
State["CREATING"] = "CREATING";
|
|
40
40
|
State["READY"] = "READY";
|
|
41
41
|
State["NEEDS_REPAIR"] = "NEEDS_REPAIR";
|
|
42
|
-
})(State
|
|
42
|
+
})(State || (exports.State = State = {}));
|
|
43
43
|
var StateTtl;
|
|
44
44
|
(function (StateTtl) {
|
|
45
45
|
StateTtl["CREATING"] = "CREATING";
|
|
46
46
|
StateTtl["ACTIVE"] = "ACTIVE";
|
|
47
47
|
StateTtl["NEEDS_REPAIR"] = "NEEDS_REPAIR";
|
|
48
|
-
})(StateTtl
|
|
48
|
+
})(StateTtl || (exports.StateTtl = StateTtl = {}));
|
|
49
49
|
var DatabaseType;
|
|
50
50
|
(function (DatabaseType) {
|
|
51
51
|
DatabaseType["DATASTORE_MODE"] = "DATASTORE_MODE";
|
|
52
52
|
DatabaseType["FIRESTORE_NATIVE"] = "FIRESTORE_NATIVE";
|
|
53
|
-
})(DatabaseType
|
|
53
|
+
})(DatabaseType || (exports.DatabaseType = DatabaseType = {}));
|
|
54
54
|
var DatabaseDeleteProtectionStateOption;
|
|
55
55
|
(function (DatabaseDeleteProtectionStateOption) {
|
|
56
56
|
DatabaseDeleteProtectionStateOption["ENABLED"] = "ENABLED";
|
|
57
57
|
DatabaseDeleteProtectionStateOption["DISABLED"] = "DISABLED";
|
|
58
|
-
})(DatabaseDeleteProtectionStateOption
|
|
58
|
+
})(DatabaseDeleteProtectionStateOption || (exports.DatabaseDeleteProtectionStateOption = DatabaseDeleteProtectionStateOption = {}));
|
|
59
59
|
var DatabaseDeleteProtectionState;
|
|
60
60
|
(function (DatabaseDeleteProtectionState) {
|
|
61
61
|
DatabaseDeleteProtectionState["ENABLED"] = "DELETE_PROTECTION_ENABLED";
|
|
62
62
|
DatabaseDeleteProtectionState["DISABLED"] = "DELETE_PROTECTION_DISABLED";
|
|
63
|
-
})(DatabaseDeleteProtectionState
|
|
63
|
+
})(DatabaseDeleteProtectionState || (exports.DatabaseDeleteProtectionState = DatabaseDeleteProtectionState = {}));
|
|
64
64
|
var PointInTimeRecoveryEnablementOption;
|
|
65
65
|
(function (PointInTimeRecoveryEnablementOption) {
|
|
66
66
|
PointInTimeRecoveryEnablementOption["ENABLED"] = "ENABLED";
|
|
67
67
|
PointInTimeRecoveryEnablementOption["DISABLED"] = "DISABLED";
|
|
68
|
-
})(PointInTimeRecoveryEnablementOption
|
|
68
|
+
})(PointInTimeRecoveryEnablementOption || (exports.PointInTimeRecoveryEnablementOption = PointInTimeRecoveryEnablementOption = {}));
|
|
69
69
|
var PointInTimeRecoveryEnablement;
|
|
70
70
|
(function (PointInTimeRecoveryEnablement) {
|
|
71
71
|
PointInTimeRecoveryEnablement["ENABLED"] = "POINT_IN_TIME_RECOVERY_ENABLED";
|
|
72
72
|
PointInTimeRecoveryEnablement["DISABLED"] = "POINT_IN_TIME_RECOVERY_DISABLED";
|
|
73
|
-
})(PointInTimeRecoveryEnablement
|
|
73
|
+
})(PointInTimeRecoveryEnablement || (exports.PointInTimeRecoveryEnablement = PointInTimeRecoveryEnablement = {}));
|
|
74
74
|
var DatabaseEdition;
|
|
75
75
|
(function (DatabaseEdition) {
|
|
76
76
|
DatabaseEdition["DATABASE_EDITION_UNSPECIFIED"] = "DATABASE_EDITION_UNSPECIFIED";
|
|
77
77
|
DatabaseEdition["STANDARD"] = "STANDARD";
|
|
78
78
|
DatabaseEdition["ENTERPRISE"] = "ENTERPRISE";
|
|
79
|
-
})(DatabaseEdition
|
|
79
|
+
})(DatabaseEdition || (exports.DatabaseEdition = DatabaseEdition = {}));
|
|
80
80
|
var RecurrenceType;
|
|
81
81
|
(function (RecurrenceType) {
|
|
82
82
|
RecurrenceType["DAILY"] = "DAILY";
|
|
83
83
|
RecurrenceType["WEEKLY"] = "WEEKLY";
|
|
84
|
-
})(RecurrenceType
|
|
84
|
+
})(RecurrenceType || (exports.RecurrenceType = RecurrenceType = {}));
|
package/lib/firestore/api.js
CHANGED
|
@@ -22,24 +22,29 @@ class FirestoreApi {
|
|
|
22
22
|
this.printer = new pretty_print_1.PrettyPrint();
|
|
23
23
|
}
|
|
24
24
|
static processIndex(index) {
|
|
25
|
-
var _a;
|
|
26
25
|
let fields = index.fields;
|
|
27
26
|
const suffixOrder = FirestoreApi.lastIndexFieldOrder(fields);
|
|
28
27
|
const nameSuffix = { fieldPath: "__name__", order: suffixOrder };
|
|
29
|
-
const lastField =
|
|
28
|
+
const lastField = index.fields?.[index.fields.length - 1];
|
|
30
29
|
if (lastField.vectorConfig) {
|
|
31
30
|
const vectorField = lastField;
|
|
32
31
|
fields = fields.slice(0, -1);
|
|
33
|
-
if (fields.length === 0 ||
|
|
32
|
+
if (fields.length === 0 || fields?.[fields.length - 1].fieldPath !== "__name__") {
|
|
34
33
|
fields.push(nameSuffix);
|
|
35
34
|
}
|
|
36
35
|
fields.push(vectorField);
|
|
37
|
-
return
|
|
36
|
+
return {
|
|
37
|
+
...index,
|
|
38
|
+
fields,
|
|
39
|
+
};
|
|
38
40
|
}
|
|
39
|
-
if (
|
|
41
|
+
if (lastField?.fieldPath !== "__name__") {
|
|
40
42
|
fields.push(nameSuffix);
|
|
41
43
|
}
|
|
42
|
-
return
|
|
44
|
+
return {
|
|
45
|
+
...index,
|
|
46
|
+
fields,
|
|
47
|
+
};
|
|
43
48
|
}
|
|
44
49
|
static lastIndexFieldOrder(fields) {
|
|
45
50
|
let lastIndexFieldOrder = types.Order.ASCENDING;
|
|
@@ -51,7 +56,6 @@ class FirestoreApi {
|
|
|
51
56
|
return lastIndexFieldOrder;
|
|
52
57
|
}
|
|
53
58
|
async deploy(options, indexes, fieldOverrides, databaseId = "(default)") {
|
|
54
|
-
var _a;
|
|
55
59
|
const spec = this.upgradeOldSpec({
|
|
56
60
|
indexes,
|
|
57
61
|
fieldOverrides,
|
|
@@ -62,7 +66,7 @@ class FirestoreApi {
|
|
|
62
66
|
const existingIndexes = await this.listIndexes(options.project, databaseId);
|
|
63
67
|
const existingFieldOverrides = await this.listFieldOverrides(options.project, databaseId);
|
|
64
68
|
const database = await this.getDatabase(options.project, databaseId);
|
|
65
|
-
const edition =
|
|
69
|
+
const edition = database.databaseEdition ?? api_types_1.DatabaseEdition.STANDARD;
|
|
66
70
|
const indexesToDelete = existingIndexes.filter((index) => {
|
|
67
71
|
return !indexesToDeploy.some((spec) => this.indexMatchesSpec(index, spec, edition));
|
|
68
72
|
});
|
|
@@ -571,7 +575,6 @@ class FirestoreApi {
|
|
|
571
575
|
return database;
|
|
572
576
|
}
|
|
573
577
|
async bulkDeleteDocuments(project, databaseId, collectionIds) {
|
|
574
|
-
var _a;
|
|
575
578
|
const name = `/projects/${project}/databases/${databaseId}`;
|
|
576
579
|
const url = `${name}:bulkDeleteDocuments`;
|
|
577
580
|
const payload = {
|
|
@@ -580,7 +583,7 @@ class FirestoreApi {
|
|
|
580
583
|
};
|
|
581
584
|
const res = await this.apiClient.post(url, payload);
|
|
582
585
|
return {
|
|
583
|
-
name:
|
|
586
|
+
name: res.body?.name,
|
|
584
587
|
};
|
|
585
588
|
}
|
|
586
589
|
async restoreDatabase(project, databaseId, backupName, encryptionConfig) {
|
|
@@ -628,7 +631,6 @@ class FirestoreApi {
|
|
|
628
631
|
return res.body;
|
|
629
632
|
}
|
|
630
633
|
async cancelOperation(project, databaseId, operationName) {
|
|
631
|
-
var _a, _b, _c, _d;
|
|
632
634
|
const url = `/projects/${project}/databases/${databaseId}/operations/${operationName}:cancel`;
|
|
633
635
|
try {
|
|
634
636
|
const res = await this.apiClient.post(url);
|
|
@@ -636,9 +638,9 @@ class FirestoreApi {
|
|
|
636
638
|
}
|
|
637
639
|
catch (error) {
|
|
638
640
|
const reason = "Cannot cancel an operation that is completed.";
|
|
639
|
-
const details =
|
|
641
|
+
const details = error.context?.body?.error?.details || [];
|
|
640
642
|
for (const detail of details) {
|
|
641
|
-
if (
|
|
643
|
+
if (detail.detail?.includes(reason)) {
|
|
642
644
|
throw new error_1.FirebaseError(reason);
|
|
643
645
|
}
|
|
644
646
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Duration = exports.DURATION_REGEX = void 0;
|
|
4
|
+
exports.calculateRetention = calculateRetention;
|
|
4
5
|
const error_1 = require("../error");
|
|
5
6
|
exports.DURATION_REGEX = /^(\d+)([hdmw])$/;
|
|
6
7
|
var Duration;
|
|
@@ -9,7 +10,7 @@ var Duration;
|
|
|
9
10
|
Duration[Duration["HOUR"] = 3600] = "HOUR";
|
|
10
11
|
Duration[Duration["DAY"] = 86400] = "DAY";
|
|
11
12
|
Duration[Duration["WEEK"] = 604800] = "WEEK";
|
|
12
|
-
})(Duration
|
|
13
|
+
})(Duration || (exports.Duration = Duration = {}));
|
|
13
14
|
const DURATIONS = {
|
|
14
15
|
m: Duration.MINUTE,
|
|
15
16
|
h: Duration.HOUR,
|
|
@@ -27,4 +28,3 @@ function calculateRetention(flag) {
|
|
|
27
28
|
}
|
|
28
29
|
return d;
|
|
29
30
|
}
|
|
30
|
-
exports.calculateRetention = calculateRetention;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkDatabaseType =
|
|
3
|
+
exports.checkDatabaseType = checkDatabaseType;
|
|
4
4
|
const api_1 = require("../api");
|
|
5
5
|
const apiv2_1 = require("../apiv2");
|
|
6
6
|
const logger_1 = require("../logger");
|
|
@@ -22,4 +22,3 @@ async function checkDatabaseType(projectId, databaseId = "(default)") {
|
|
|
22
22
|
return undefined;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
exports.checkDatabaseType = checkDatabaseType;
|
package/lib/firestore/delete.js
CHANGED
|
@@ -12,14 +12,13 @@ const api_1 = require("../api");
|
|
|
12
12
|
const MIN_ID = "__id-9223372036854775808__";
|
|
13
13
|
class FirestoreDelete {
|
|
14
14
|
constructor(project, path, options) {
|
|
15
|
-
var _a;
|
|
16
15
|
this.project = project;
|
|
17
16
|
this.path = path || "";
|
|
18
17
|
this.recursive = Boolean(options.recursive);
|
|
19
18
|
this.shallow = Boolean(options.shallow);
|
|
20
19
|
this.allCollections = Boolean(options.allCollections);
|
|
21
20
|
this.databaseId = options.databaseId;
|
|
22
|
-
this.urlPrefix =
|
|
21
|
+
this.urlPrefix = options.urlPrefix ?? (0, api_1.firestoreOriginOrEmulator)();
|
|
23
22
|
this.readBatchSize = 7500;
|
|
24
23
|
this.maxPendingDeletes = 15;
|
|
25
24
|
this.deleteBatchSize = 250;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encodeFirestoreValue =
|
|
3
|
+
exports.encodeFirestoreValue = encodeFirestoreValue;
|
|
4
4
|
const _ = require("lodash");
|
|
5
5
|
const error_1 = require("../error");
|
|
6
6
|
function isPlainObject(input) {
|
|
@@ -56,4 +56,3 @@ function encodeFirestoreValue(data) {
|
|
|
56
56
|
return acc;
|
|
57
57
|
}, {});
|
|
58
58
|
}
|
|
59
|
-
exports.encodeFirestoreValue = encodeFirestoreValue;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFirestoreConfig =
|
|
3
|
+
exports.getFirestoreConfig = getFirestoreConfig;
|
|
4
4
|
const error_1 = require("../error");
|
|
5
5
|
const logger_1 = require("../logger");
|
|
6
6
|
function getFirestoreConfig(projectId, options) {
|
|
@@ -71,4 +71,3 @@ function getFirestoreConfig(projectId, options) {
|
|
|
71
71
|
}
|
|
72
72
|
return results;
|
|
73
73
|
}
|
|
74
|
-
exports.getFirestoreConfig = getFirestoreConfig;
|
package/lib/firestore/options.js
CHANGED
|
@@ -6,4 +6,4 @@ var EncryptionType;
|
|
|
6
6
|
EncryptionType["CUSTOMER_MANAGED_ENCRYPTION"] = "CUSTOMER_MANAGED_ENCRYPTION";
|
|
7
7
|
EncryptionType["USE_SOURCE_ENCRYPTION"] = "USE_SOURCE_ENCRYPTION";
|
|
8
8
|
EncryptionType["GOOGLE_DEFAULT_ENCRYPTION"] = "GOOGLE_DEFAULT_ENCRYPTION";
|
|
9
|
-
})(EncryptionType
|
|
9
|
+
})(EncryptionType || (exports.EncryptionType = EncryptionType = {}));
|
package/lib/firestore/util.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseDatabaseName = parseDatabaseName;
|
|
4
|
+
exports.parseIndexName = parseIndexName;
|
|
5
|
+
exports.parseFieldName = parseFieldName;
|
|
6
|
+
exports.booleanXOR = booleanXOR;
|
|
7
|
+
exports.getCurrentMinuteAsIsoString = getCurrentMinuteAsIsoString;
|
|
4
8
|
const error_1 = require("../error");
|
|
5
9
|
const DATABASE_NAME_REGEX = /projects\/([^\/]+?)\/databases\/([^\/]+)/;
|
|
6
10
|
const INDEX_NAME_REGEX = /projects\/([^\/]+?)\/databases\/([^\/]+?)\/collectionGroups\/([^\/]+?)\/indexes\/([^\/]*)/;
|
|
@@ -18,7 +22,6 @@ function parseDatabaseName(name) {
|
|
|
18
22
|
databaseId: m[2],
|
|
19
23
|
};
|
|
20
24
|
}
|
|
21
|
-
exports.parseDatabaseName = parseDatabaseName;
|
|
22
25
|
function parseIndexName(name) {
|
|
23
26
|
if (!name) {
|
|
24
27
|
throw new error_1.FirebaseError(`Cannot parse undefined index name.`);
|
|
@@ -34,7 +37,6 @@ function parseIndexName(name) {
|
|
|
34
37
|
indexId: m[4],
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
|
-
exports.parseIndexName = parseIndexName;
|
|
38
40
|
function parseFieldName(name) {
|
|
39
41
|
const m = name.match(FIELD_NAME_REGEX);
|
|
40
42
|
if (!m || m.length < 4) {
|
|
@@ -47,14 +49,11 @@ function parseFieldName(name) {
|
|
|
47
49
|
fieldPath: m[4],
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
|
-
exports.parseFieldName = parseFieldName;
|
|
51
52
|
function booleanXOR(a, b) {
|
|
52
53
|
return !!(Number(a) - Number(b));
|
|
53
54
|
}
|
|
54
|
-
exports.booleanXOR = booleanXOR;
|
|
55
55
|
function getCurrentMinuteAsIsoString() {
|
|
56
56
|
const mostRecentTimestamp = new Date(Date.now());
|
|
57
57
|
mostRecentTimestamp.setSeconds(0, 0);
|
|
58
58
|
return mostRecentTimestamp.toISOString();
|
|
59
59
|
}
|
|
60
|
-
exports.getCurrentMinuteAsIsoString = getCurrentMinuteAsIsoString;
|