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,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULT_RUNTIME = void 0;
|
|
4
|
+
exports.readExtensionYaml = readExtensionYaml;
|
|
5
|
+
exports.readPostinstall = readPostinstall;
|
|
6
|
+
exports.getFunctionResourcesWithParamSubstitution = getFunctionResourcesWithParamSubstitution;
|
|
7
|
+
exports.getFunctionProperties = getFunctionProperties;
|
|
8
|
+
exports.getRuntime = getRuntime;
|
|
4
9
|
const supported = require("../../deploy/functions/runtimes/supported");
|
|
5
10
|
const error_1 = require("../../error");
|
|
6
11
|
const extensionsHelper_1 = require("../extensionsHelper");
|
|
@@ -14,36 +19,31 @@ const validFunctionTypes = [
|
|
|
14
19
|
"firebaseextensions.v1beta.scheduledFunction",
|
|
15
20
|
];
|
|
16
21
|
async function readExtensionYaml(directory) {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
18
22
|
const extensionYaml = await (0, utils_2.readFileFromDirectory)(directory, SPEC_FILE);
|
|
19
23
|
const source = extensionYaml.source;
|
|
20
24
|
const spec = (0, utils_2.wrappedSafeLoad)(source);
|
|
21
|
-
spec.params =
|
|
22
|
-
spec.systemParams =
|
|
23
|
-
spec.resources =
|
|
24
|
-
spec.apis =
|
|
25
|
-
spec.roles =
|
|
26
|
-
spec.externalServices =
|
|
27
|
-
spec.events =
|
|
28
|
-
spec.lifecycleEvents =
|
|
29
|
-
spec.contributors =
|
|
25
|
+
spec.params = spec.params ?? [];
|
|
26
|
+
spec.systemParams = spec.systemParams ?? [];
|
|
27
|
+
spec.resources = spec.resources ?? [];
|
|
28
|
+
spec.apis = spec.apis ?? [];
|
|
29
|
+
spec.roles = spec.roles ?? [];
|
|
30
|
+
spec.externalServices = spec.externalServices ?? [];
|
|
31
|
+
spec.events = spec.events ?? [];
|
|
32
|
+
spec.lifecycleEvents = spec.lifecycleEvents ?? [];
|
|
33
|
+
spec.contributors = spec.contributors ?? [];
|
|
30
34
|
return spec;
|
|
31
35
|
}
|
|
32
|
-
exports.readExtensionYaml = readExtensionYaml;
|
|
33
36
|
async function readPostinstall(directory) {
|
|
34
37
|
const content = await (0, utils_2.readFileFromDirectory)(directory, POSTINSTALL_FILE);
|
|
35
38
|
return content.source;
|
|
36
39
|
}
|
|
37
|
-
exports.readPostinstall = readPostinstall;
|
|
38
40
|
function getFunctionResourcesWithParamSubstitution(extensionSpec, params) {
|
|
39
41
|
const rawResources = extensionSpec.resources.filter((resource) => validFunctionTypes.includes(resource.type));
|
|
40
42
|
return (0, extensionsHelper_1.substituteParams)(rawResources, params);
|
|
41
43
|
}
|
|
42
|
-
exports.getFunctionResourcesWithParamSubstitution = getFunctionResourcesWithParamSubstitution;
|
|
43
44
|
function getFunctionProperties(resources) {
|
|
44
45
|
return resources.map((r) => r.properties);
|
|
45
46
|
}
|
|
46
|
-
exports.getFunctionProperties = getFunctionProperties;
|
|
47
47
|
exports.DEFAULT_RUNTIME = supported.latest("nodejs");
|
|
48
48
|
function getRuntime(resources) {
|
|
49
49
|
if (resources.length === 0) {
|
|
@@ -66,4 +66,3 @@ function getRuntime(resources) {
|
|
|
66
66
|
}
|
|
67
67
|
return supported.latest("nodejs", runtimes);
|
|
68
68
|
}
|
|
69
|
-
exports.getRuntime = getRuntime;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.functionResourceToEmulatedTriggerDefintion =
|
|
3
|
+
exports.functionResourceToEmulatedTriggerDefintion = functionResourceToEmulatedTriggerDefintion;
|
|
4
4
|
const emulatorLogger_1 = require("../../emulator/emulatorLogger");
|
|
5
5
|
const functionsEmulatorShared_1 = require("../../emulator/functionsEmulatorShared");
|
|
6
6
|
const types_1 = require("../../emulator/types");
|
|
@@ -16,7 +16,6 @@ const SUPPORTED_SYSTEM_PARAMS = {
|
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
18
|
function functionResourceToEmulatedTriggerDefintion(resource, systemParams = {}) {
|
|
19
|
-
var _a, _b;
|
|
20
19
|
const resourceType = resource.type;
|
|
21
20
|
if (resource.type === types_2.FUNCTIONS_RESOURCE_TYPE) {
|
|
22
21
|
const etd = {
|
|
@@ -93,8 +92,8 @@ function functionResourceToEmulatedTriggerDefintion(resource, systemParams = {})
|
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
if (properties.eventTrigger.eventType.includes("google.cloud.firestore")) {
|
|
96
|
-
eventFilters["database"] =
|
|
97
|
-
eventFilters["namespace"] =
|
|
95
|
+
eventFilters["database"] = eventFilters["database"] ?? "(default)";
|
|
96
|
+
eventFilters["namespace"] = eventFilters["namespace"] ?? "(default)";
|
|
98
97
|
}
|
|
99
98
|
etd.eventTrigger.eventFilters = eventFilters;
|
|
100
99
|
etd.eventTrigger.eventFilterPathPatterns = eventFilterPathPatterns;
|
|
@@ -107,4 +106,3 @@ function functionResourceToEmulatedTriggerDefintion(resource, systemParams = {})
|
|
|
107
106
|
}
|
|
108
107
|
throw new error_1.FirebaseError("Unexpected resource type " + resourceType);
|
|
109
108
|
}
|
|
110
|
-
exports.functionResourceToEmulatedTriggerDefintion = functionResourceToEmulatedTriggerDefintion;
|
package/lib/extensions/etags.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.saveEtags = saveEtags;
|
|
4
|
+
exports.detectEtagChanges = detectEtagChanges;
|
|
4
5
|
function saveEtags(rc, projectId, instances) {
|
|
5
6
|
rc.setEtags(projectId, "extensionInstances", etagsMap(instances));
|
|
6
7
|
}
|
|
7
|
-
exports.saveEtags = saveEtags;
|
|
8
8
|
function detectEtagChanges(rc, projectId, instances) {
|
|
9
9
|
const lastDeployedEtags = rc.getEtags(projectId).extensionInstances;
|
|
10
10
|
const currentEtags = etagsMap(instances);
|
|
@@ -17,7 +17,6 @@ function detectEtagChanges(rc, projectId, instances) {
|
|
|
17
17
|
const newExtensionInstances = Object.keys(currentEtags).filter((instanceName) => !lastDeployedEtags[instanceName]);
|
|
18
18
|
return newExtensionInstances.concat(changedExtensionInstances);
|
|
19
19
|
}
|
|
20
|
-
exports.detectEtagChanges = detectEtagChanges;
|
|
21
20
|
function etagsMap(instances) {
|
|
22
21
|
return instances.reduce((acc, i) => {
|
|
23
22
|
if (i.etag) {
|
package/lib/extensions/export.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parameterizeProject = parameterizeProject;
|
|
4
|
+
exports.setSecretParamsToLatest = setSecretParamsToLatest;
|
|
5
|
+
exports.displayExportInfo = displayExportInfo;
|
|
4
6
|
const planner_1 = require("../deploy/extensions/planner");
|
|
5
7
|
const deploymentSummary_1 = require("../deploy/extensions/deploymentSummary");
|
|
6
8
|
const logger_1 = require("../logger");
|
|
@@ -13,13 +15,12 @@ function parameterizeProject(projectId, projectNumber, spec) {
|
|
|
13
15
|
const p2 = p1.replace(projectNumber, "${param:PROJECT_NUMBER}");
|
|
14
16
|
newParams[key] = p2;
|
|
15
17
|
}
|
|
16
|
-
const newSpec =
|
|
18
|
+
const newSpec = { ...spec };
|
|
17
19
|
newSpec.params = newParams;
|
|
18
20
|
return newSpec;
|
|
19
21
|
}
|
|
20
|
-
exports.parameterizeProject = parameterizeProject;
|
|
21
22
|
async function setSecretParamsToLatest(spec) {
|
|
22
|
-
const newParams =
|
|
23
|
+
const newParams = { ...spec.params };
|
|
23
24
|
const extensionVersion = await (0, planner_1.getExtensionVersion)(spec);
|
|
24
25
|
const activeSecrets = (0, secretsUtils_1.getActiveSecrets)(extensionVersion.spec, newParams);
|
|
25
26
|
for (const [key, val] of Object.entries(newParams)) {
|
|
@@ -29,9 +30,8 @@ async function setSecretParamsToLatest(spec) {
|
|
|
29
30
|
newParams[key] = (0, secretManager_1.toSecretVersionResourceName)(parsed);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
return
|
|
33
|
+
return { ...spec, params: newParams };
|
|
33
34
|
}
|
|
34
|
-
exports.setSecretParamsToLatest = setSecretParamsToLatest;
|
|
35
35
|
function displayExportInfo(withRef, withoutRef) {
|
|
36
36
|
logger_1.logger.info("The following Extension instances will be saved locally:");
|
|
37
37
|
logger_1.logger.info("");
|
|
@@ -43,9 +43,7 @@ function displayExportInfo(withRef, withoutRef) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
exports.displayExportInfo = displayExportInfo;
|
|
47
46
|
function displaySpecs(specs) {
|
|
48
|
-
var _a;
|
|
49
47
|
for (let i = 0; i < specs.length; i++) {
|
|
50
48
|
const spec = specs[i];
|
|
51
49
|
logger_1.logger.info(`${i + 1}. ${(0, deploymentSummary_1.humanReadable)(spec)}`);
|
|
@@ -53,7 +51,7 @@ function displaySpecs(specs) {
|
|
|
53
51
|
for (const p of Object.entries(spec.params)) {
|
|
54
52
|
logger_1.logger.info(`\t${p[0]}=${p[1]}`);
|
|
55
53
|
}
|
|
56
|
-
if (
|
|
54
|
+
if (spec.allowedEventTypes?.length) {
|
|
57
55
|
logger_1.logger.info(`\tALLOWED_EVENTS=${spec.allowedEventTypes}`);
|
|
58
56
|
}
|
|
59
57
|
if (spec.eventarcChannel) {
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createInstance = createInstance;
|
|
4
|
+
exports.deleteInstance = deleteInstance;
|
|
5
|
+
exports.getInstance = getInstance;
|
|
6
|
+
exports.listInstances = listInstances;
|
|
7
|
+
exports.configureInstance = configureInstance;
|
|
8
|
+
exports.updateInstance = updateInstance;
|
|
9
|
+
exports.updateInstanceFromRegistry = updateInstanceFromRegistry;
|
|
10
|
+
exports.populateSpec = populateSpec;
|
|
11
|
+
exports.createSource = createSource;
|
|
12
|
+
exports.getSource = getSource;
|
|
13
|
+
exports.getExtensionVersion = getExtensionVersion;
|
|
14
|
+
exports.listExtensions = listExtensions;
|
|
15
|
+
exports.listExtensionVersions = listExtensionVersions;
|
|
16
|
+
exports.getExtension = getExtension;
|
|
17
|
+
exports.refNotFoundError = refNotFoundError;
|
|
4
18
|
const yaml = require("yaml");
|
|
5
19
|
const clc = require("colorette");
|
|
6
20
|
const apiv2_1 = require("../apiv2");
|
|
@@ -38,10 +52,9 @@ async function createInstanceHelper(projectId, instanceId, config, labels, valid
|
|
|
38
52
|
return pollRes;
|
|
39
53
|
}
|
|
40
54
|
async function createInstance(args) {
|
|
41
|
-
var _a, _b, _c;
|
|
42
55
|
const config = {
|
|
43
56
|
params: args.params,
|
|
44
|
-
systemParams:
|
|
57
|
+
systemParams: args.systemParams ?? {},
|
|
45
58
|
allowedEventTypes: args.allowedEventTypes,
|
|
46
59
|
eventarcChannel: args.eventarcChannel,
|
|
47
60
|
};
|
|
@@ -49,12 +62,12 @@ async function createInstance(args) {
|
|
|
49
62
|
throw new error_1.FirebaseError("ExtensionSource and ExtensionVersion both provided, but only one should be.");
|
|
50
63
|
}
|
|
51
64
|
else if (args.extensionSource) {
|
|
52
|
-
config.source = { name:
|
|
65
|
+
config.source = { name: args.extensionSource?.name };
|
|
53
66
|
}
|
|
54
67
|
else if (args.extensionVersionRef) {
|
|
55
68
|
const ref = refs.parse(args.extensionVersionRef);
|
|
56
69
|
config.extensionRef = refs.toExtensionRef(ref);
|
|
57
|
-
config.extensionVersion =
|
|
70
|
+
config.extensionVersion = ref.version ?? "";
|
|
58
71
|
}
|
|
59
72
|
else {
|
|
60
73
|
throw new error_1.FirebaseError("No ExtensionVersion or ExtensionSource provided but one is required.");
|
|
@@ -67,7 +80,6 @@ async function createInstance(args) {
|
|
|
67
80
|
}
|
|
68
81
|
return await createInstanceHelper(args.projectId, args.instanceId, config, args.labels, args.validateOnly);
|
|
69
82
|
}
|
|
70
|
-
exports.createInstance = createInstance;
|
|
71
83
|
async function deleteInstance(projectId, instanceId) {
|
|
72
84
|
const deleteRes = await extensionsApiClient.delete(`/projects/${projectId}/instances/${instanceId}`);
|
|
73
85
|
const pollRes = await operationPoller.pollOperation({
|
|
@@ -78,7 +90,6 @@ async function deleteInstance(projectId, instanceId) {
|
|
|
78
90
|
});
|
|
79
91
|
return pollRes;
|
|
80
92
|
}
|
|
81
|
-
exports.deleteInstance = deleteInstance;
|
|
82
93
|
async function getInstance(projectId, instanceId) {
|
|
83
94
|
try {
|
|
84
95
|
const res = await extensionsApiClient.get(`/projects/${projectId}/instances/${instanceId}`);
|
|
@@ -93,7 +104,6 @@ async function getInstance(projectId, instanceId) {
|
|
|
93
104
|
throw err;
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
|
-
exports.getInstance = getInstance;
|
|
97
107
|
async function listInstances(projectId) {
|
|
98
108
|
const instances = [];
|
|
99
109
|
const getNextPage = async (pageToken = "") => {
|
|
@@ -113,14 +123,12 @@ async function listInstances(projectId) {
|
|
|
113
123
|
await getNextPage();
|
|
114
124
|
return instances;
|
|
115
125
|
}
|
|
116
|
-
exports.listInstances = listInstances;
|
|
117
126
|
async function configureInstance(args) {
|
|
118
|
-
var _a;
|
|
119
127
|
const reqBody = {
|
|
120
128
|
projectId: args.projectId,
|
|
121
129
|
instanceId: args.instanceId,
|
|
122
130
|
updateMask: "config.params",
|
|
123
|
-
validateOnly:
|
|
131
|
+
validateOnly: args.validateOnly ?? false,
|
|
124
132
|
data: {
|
|
125
133
|
config: {
|
|
126
134
|
params: args.params,
|
|
@@ -141,9 +149,7 @@ async function configureInstance(args) {
|
|
|
141
149
|
}
|
|
142
150
|
return patchInstance(reqBody);
|
|
143
151
|
}
|
|
144
|
-
exports.configureInstance = configureInstance;
|
|
145
152
|
async function updateInstance(args) {
|
|
146
|
-
var _a;
|
|
147
153
|
const body = {
|
|
148
154
|
config: {
|
|
149
155
|
source: { name: args.extensionSource.name },
|
|
@@ -170,13 +176,11 @@ async function updateInstance(args) {
|
|
|
170
176
|
projectId: args.projectId,
|
|
171
177
|
instanceId: args.instanceId,
|
|
172
178
|
updateMask,
|
|
173
|
-
validateOnly:
|
|
179
|
+
validateOnly: args.validateOnly ?? false,
|
|
174
180
|
data: body,
|
|
175
181
|
});
|
|
176
182
|
}
|
|
177
|
-
exports.updateInstance = updateInstance;
|
|
178
183
|
async function updateInstanceFromRegistry(args) {
|
|
179
|
-
var _a;
|
|
180
184
|
const ref = refs.parse(args.extRef);
|
|
181
185
|
const body = {
|
|
182
186
|
config: {
|
|
@@ -205,11 +209,10 @@ async function updateInstanceFromRegistry(args) {
|
|
|
205
209
|
projectId: args.projectId,
|
|
206
210
|
instanceId: args.instanceId,
|
|
207
211
|
updateMask,
|
|
208
|
-
validateOnly:
|
|
212
|
+
validateOnly: args.validateOnly ?? false,
|
|
209
213
|
data: body,
|
|
210
214
|
});
|
|
211
215
|
}
|
|
212
|
-
exports.updateInstanceFromRegistry = updateInstanceFromRegistry;
|
|
213
216
|
async function patchInstance(args) {
|
|
214
217
|
const updateRes = await extensionsApiClient.patch(`/projects/${args.projectId}/instances/${args.instanceId}`, args.data, {
|
|
215
218
|
queryParams: {
|
|
@@ -229,7 +232,6 @@ async function patchInstance(args) {
|
|
|
229
232
|
return pollRes;
|
|
230
233
|
}
|
|
231
234
|
function populateSpec(spec) {
|
|
232
|
-
var _a, _b;
|
|
233
235
|
if (spec) {
|
|
234
236
|
for (const r of spec.resources) {
|
|
235
237
|
try {
|
|
@@ -241,11 +243,10 @@ function populateSpec(spec) {
|
|
|
241
243
|
logger_1.logger.debug(`[ext] failed to parse resource properties yaml: ${(0, error_1.getErrMsg)(err)}`);
|
|
242
244
|
}
|
|
243
245
|
}
|
|
244
|
-
spec.params =
|
|
245
|
-
spec.systemParams =
|
|
246
|
+
spec.params = spec.params ?? [];
|
|
247
|
+
spec.systemParams = spec.systemParams ?? [];
|
|
246
248
|
}
|
|
247
249
|
}
|
|
248
|
-
exports.populateSpec = populateSpec;
|
|
249
250
|
async function createSource(projectId, packageUri, extensionRoot) {
|
|
250
251
|
const createRes = await extensionsApiClient.post(`/projects/${projectId}/sources/`, {
|
|
251
252
|
packageUri,
|
|
@@ -262,7 +263,6 @@ async function createSource(projectId, packageUri, extensionRoot) {
|
|
|
262
263
|
}
|
|
263
264
|
return pollRes;
|
|
264
265
|
}
|
|
265
|
-
exports.createSource = createSource;
|
|
266
266
|
async function getSource(sourceName) {
|
|
267
267
|
const res = await extensionsApiClient.get(`/${sourceName}`);
|
|
268
268
|
if (res.body.spec) {
|
|
@@ -270,7 +270,6 @@ async function getSource(sourceName) {
|
|
|
270
270
|
}
|
|
271
271
|
return res.body;
|
|
272
272
|
}
|
|
273
|
-
exports.getSource = getSource;
|
|
274
273
|
async function getExtensionVersion(extensionVersionRef) {
|
|
275
274
|
const ref = refs.parse(extensionVersionRef);
|
|
276
275
|
if (!ref.version) {
|
|
@@ -293,7 +292,6 @@ async function getExtensionVersion(extensionVersionRef) {
|
|
|
293
292
|
throw new error_1.FirebaseError(`Failed to query the extension version '${clc.bold(extensionVersionRef)}': ${(0, error_1.getErrMsg)(err)}`);
|
|
294
293
|
}
|
|
295
294
|
}
|
|
296
|
-
exports.getExtensionVersion = getExtensionVersion;
|
|
297
295
|
async function listExtensions(publisherId) {
|
|
298
296
|
const extensions = [];
|
|
299
297
|
const getNextPage = async (pageToken = "") => {
|
|
@@ -313,7 +311,6 @@ async function listExtensions(publisherId) {
|
|
|
313
311
|
await getNextPage();
|
|
314
312
|
return extensions;
|
|
315
313
|
}
|
|
316
|
-
exports.listExtensions = listExtensions;
|
|
317
314
|
async function listExtensionVersions(ref, filter = "", showPrereleases = false) {
|
|
318
315
|
const { publisherId, extensionId } = refs.parse(ref);
|
|
319
316
|
const extensionVersions = [];
|
|
@@ -336,7 +333,6 @@ async function listExtensionVersions(ref, filter = "", showPrereleases = false)
|
|
|
336
333
|
await getNextPage();
|
|
337
334
|
return extensionVersions;
|
|
338
335
|
}
|
|
339
|
-
exports.listExtensionVersions = listExtensionVersions;
|
|
340
336
|
async function getExtension(extensionRef) {
|
|
341
337
|
const ref = refs.parse(extensionRef);
|
|
342
338
|
try {
|
|
@@ -355,11 +351,9 @@ async function getExtension(extensionRef) {
|
|
|
355
351
|
});
|
|
356
352
|
}
|
|
357
353
|
}
|
|
358
|
-
exports.getExtension = getExtension;
|
|
359
354
|
function refNotFoundError(ref) {
|
|
360
355
|
return new error_1.FirebaseError(`The extension reference '${clc.bold(ref.version ? refs.toExtensionVersionRef(ref) : refs.toExtensionRef(ref))}' doesn't exist. This could happen for two reasons:\n` +
|
|
361
356
|
` -The publisher ID '${clc.bold(ref.publisherId)}' doesn't exist or could be misspelled\n` +
|
|
362
357
|
` -The name of the ${ref.version ? "extension version" : "extension"} '${clc.bold(ref.version ? `${ref.extensionId}@${ref.version}` : ref.extensionId)}' doesn't exist or could be misspelled\n\n` +
|
|
363
358
|
`Please correct the extension reference and try again. If you meant to reference an extension from a local source, please provide a relative path prefixed with '${clc.bold("./")}', '${clc.bold("../")}', or '${clc.bold("~/")}'.}`, { status: 404 });
|
|
364
359
|
}
|
|
365
|
-
exports.refNotFoundError = refNotFoundError;
|