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,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.missingEndpoint = exports.hasEndpoint = exports.AllFunctionsPlatforms = exports.SCHEDULED_FUNCTION_LABEL = exports.MIN_CPU_FOR_CONCURRENCY = exports.DEFAULT_MEMORY = exports.DEFAULT_CONCURRENCY = exports.AllIngressSettings = exports.AllVpcEgressSettings = void 0;
|
|
4
|
+
exports.endpointTriggerType = endpointTriggerType;
|
|
5
|
+
exports.isValidMemoryOption = isValidMemoryOption;
|
|
6
|
+
exports.isValidEgressSetting = isValidEgressSetting;
|
|
7
|
+
exports.memoryOptionDisplayName = memoryOptionDisplayName;
|
|
8
|
+
exports.memoryToGen1Cpu = memoryToGen1Cpu;
|
|
9
|
+
exports.memoryToGen2Cpu = memoryToGen2Cpu;
|
|
10
|
+
exports.secretVersionName = secretVersionName;
|
|
11
|
+
exports.isHttpsTriggered = isHttpsTriggered;
|
|
12
|
+
exports.isDataConnectGraphqlTriggered = isDataConnectGraphqlTriggered;
|
|
13
|
+
exports.isCallableTriggered = isCallableTriggered;
|
|
14
|
+
exports.isEventTriggered = isEventTriggered;
|
|
15
|
+
exports.isScheduleTriggered = isScheduleTriggered;
|
|
16
|
+
exports.isTaskQueueTriggered = isTaskQueueTriggered;
|
|
17
|
+
exports.isBlockingTriggered = isBlockingTriggered;
|
|
18
|
+
exports.empty = empty;
|
|
19
|
+
exports.of = of;
|
|
20
|
+
exports.merge = merge;
|
|
21
|
+
exports.isEmptyBackend = isEmptyBackend;
|
|
22
|
+
exports.functionName = functionName;
|
|
23
|
+
exports.scheduleIdForFunction = scheduleIdForFunction;
|
|
24
|
+
exports.existingBackend = existingBackend;
|
|
25
|
+
exports.checkAvailability = checkAvailability;
|
|
26
|
+
exports.allEndpoints = allEndpoints;
|
|
27
|
+
exports.someEndpoint = someEndpoint;
|
|
28
|
+
exports.findEndpoint = findEndpoint;
|
|
29
|
+
exports.matchingBackend = matchingBackend;
|
|
30
|
+
exports.regionalEndpoints = regionalEndpoints;
|
|
31
|
+
exports.compareFunctions = compareFunctions;
|
|
4
32
|
const gcf = require("../../gcp/cloudfunctions");
|
|
5
33
|
const gcfV2 = require("../../gcp/cloudfunctionsv2");
|
|
6
34
|
const run = require("../../gcp/runv2");
|
|
@@ -16,6 +44,9 @@ function endpointTriggerType(endpoint) {
|
|
|
16
44
|
else if (isHttpsTriggered(endpoint)) {
|
|
17
45
|
return "https";
|
|
18
46
|
}
|
|
47
|
+
else if (isDataConnectGraphqlTriggered(endpoint)) {
|
|
48
|
+
return "dataConnectGraphql";
|
|
49
|
+
}
|
|
19
50
|
else if (isCallableTriggered(endpoint)) {
|
|
20
51
|
return "callable";
|
|
21
52
|
}
|
|
@@ -30,7 +61,6 @@ function endpointTriggerType(endpoint) {
|
|
|
30
61
|
}
|
|
31
62
|
(0, functional_1.assertExhaustive)(endpoint);
|
|
32
63
|
}
|
|
33
|
-
exports.endpointTriggerType = endpointTriggerType;
|
|
34
64
|
exports.AllVpcEgressSettings = ["PRIVATE_RANGES_ONLY", "ALL_TRAFFIC"];
|
|
35
65
|
exports.AllIngressSettings = [
|
|
36
66
|
"ALLOW_ALL",
|
|
@@ -41,11 +71,9 @@ const allMemoryOptions = [128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768];
|
|
|
41
71
|
function isValidMemoryOption(mem) {
|
|
42
72
|
return allMemoryOptions.includes(mem);
|
|
43
73
|
}
|
|
44
|
-
exports.isValidMemoryOption = isValidMemoryOption;
|
|
45
74
|
function isValidEgressSetting(egress) {
|
|
46
75
|
return egress === "PRIVATE_RANGES_ONLY" || egress === "ALL_TRAFFIC";
|
|
47
76
|
}
|
|
48
|
-
exports.isValidEgressSetting = isValidEgressSetting;
|
|
49
77
|
function memoryOptionDisplayName(option) {
|
|
50
78
|
return {
|
|
51
79
|
128: "128MB",
|
|
@@ -59,7 +87,6 @@ function memoryOptionDisplayName(option) {
|
|
|
59
87
|
32768: "32GB",
|
|
60
88
|
}[option];
|
|
61
89
|
}
|
|
62
|
-
exports.memoryOptionDisplayName = memoryOptionDisplayName;
|
|
63
90
|
function memoryToGen1Cpu(memory) {
|
|
64
91
|
return {
|
|
65
92
|
128: 0.0833,
|
|
@@ -73,7 +100,6 @@ function memoryToGen1Cpu(memory) {
|
|
|
73
100
|
32768: 8,
|
|
74
101
|
}[memory];
|
|
75
102
|
}
|
|
76
|
-
exports.memoryToGen1Cpu = memoryToGen1Cpu;
|
|
77
103
|
function memoryToGen2Cpu(memory) {
|
|
78
104
|
return {
|
|
79
105
|
128: 1,
|
|
@@ -87,41 +113,35 @@ function memoryToGen2Cpu(memory) {
|
|
|
87
113
|
32768: 8,
|
|
88
114
|
}[memory];
|
|
89
115
|
}
|
|
90
|
-
exports.memoryToGen2Cpu = memoryToGen2Cpu;
|
|
91
116
|
exports.DEFAULT_CONCURRENCY = 80;
|
|
92
117
|
exports.DEFAULT_MEMORY = 256;
|
|
93
118
|
exports.MIN_CPU_FOR_CONCURRENCY = 1;
|
|
94
119
|
exports.SCHEDULED_FUNCTION_LABEL = Object.freeze({ deployment: "firebase-schedule" });
|
|
95
120
|
function secretVersionName(s) {
|
|
96
|
-
|
|
97
|
-
return `projects/${s.projectId}/secrets/${s.secret}/versions/${(_a = s.version) !== null && _a !== void 0 ? _a : "latest"}`;
|
|
121
|
+
return `projects/${s.projectId}/secrets/${s.secret}/versions/${s.version ?? "latest"}`;
|
|
98
122
|
}
|
|
99
|
-
exports.secretVersionName = secretVersionName;
|
|
100
123
|
exports.AllFunctionsPlatforms = ["gcfv1", "gcfv2", "run"];
|
|
101
124
|
function isHttpsTriggered(triggered) {
|
|
102
125
|
return {}.hasOwnProperty.call(triggered, "httpsTrigger");
|
|
103
126
|
}
|
|
104
|
-
|
|
127
|
+
function isDataConnectGraphqlTriggered(triggered) {
|
|
128
|
+
return {}.hasOwnProperty.call(triggered, "dataConnectGraphqlTrigger");
|
|
129
|
+
}
|
|
105
130
|
function isCallableTriggered(triggered) {
|
|
106
131
|
return {}.hasOwnProperty.call(triggered, "callableTrigger");
|
|
107
132
|
}
|
|
108
|
-
exports.isCallableTriggered = isCallableTriggered;
|
|
109
133
|
function isEventTriggered(triggered) {
|
|
110
134
|
return {}.hasOwnProperty.call(triggered, "eventTrigger");
|
|
111
135
|
}
|
|
112
|
-
exports.isEventTriggered = isEventTriggered;
|
|
113
136
|
function isScheduleTriggered(triggered) {
|
|
114
137
|
return {}.hasOwnProperty.call(triggered, "scheduleTrigger");
|
|
115
138
|
}
|
|
116
|
-
exports.isScheduleTriggered = isScheduleTriggered;
|
|
117
139
|
function isTaskQueueTriggered(triggered) {
|
|
118
140
|
return {}.hasOwnProperty.call(triggered, "taskQueueTrigger");
|
|
119
141
|
}
|
|
120
|
-
exports.isTaskQueueTriggered = isTaskQueueTriggered;
|
|
121
142
|
function isBlockingTriggered(triggered) {
|
|
122
143
|
return {}.hasOwnProperty.call(triggered, "blockingTrigger");
|
|
123
144
|
}
|
|
124
|
-
exports.isBlockingTriggered = isBlockingTriggered;
|
|
125
145
|
function empty() {
|
|
126
146
|
return {
|
|
127
147
|
requiredAPIs: [],
|
|
@@ -129,9 +149,8 @@ function empty() {
|
|
|
129
149
|
environmentVariables: {},
|
|
130
150
|
};
|
|
131
151
|
}
|
|
132
|
-
exports.empty = empty;
|
|
133
152
|
function of(...endpoints) {
|
|
134
|
-
const bkend =
|
|
153
|
+
const bkend = { ...empty() };
|
|
135
154
|
for (const endpoint of endpoints) {
|
|
136
155
|
bkend.endpoints[endpoint.region] = bkend.endpoints[endpoint.region] || {};
|
|
137
156
|
if (bkend.endpoints[endpoint.region][endpoint.id]) {
|
|
@@ -141,7 +160,6 @@ function of(...endpoints) {
|
|
|
141
160
|
}
|
|
142
161
|
return bkend;
|
|
143
162
|
}
|
|
144
|
-
exports.of = of;
|
|
145
163
|
function merge(...backends) {
|
|
146
164
|
const merged = of(...(0, functional_1.flattenArray)(backends.map((b) => allEndpoints(b))));
|
|
147
165
|
const apiToReasons = {};
|
|
@@ -153,35 +171,32 @@ function merge(...backends) {
|
|
|
153
171
|
}
|
|
154
172
|
apiToReasons[api] = reasons;
|
|
155
173
|
}
|
|
156
|
-
merged.environmentVariables =
|
|
174
|
+
merged.environmentVariables = { ...merged.environmentVariables, ...b.environmentVariables };
|
|
157
175
|
}
|
|
158
176
|
for (const [api, reasons] of Object.entries(apiToReasons)) {
|
|
159
177
|
merged.requiredAPIs.push({ api, reason: Array.from(reasons).join(" ") });
|
|
160
178
|
}
|
|
161
179
|
return merged;
|
|
162
180
|
}
|
|
163
|
-
exports.merge = merge;
|
|
164
181
|
function isEmptyBackend(backend) {
|
|
165
182
|
return (Object.keys(backend.requiredAPIs).length === 0 && Object.keys(backend.endpoints).length === 0);
|
|
166
183
|
}
|
|
167
|
-
exports.isEmptyBackend = isEmptyBackend;
|
|
168
184
|
function functionName(cloudFunction) {
|
|
169
185
|
return `projects/${cloudFunction.project}/locations/${cloudFunction.region}/functions/${cloudFunction.id}`;
|
|
170
186
|
}
|
|
171
|
-
exports.functionName = functionName;
|
|
172
187
|
function scheduleIdForFunction(cloudFunction) {
|
|
173
188
|
return `firebase-schedule-${cloudFunction.id}-${cloudFunction.region}`;
|
|
174
189
|
}
|
|
175
|
-
exports.scheduleIdForFunction = scheduleIdForFunction;
|
|
176
190
|
function existingBackend(context, forceRefresh) {
|
|
177
191
|
if (!context.existingBackendPromise || forceRefresh) {
|
|
178
192
|
context.existingBackendPromise = loadExistingBackend(context);
|
|
179
193
|
}
|
|
180
194
|
return context.existingBackendPromise;
|
|
181
195
|
}
|
|
182
|
-
exports.existingBackend = existingBackend;
|
|
183
196
|
async function loadExistingBackend(ctx) {
|
|
184
|
-
const existingBackend =
|
|
197
|
+
const existingBackend = {
|
|
198
|
+
...empty(),
|
|
199
|
+
};
|
|
185
200
|
const unreachableRegions = {
|
|
186
201
|
gcfV1: [],
|
|
187
202
|
gcfV2: [],
|
|
@@ -223,7 +238,6 @@ async function loadExistingBackend(ctx) {
|
|
|
223
238
|
return ctx.existingBackend;
|
|
224
239
|
}
|
|
225
240
|
async function checkAvailability(context, want) {
|
|
226
|
-
var _a, _b, _c, _d, _e;
|
|
227
241
|
await existingBackend(context);
|
|
228
242
|
const gcfV1Regions = new Set();
|
|
229
243
|
const gcfV2Regions = new Set();
|
|
@@ -235,41 +249,39 @@ async function checkAvailability(context, want) {
|
|
|
235
249
|
gcfV2Regions.add(ep.region);
|
|
236
250
|
}
|
|
237
251
|
}
|
|
238
|
-
const neededUnreachableV1 =
|
|
239
|
-
const neededUnreachableV2 =
|
|
240
|
-
if (neededUnreachableV1
|
|
252
|
+
const neededUnreachableV1 = context.unreachableRegions?.gcfV1.filter((region) => gcfV1Regions.has(region));
|
|
253
|
+
const neededUnreachableV2 = context.unreachableRegions?.gcfV2.filter((region) => gcfV2Regions.has(region));
|
|
254
|
+
if (neededUnreachableV1?.length) {
|
|
241
255
|
throw new error_1.FirebaseError("The following Cloud Functions regions are currently unreachable:\n\t" +
|
|
242
256
|
neededUnreachableV1.join("\n\t") +
|
|
243
257
|
"\nThis deployment contains functions in those regions. Please try again in a few minutes, or exclude these regions from your deployment.");
|
|
244
258
|
}
|
|
245
|
-
if (neededUnreachableV2
|
|
259
|
+
if (neededUnreachableV2?.length) {
|
|
246
260
|
throw new error_1.FirebaseError("The following Cloud Functions V2 regions are currently unreachable:\n\t" +
|
|
247
261
|
neededUnreachableV2.join("\n\t") +
|
|
248
262
|
"\nThis deployment contains functions in those regions. Please try again in a few minutes, or exclude these regions from your deployment.");
|
|
249
263
|
}
|
|
250
|
-
if (
|
|
264
|
+
if (context.unreachableRegions?.gcfV1.length) {
|
|
251
265
|
utils.logLabeledWarning("functions", "The following Cloud Functions regions are currently unreachable:\n" +
|
|
252
266
|
context.unreachableRegions.gcfV1.join("\n") +
|
|
253
267
|
"\nCloud Functions in these regions won't be deleted.");
|
|
254
268
|
}
|
|
255
|
-
if (
|
|
269
|
+
if (context.unreachableRegions?.gcfV2.length) {
|
|
256
270
|
utils.logLabeledWarning("functions", "The following Cloud Functions V2 regions are currently unreachable:\n" +
|
|
257
271
|
context.unreachableRegions.gcfV2.join("\n") +
|
|
258
272
|
"\nCloud Functions in these regions won't be deleted.");
|
|
259
273
|
}
|
|
260
|
-
if (
|
|
274
|
+
if (context.unreachableRegions?.run.length) {
|
|
261
275
|
utils.logLabeledWarning("functions", "The following Cloud Run regions are currently unreachable:\n" +
|
|
262
276
|
context.unreachableRegions.run.join("\n") +
|
|
263
277
|
"\nCloud Run services in these regions won't be deleted.");
|
|
264
278
|
}
|
|
265
279
|
}
|
|
266
|
-
exports.checkAvailability = checkAvailability;
|
|
267
280
|
function allEndpoints(backend) {
|
|
268
281
|
return Object.values(backend.endpoints).reduce((accum, perRegion) => {
|
|
269
282
|
return [...accum, ...Object.values(perRegion)];
|
|
270
283
|
}, []);
|
|
271
284
|
}
|
|
272
|
-
exports.allEndpoints = allEndpoints;
|
|
273
285
|
function someEndpoint(backend, predicate) {
|
|
274
286
|
for (const endpoints of Object.values(backend.endpoints)) {
|
|
275
287
|
if (Object.values(endpoints).some(predicate)) {
|
|
@@ -278,7 +290,6 @@ function someEndpoint(backend, predicate) {
|
|
|
278
290
|
}
|
|
279
291
|
return false;
|
|
280
292
|
}
|
|
281
|
-
exports.someEndpoint = someEndpoint;
|
|
282
293
|
function findEndpoint(backend, predicate) {
|
|
283
294
|
for (const endpoints of Object.values(backend.endpoints)) {
|
|
284
295
|
const endpoint = Object.values(endpoints).find(predicate);
|
|
@@ -286,9 +297,11 @@ function findEndpoint(backend, predicate) {
|
|
|
286
297
|
return endpoint;
|
|
287
298
|
}
|
|
288
299
|
}
|
|
289
|
-
exports.findEndpoint = findEndpoint;
|
|
290
300
|
function matchingBackend(backend, predicate) {
|
|
291
|
-
const filtered =
|
|
301
|
+
const filtered = {
|
|
302
|
+
...backend,
|
|
303
|
+
endpoints: {},
|
|
304
|
+
};
|
|
292
305
|
for (const endpoint of allEndpoints(backend)) {
|
|
293
306
|
if (!predicate(endpoint)) {
|
|
294
307
|
continue;
|
|
@@ -298,11 +311,9 @@ function matchingBackend(backend, predicate) {
|
|
|
298
311
|
}
|
|
299
312
|
return filtered;
|
|
300
313
|
}
|
|
301
|
-
exports.matchingBackend = matchingBackend;
|
|
302
314
|
function regionalEndpoints(backend, region) {
|
|
303
315
|
return backend.endpoints[region] ? Object.values(backend.endpoints[region]) : [];
|
|
304
316
|
}
|
|
305
|
-
exports.regionalEndpoints = regionalEndpoints;
|
|
306
317
|
const hasEndpoint = (backend) => (endpoint) => {
|
|
307
318
|
return (!!backend.endpoints[endpoint.region] && !!backend.endpoints[endpoint.region][endpoint.id]);
|
|
308
319
|
};
|
|
@@ -329,4 +340,3 @@ function compareFunctions(left, right) {
|
|
|
329
340
|
}
|
|
330
341
|
return 0;
|
|
331
342
|
}
|
|
332
|
-
exports.compareFunctions = compareFunctions;
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AllIngressSettings = exports.AllVpcEgressSettings = exports.AllFunctionsPlatforms = void 0;
|
|
4
|
+
exports.empty = empty;
|
|
5
|
+
exports.of = of;
|
|
6
|
+
exports.isHttpsTriggered = isHttpsTriggered;
|
|
7
|
+
exports.isDataConnectGraphqlTriggered = isDataConnectGraphqlTriggered;
|
|
8
|
+
exports.isCallableTriggered = isCallableTriggered;
|
|
9
|
+
exports.isEventTriggered = isEventTriggered;
|
|
10
|
+
exports.isScheduleTriggered = isScheduleTriggered;
|
|
11
|
+
exports.isTaskQueueTriggered = isTaskQueueTriggered;
|
|
12
|
+
exports.isBlockingTriggered = isBlockingTriggered;
|
|
13
|
+
exports.resolveBackend = resolveBackend;
|
|
14
|
+
exports.envWithTypes = envWithTypes;
|
|
15
|
+
exports.toBackend = toBackend;
|
|
16
|
+
exports.applyPrefix = applyPrefix;
|
|
4
17
|
const backend = require("./backend");
|
|
5
18
|
const proto = require("../../gcp/proto");
|
|
6
19
|
const api = require("../../api");
|
|
@@ -15,37 +28,32 @@ function empty() {
|
|
|
15
28
|
params: [],
|
|
16
29
|
};
|
|
17
30
|
}
|
|
18
|
-
exports.empty = empty;
|
|
19
31
|
function of(endpoints) {
|
|
20
32
|
const build = empty();
|
|
21
33
|
build.endpoints = endpoints;
|
|
22
34
|
return build;
|
|
23
35
|
}
|
|
24
|
-
exports.of = of;
|
|
25
36
|
function isHttpsTriggered(triggered) {
|
|
26
37
|
return {}.hasOwnProperty.call(triggered, "httpsTrigger");
|
|
27
38
|
}
|
|
28
|
-
|
|
39
|
+
function isDataConnectGraphqlTriggered(triggered) {
|
|
40
|
+
return {}.hasOwnProperty.call(triggered, "dataConnectGraphqlTrigger");
|
|
41
|
+
}
|
|
29
42
|
function isCallableTriggered(triggered) {
|
|
30
43
|
return {}.hasOwnProperty.call(triggered, "callableTrigger");
|
|
31
44
|
}
|
|
32
|
-
exports.isCallableTriggered = isCallableTriggered;
|
|
33
45
|
function isEventTriggered(triggered) {
|
|
34
46
|
return {}.hasOwnProperty.call(triggered, "eventTrigger");
|
|
35
47
|
}
|
|
36
|
-
exports.isEventTriggered = isEventTriggered;
|
|
37
48
|
function isScheduleTriggered(triggered) {
|
|
38
49
|
return {}.hasOwnProperty.call(triggered, "scheduleTrigger");
|
|
39
50
|
}
|
|
40
|
-
exports.isScheduleTriggered = isScheduleTriggered;
|
|
41
51
|
function isTaskQueueTriggered(triggered) {
|
|
42
52
|
return {}.hasOwnProperty.call(triggered, "taskQueueTrigger");
|
|
43
53
|
}
|
|
44
|
-
exports.isTaskQueueTriggered = isTaskQueueTriggered;
|
|
45
54
|
function isBlockingTriggered(triggered) {
|
|
46
55
|
return {}.hasOwnProperty.call(triggered, "blockingTrigger");
|
|
47
56
|
}
|
|
48
|
-
exports.isBlockingTriggered = isBlockingTriggered;
|
|
49
57
|
const allMemoryOptions = [128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768];
|
|
50
58
|
exports.AllFunctionsPlatforms = ["gcfv1", "gcfv2"];
|
|
51
59
|
exports.AllVpcEgressSettings = ["PRIVATE_RANGES_ONLY", "ALL_TRAFFIC"];
|
|
@@ -58,7 +66,6 @@ async function resolveBackend(opts) {
|
|
|
58
66
|
const paramValues = await params.resolveParams(opts.build.params, opts.firebaseConfig, envWithTypes(opts.build.params, opts.userEnvs), opts.nonInteractive, opts.isEmulator);
|
|
59
67
|
return { backend: toBackend(opts.build, paramValues), envs: paramValues };
|
|
60
68
|
}
|
|
61
|
-
exports.resolveBackend = resolveBackend;
|
|
62
69
|
function envWithTypes(definedParams, rawEnvs) {
|
|
63
70
|
const out = {};
|
|
64
71
|
for (const envName of Object.keys(rawEnvs)) {
|
|
@@ -117,7 +124,6 @@ function envWithTypes(definedParams, rawEnvs) {
|
|
|
117
124
|
}
|
|
118
125
|
return out;
|
|
119
126
|
}
|
|
120
|
-
exports.envWithTypes = envWithTypes;
|
|
121
127
|
class Resolver {
|
|
122
128
|
constructor(paramValues) {
|
|
123
129
|
this.paramValues = paramValues;
|
|
@@ -192,7 +198,15 @@ function toBackend(build, paramValues) {
|
|
|
192
198
|
if (typeof bdEndpoint.platform === "undefined") {
|
|
193
199
|
throw new error_1.FirebaseError("platform can't be undefined");
|
|
194
200
|
}
|
|
195
|
-
const bkEndpoint =
|
|
201
|
+
const bkEndpoint = {
|
|
202
|
+
id: endpointId,
|
|
203
|
+
project: bdEndpoint.project,
|
|
204
|
+
region: region,
|
|
205
|
+
entryPoint: bdEndpoint.entryPoint,
|
|
206
|
+
platform: bdEndpoint.platform,
|
|
207
|
+
runtime: bdEndpoint.runtime,
|
|
208
|
+
...trigger,
|
|
209
|
+
};
|
|
196
210
|
proto.copyIfPresent(bkEndpoint, bdEndpoint, "environmentVariables", "labels", "secretEnvironmentVariables");
|
|
197
211
|
r.resolveStrings(bkEndpoint, bdEndpoint, "serviceAccount");
|
|
198
212
|
proto.convertIfPresent(bkEndpoint, bdEndpoint, "ingressSettings", (from) => {
|
|
@@ -236,7 +250,6 @@ function toBackend(build, paramValues) {
|
|
|
236
250
|
bkend.requiredAPIs = build.requiredAPIs;
|
|
237
251
|
return bkend;
|
|
238
252
|
}
|
|
239
|
-
exports.toBackend = toBackend;
|
|
240
253
|
function discoverTrigger(endpoint, region, r) {
|
|
241
254
|
if (isHttpsTriggered(endpoint)) {
|
|
242
255
|
const httpsTrigger = {};
|
|
@@ -248,6 +261,17 @@ function discoverTrigger(endpoint, region, r) {
|
|
|
248
261
|
}
|
|
249
262
|
return { httpsTrigger };
|
|
250
263
|
}
|
|
264
|
+
else if (isDataConnectGraphqlTriggered(endpoint)) {
|
|
265
|
+
const dataConnectGraphqlTrigger = {};
|
|
266
|
+
if (endpoint.dataConnectGraphqlTrigger.invoker === null) {
|
|
267
|
+
dataConnectGraphqlTrigger.invoker = null;
|
|
268
|
+
}
|
|
269
|
+
else if (typeof endpoint.dataConnectGraphqlTrigger.invoker !== "undefined") {
|
|
270
|
+
dataConnectGraphqlTrigger.invoker = endpoint.dataConnectGraphqlTrigger.invoker.map(r.resolveString);
|
|
271
|
+
}
|
|
272
|
+
proto.copyIfPresent(dataConnectGraphqlTrigger, endpoint.dataConnectGraphqlTrigger, "schemaFilePath");
|
|
273
|
+
return { dataConnectGraphqlTrigger };
|
|
274
|
+
}
|
|
251
275
|
else if (isCallableTriggered(endpoint)) {
|
|
252
276
|
const trigger = { callableTrigger: {} };
|
|
253
277
|
proto.copyIfPresent(trigger.callableTrigger, endpoint.callableTrigger, "genkitAction");
|
|
@@ -329,9 +353,11 @@ function applyPrefix(build, prefix) {
|
|
|
329
353
|
}
|
|
330
354
|
newEndpoints[newId] = endpoint;
|
|
331
355
|
if (endpoint.secretEnvironmentVariables) {
|
|
332
|
-
endpoint.secretEnvironmentVariables = endpoint.secretEnvironmentVariables.map((secret) => (
|
|
356
|
+
endpoint.secretEnvironmentVariables = endpoint.secretEnvironmentVariables.map((secret) => ({
|
|
357
|
+
...secret,
|
|
358
|
+
secret: `${prefix}-${secret.secret}`,
|
|
359
|
+
}));
|
|
333
360
|
}
|
|
334
361
|
}
|
|
335
362
|
build.endpoints = newEndpoints;
|
|
336
363
|
}
|
|
337
|
-
exports.applyPrefix = applyPrefix;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyBackendHashToBackends =
|
|
3
|
+
exports.applyBackendHashToBackends = applyBackendHashToBackends;
|
|
4
4
|
const backend_1 = require("../backend");
|
|
5
5
|
const hash_1 = require("./hash");
|
|
6
6
|
function applyBackendHashToBackends(wantBackends, context) {
|
|
7
|
-
var _a;
|
|
8
7
|
for (const [codebase, wantBackend] of Object.entries(wantBackends)) {
|
|
9
|
-
const source =
|
|
8
|
+
const source = context?.sources?.[codebase];
|
|
10
9
|
const envHash = (0, hash_1.getEnvironmentVariablesHash)(wantBackend);
|
|
11
|
-
applyBackendHashToEndpoints(wantBackend, envHash, source
|
|
10
|
+
applyBackendHashToEndpoints(wantBackend, envHash, source?.functionsSourceV1Hash, source?.functionsSourceV2Hash);
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
|
-
exports.applyBackendHashToBackends = applyBackendHashToBackends;
|
|
15
13
|
function applyBackendHashToEndpoints(wantBackend, envHash, sourceV1Hash, sourceV2Hash) {
|
|
16
14
|
for (const endpoint of (0, backend_1.allEndpoints)(wantBackend)) {
|
|
17
15
|
const secretsHash = (0, hash_1.getSecretsHash)(endpoint);
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getEnvironmentVariablesHash = getEnvironmentVariablesHash;
|
|
4
|
+
exports.getSourceHash = getSourceHash;
|
|
5
|
+
exports.getSecretsHash = getSecretsHash;
|
|
6
|
+
exports.getEndpointHash = getEndpointHash;
|
|
4
7
|
const promises_1 = require("node:fs/promises");
|
|
5
8
|
const crypto = require("crypto");
|
|
6
9
|
const secrets_1 = require("../../../functions/secrets");
|
|
7
10
|
function getEnvironmentVariablesHash(backend) {
|
|
8
11
|
return createHash(JSON.stringify(backend.environmentVariables || {}));
|
|
9
12
|
}
|
|
10
|
-
exports.getEnvironmentVariablesHash = getEnvironmentVariablesHash;
|
|
11
13
|
async function getSourceHash(pathToFile) {
|
|
12
14
|
const data = await (0, promises_1.readFile)(pathToFile);
|
|
13
15
|
return createHash(data);
|
|
14
16
|
}
|
|
15
|
-
exports.getSourceHash = getSourceHash;
|
|
16
17
|
function getSecretsHash(endpoint) {
|
|
17
18
|
const secretVersions = (0, secrets_1.getSecretVersions)(endpoint);
|
|
18
19
|
return createHash(JSON.stringify(secretVersions || {}));
|
|
19
20
|
}
|
|
20
|
-
exports.getSecretsHash = getSecretsHash;
|
|
21
21
|
function getEndpointHash(sourceHash, envHash, secretsHash) {
|
|
22
22
|
const combined = [sourceHash, envHash, secretsHash].filter((hash) => !!hash).join("");
|
|
23
23
|
return createHash(combined);
|
|
24
24
|
}
|
|
25
|
-
exports.getEndpointHash = getEndpointHash;
|
|
26
25
|
function createHash(data, algorithm = "sha1") {
|
|
27
26
|
const hash = crypto.createHash(algorithm);
|
|
28
27
|
hash.update(data);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ExprParseError = void 0;
|
|
4
|
+
exports.isCelExpression = isCelExpression;
|
|
5
|
+
exports.resolveExpression = resolveExpression;
|
|
4
6
|
const error_1 = require("../../error");
|
|
5
7
|
const functional_1 = require("../../functional");
|
|
6
8
|
const paramRegexp = /params\.(\S+)/;
|
|
@@ -17,7 +19,6 @@ function listEquals(a, b) {
|
|
|
17
19
|
function isCelExpression(value) {
|
|
18
20
|
return typeof value === "string" && value.includes("{{") && value.includes("}}");
|
|
19
21
|
}
|
|
20
|
-
exports.isCelExpression = isCelExpression;
|
|
21
22
|
function isIdentityExpression(value) {
|
|
22
23
|
return identityRegexp.test(value);
|
|
23
24
|
}
|
|
@@ -63,7 +64,6 @@ function resolveExpression(wantType, expr, params) {
|
|
|
63
64
|
throw new ExprParseError("CEL expression '" + expr + "' is of an unsupported form");
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
exports.resolveExpression = resolveExpression;
|
|
67
67
|
function preprocessLists(wantType, expr, params) {
|
|
68
68
|
let rv = expr;
|
|
69
69
|
const listMatcher = /\[[^\[\]]*\]/g;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.GENKIT_MONITORING_ROLES = exports.EVENTARC_EVENT_RECEIVER_ROLE = exports.RUN_INVOKER_ROLE = exports.SERVICE_ACCOUNT_TOKEN_CREATOR_ROLE = void 0;
|
|
4
|
+
exports.checkServiceAccountIam = checkServiceAccountIam;
|
|
5
|
+
exports.checkHttpIam = checkHttpIam;
|
|
6
|
+
exports.obtainPubSubServiceAgentBindings = obtainPubSubServiceAgentBindings;
|
|
7
|
+
exports.obtainDefaultComputeServiceAgentBindings = obtainDefaultComputeServiceAgentBindings;
|
|
8
|
+
exports.ensureGenkitMonitoringRoles = ensureGenkitMonitoringRoles;
|
|
9
|
+
exports.ensureServiceAgentRoles = ensureServiceAgentRoles;
|
|
4
10
|
const colorette_1 = require("colorette");
|
|
5
11
|
const logger_1 = require("../../logger");
|
|
6
12
|
const functionsDeployHelper_1 = require("./functionsDeployHelper");
|
|
@@ -39,7 +45,6 @@ async function checkServiceAccountIam(projectId) {
|
|
|
39
45
|
`https://console.cloud.google.com/iam-admin/iam?project=${projectId}`);
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
|
-
exports.checkServiceAccountIam = checkServiceAccountIam;
|
|
43
48
|
async function checkHttpIam(context, options, payload) {
|
|
44
49
|
if (!payload.functions) {
|
|
45
50
|
return;
|
|
@@ -47,7 +52,7 @@ async function checkHttpIam(context, options, payload) {
|
|
|
47
52
|
const filters = context.filters || (0, functionsDeployHelper_1.getEndpointFilters)(options, context.config);
|
|
48
53
|
const wantBackends = Object.values(payload.functions).map(({ wantBackend }) => wantBackend);
|
|
49
54
|
const httpEndpoints = [...(0, functional_1.flattenArray)(wantBackends.map((b) => backend.allEndpoints(b)))]
|
|
50
|
-
.filter(backend.isHttpsTriggered)
|
|
55
|
+
.filter(backend.isHttpsTriggered || backend.isDataConnectGraphqlTriggered)
|
|
51
56
|
.filter((f) => (0, functionsDeployHelper_1.endpointMatchesAnyFilter)(f, filters));
|
|
52
57
|
const existing = await backend.existingBackend(context);
|
|
53
58
|
const newHttpsEndpoints = httpEndpoints.filter(backend.missingEndpoint(existing));
|
|
@@ -75,7 +80,6 @@ async function checkHttpIam(context, options, payload) {
|
|
|
75
80
|
}
|
|
76
81
|
logger_1.logger.debug("[functions] found setIamPolicy permission, proceeding with deploy");
|
|
77
82
|
}
|
|
78
|
-
exports.checkHttpIam = checkHttpIam;
|
|
79
83
|
function getPubsubServiceAgent(projectNumber) {
|
|
80
84
|
return `service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com`;
|
|
81
85
|
}
|
|
@@ -96,7 +100,6 @@ function obtainPubSubServiceAgentBindings(projectNumber) {
|
|
|
96
100
|
};
|
|
97
101
|
return [serviceAccountTokenCreatorBinding];
|
|
98
102
|
}
|
|
99
|
-
exports.obtainPubSubServiceAgentBindings = obtainPubSubServiceAgentBindings;
|
|
100
103
|
async function obtainDefaultComputeServiceAgentBindings(projectNumber) {
|
|
101
104
|
const defaultComputeServiceAgent = `serviceAccount:${await gce.getDefaultServiceAccount(projectNumber)}`;
|
|
102
105
|
const runInvokerBinding = {
|
|
@@ -109,7 +112,6 @@ async function obtainDefaultComputeServiceAgentBindings(projectNumber) {
|
|
|
109
112
|
};
|
|
110
113
|
return [runInvokerBinding, eventarcEventReceiverBinding];
|
|
111
114
|
}
|
|
112
|
-
exports.obtainDefaultComputeServiceAgentBindings = obtainDefaultComputeServiceAgentBindings;
|
|
113
115
|
async function ensureGenkitMonitoringRoles(projectId, projectNumber, want, have, dryRun) {
|
|
114
116
|
const wantEndpoints = backend.allEndpoints(want).filter(isGenkitEndpoint);
|
|
115
117
|
const newEndpoints = wantEndpoints.filter(backend.missingEndpoint(have));
|
|
@@ -133,7 +135,6 @@ async function ensureGenkitMonitoringRoles(projectId, projectNumber, want, have,
|
|
|
133
135
|
}
|
|
134
136
|
await ensureBindings(projectId, projectNumber, requiredBindings, newEndpoints.map((endpoint) => endpoint.id), dryRun);
|
|
135
137
|
}
|
|
136
|
-
exports.ensureGenkitMonitoringRoles = ensureGenkitMonitoringRoles;
|
|
137
138
|
async function ensureServiceAgentRoles(projectId, projectNumber, want, have, dryRun) {
|
|
138
139
|
const wantServices = backend.allEndpoints(want).reduce(reduceEventsToServices, []);
|
|
139
140
|
const haveServices = backend.allEndpoints(have).reduce(reduceEventsToServices, []);
|
|
@@ -156,7 +157,6 @@ async function ensureServiceAgentRoles(projectId, projectNumber, want, have, dry
|
|
|
156
157
|
}
|
|
157
158
|
await ensureBindings(projectId, projectNumber, requiredBindings, newServices.map((service) => service.api), dryRun);
|
|
158
159
|
}
|
|
159
|
-
exports.ensureServiceAgentRoles = ensureServiceAgentRoles;
|
|
160
160
|
async function ensureBindings(projectId, projectNumber, requiredBindings, newServicesOrEndpoints, dryRun) {
|
|
161
161
|
let policy;
|
|
162
162
|
try {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DockerHelper = exports.
|
|
3
|
+
exports.DockerHelper = exports.ContainerRegistryCleaner = exports.NoopArtifactRegistryCleaner = exports.ArtifactRegistryCleaner = void 0;
|
|
4
|
+
exports.cleanupBuildImages = cleanupBuildImages;
|
|
5
|
+
exports.listGcfPaths = listGcfPaths;
|
|
6
|
+
exports.deleteGcfArtifacts = deleteGcfArtifacts;
|
|
4
7
|
const clc = require("colorette");
|
|
5
8
|
const error_1 = require("../../error");
|
|
6
9
|
const api_1 = require("../../api");
|
|
@@ -80,7 +83,6 @@ async function cleanupBuildImages(haveFunctions, deletedFunctions, cleaners = {}
|
|
|
80
83
|
utils.logLabeledWarning("functions", message);
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
|
-
exports.cleanupBuildImages = cleanupBuildImages;
|
|
84
86
|
class ArtifactRegistryCleaner {
|
|
85
87
|
static packagePath(func) {
|
|
86
88
|
const encodedId = func.platform === "gcfv2"
|
|
@@ -119,7 +121,11 @@ class ArtifactRegistryCleaner {
|
|
|
119
121
|
if (op.done) {
|
|
120
122
|
return;
|
|
121
123
|
}
|
|
122
|
-
await poller.pollOperation(
|
|
124
|
+
await poller.pollOperation({
|
|
125
|
+
...ArtifactRegistryCleaner.POLLER_OPTIONS,
|
|
126
|
+
pollerName: `cleanup-${func.region}-${func.id}`,
|
|
127
|
+
operationResourceName: op.name,
|
|
128
|
+
});
|
|
123
129
|
}
|
|
124
130
|
}
|
|
125
131
|
exports.ArtifactRegistryCleaner = ArtifactRegistryCleaner;
|
|
@@ -161,7 +167,7 @@ class ContainerRegistryCleaner {
|
|
|
161
167
|
await Promise.all(loadUuidTags);
|
|
162
168
|
const extractFunction = /^(.*)_version-\d+$/;
|
|
163
169
|
const entry = Object.entries(uuidTags).find(([, tags]) => {
|
|
164
|
-
return tags.find((tag) =>
|
|
170
|
+
return tags.find((tag) => extractFunction.exec(tag)?.[1] === func.id);
|
|
165
171
|
});
|
|
166
172
|
if (!entry) {
|
|
167
173
|
logger_1.logger.debug("Could not find image for function", backend.functionName(func));
|
|
@@ -220,7 +226,6 @@ async function listGcfPaths(projectId, locations, dockerHelpers = {}) {
|
|
|
220
226
|
return `${docker.GCR_SUBDOMAIN_MAPPING[loc]}.${(0, api_1.containerRegistryDomain)()}/${projectId}/gcf/${loc}`;
|
|
221
227
|
});
|
|
222
228
|
}
|
|
223
|
-
exports.listGcfPaths = listGcfPaths;
|
|
224
229
|
async function deleteGcfArtifacts(projectId, locations, dockerHelpers = {}) {
|
|
225
230
|
if (!locations) {
|
|
226
231
|
locations = Object.keys(docker.GCR_SUBDOMAIN_MAPPING);
|
|
@@ -249,7 +254,6 @@ async function deleteGcfArtifacts(projectId, locations, dockerHelpers = {}) {
|
|
|
249
254
|
throw new error_1.FirebaseError(`Failed to search the following subdomains: ${failedSubdomains.join(",")}`);
|
|
250
255
|
}
|
|
251
256
|
}
|
|
252
|
-
exports.deleteGcfArtifacts = deleteGcfArtifacts;
|
|
253
257
|
class DockerHelper {
|
|
254
258
|
constructor(origin) {
|
|
255
259
|
this.cache = {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createReadStream = createReadStream;
|
|
4
|
+
exports.uploadSourceV2 = uploadSourceV2;
|
|
5
|
+
exports.deploy = deploy;
|
|
6
|
+
exports.shouldUploadBeSkipped = shouldUploadBeSkipped;
|
|
4
7
|
const tmp_1 = require("tmp");
|
|
5
8
|
const clc = require("colorette");
|
|
6
9
|
const fs = require("fs");
|
|
@@ -38,7 +41,6 @@ async function uploadSourceV1(projectId, source, wantBackend) {
|
|
|
38
41
|
function createReadStream(filePath) {
|
|
39
42
|
return fs.createReadStream(filePath);
|
|
40
43
|
}
|
|
41
|
-
exports.createReadStream = createReadStream;
|
|
42
44
|
async function uploadSourceV2(projectId, projectNumber, source, wantBackend) {
|
|
43
45
|
const v2Endpoints = backend
|
|
44
46
|
.allEndpoints(wantBackend)
|
|
@@ -85,10 +87,8 @@ async function uploadSourceV2(projectId, projectNumber, source, wantBackend) {
|
|
|
85
87
|
object: objectPath,
|
|
86
88
|
};
|
|
87
89
|
}
|
|
88
|
-
exports.uploadSourceV2 = uploadSourceV2;
|
|
89
90
|
async function uploadCodebase(context, projectNumber, codebase, wantBackend) {
|
|
90
|
-
|
|
91
|
-
const source = (_a = context.sources) === null || _a === void 0 ? void 0 : _a[codebase];
|
|
91
|
+
const source = context.sources?.[codebase];
|
|
92
92
|
if (!source || (!source.functionsSourceV1 && !source.functionsSourceV2)) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
@@ -104,7 +104,7 @@ async function uploadCodebase(context, projectNumber, codebase, wantBackend) {
|
|
|
104
104
|
source.storage = storage;
|
|
105
105
|
}
|
|
106
106
|
const cfg = (0, projectConfig_1.configForCodebase)(context.config, codebase);
|
|
107
|
-
const label =
|
|
107
|
+
const label = cfg.source ?? cfg.remoteSource?.dir ?? "remote";
|
|
108
108
|
if (uploads.length) {
|
|
109
109
|
(0, utils_1.logLabeledSuccess)("functions", `${clc.bold(label)} source uploaded successfully`);
|
|
110
110
|
}
|
|
@@ -131,7 +131,6 @@ async function deploy(context, options, payload) {
|
|
|
131
131
|
await Promise.all(uploads);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
exports.deploy = deploy;
|
|
135
134
|
function shouldUploadBeSkipped(context, wantBackend, haveBackend) {
|
|
136
135
|
if (context.filters && context.filters.length > 0) {
|
|
137
136
|
return false;
|
|
@@ -152,4 +151,3 @@ function shouldUploadBeSkipped(context, wantBackend, haveBackend) {
|
|
|
152
151
|
haveEndpoint.state === "ACTIVE");
|
|
153
152
|
});
|
|
154
153
|
}
|
|
155
|
-
exports.shouldUploadBeSkipped = shouldUploadBeSkipped;
|