firebase-tools-with-isolate 14.16.0 → 15.3.1-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 +2 -3
- package/lib/accountImporter.js +4 -5
- package/lib/api.js +5 -3
- package/lib/apiv2.js +16 -6
- package/lib/appUtils.js +251 -0
- package/lib/appdistribution/client.js +63 -17
- package/lib/appdistribution/distribution.js +85 -2
- package/lib/appdistribution/options-parser-util.js +13 -11
- package/lib/appdistribution/types.js +3 -14
- package/lib/appdistribution/yaml_helper.js +85 -0
- package/lib/apphosting/backend.js +15 -16
- package/lib/apphosting/config.js +11 -11
- package/lib/apphosting/githubConnections.js +20 -20
- package/lib/apphosting/localbuilds.js +21 -0
- package/lib/apphosting/repo.js +9 -10
- package/lib/apphosting/rollout.js +2 -3
- package/lib/apphosting/secrets/dialogs.js +7 -7
- package/lib/apphosting/secrets/index.js +7 -8
- package/lib/apphosting/utils.js +2 -3
- package/lib/apphosting/yaml.js +3 -3
- package/lib/apptesting/ensureProjectConfigured.js +1 -2
- package/lib/apptesting/invokeTests.js +2 -3
- package/lib/apptesting/parseTestFiles.js +1 -2
- package/lib/apptesting/types.js +2 -2
- package/lib/archiveDirectory.js +8 -47
- package/lib/auth.js +22 -23
- package/lib/bin/cli.js +37 -11
- package/lib/bin/firebase.js +1 -2
- package/lib/bin/mcp.js +60 -8
- package/lib/checkMinRequiredVersion.js +1 -2
- package/lib/checkValidTargetFilters.js +1 -2
- package/lib/command.js +11 -10
- package/lib/commands/appdistribution-distribute.js +12 -85
- package/lib/commands/appdistribution-groups-list.js +3 -4
- package/lib/commands/appdistribution-testcases-export.js +32 -0
- package/lib/commands/appdistribution-testcases-import.js +34 -0
- package/lib/commands/appdistribution-testers-list.js +3 -4
- package/lib/commands/apphosting-backends-list.js +2 -2
- package/lib/commands/apps-init.js +7 -7
- package/lib/commands/{apptesting-execute.js → apptesting-wata.js} +14 -9
- package/lib/commands/database-instances-create.js +1 -1
- package/lib/commands/dataconnect-execute.js +229 -0
- package/lib/commands/dataconnect-sdk-generate.js +71 -13
- package/lib/commands/dataconnect-sql-diff.js +9 -6
- package/lib/commands/dataconnect-sql-grant.js +14 -13
- package/lib/commands/dataconnect-sql-migrate.js +12 -7
- package/lib/commands/dataconnect-sql-setup.js +10 -6
- package/lib/commands/dataconnect-sql-shell.js +8 -5
- package/lib/commands/deploy.js +6 -4
- package/lib/commands/ext-dev-upload.js +2 -2
- package/lib/commands/firestore-backups-delete.js +1 -6
- package/lib/commands/firestore-backups-get.js +2 -8
- package/lib/commands/firestore-backups-list.js +5 -11
- package/lib/commands/firestore-backups-schedules-create.js +1 -6
- package/lib/commands/firestore-backups-schedules-delete.js +1 -6
- package/lib/commands/firestore-backups-schedules-list.js +1 -7
- package/lib/commands/firestore-backups-schedules-update.js +1 -6
- package/lib/commands/firestore-bulkdelete.js +7 -13
- package/lib/commands/firestore-databases-clone.js +99 -0
- package/lib/commands/firestore-databases-create.js +5 -10
- package/lib/commands/firestore-databases-delete.js +1 -6
- package/lib/commands/firestore-databases-get.js +1 -7
- package/lib/commands/firestore-databases-list.js +1 -7
- package/lib/commands/firestore-databases-restore.js +5 -10
- package/lib/commands/firestore-databases-update.js +1 -6
- package/lib/commands/firestore-locations.js +1 -7
- package/lib/commands/firestore-operations-cancel.js +3 -9
- package/lib/commands/firestore-operations-describe.js +2 -8
- package/lib/commands/firestore-operations-list.js +2 -8
- package/lib/commands/firestore-utils.js +1 -2
- package/lib/commands/functions-config-clone.js +2 -2
- package/lib/commands/functions-config-export.js +136 -92
- package/lib/commands/functions-config-get.js +1 -2
- package/lib/commands/functions-config-set.js +2 -2
- package/lib/commands/functions-config-unset.js +2 -2
- package/lib/commands/functions-list.js +16 -6
- package/lib/commands/functions-log.js +1 -1
- package/lib/commands/functions-secrets-set.js +19 -1
- package/lib/commands/help.js +1 -1
- package/lib/commands/hosting-channel-deploy.js +2 -2
- package/lib/commands/hosting-sites-create.js +4 -3
- package/lib/commands/index.js +35 -18
- package/lib/commands/init.js +27 -12
- package/lib/commands/internaltesting-functions-discover.js +1 -3
- package/lib/commands/logout.js +2 -2
- package/lib/commands/mcp.js +3 -2
- package/lib/commands/remoteconfig-experiments-delete.js +32 -0
- package/lib/commands/remoteconfig-experiments-get.js +20 -0
- package/lib/commands/remoteconfig-experiments-list.js +37 -0
- package/lib/commands/remoteconfig-rollouts-delete.js +32 -0
- package/lib/commands/remoteconfig-rollouts-get.js +20 -0
- package/lib/commands/remoteconfig-rollouts-list.js +37 -0
- package/lib/commands/remoteconfig-versions-list.js +8 -4
- package/lib/commands/use.js +2 -2
- package/lib/config.js +5 -7
- package/lib/crashlytics/buildToolsJarHelper.js +2 -3
- package/lib/crashlytics/events.js +48 -0
- package/lib/crashlytics/filters.js +113 -0
- package/lib/crashlytics/issues.js +34 -0
- package/lib/crashlytics/notes.js +55 -0
- package/lib/crashlytics/reports.js +67 -0
- package/lib/crashlytics/types.js +60 -0
- package/lib/crashlytics/utils.js +4 -4
- package/lib/database/api.js +2 -3
- package/lib/database/metadata.js +5 -6
- package/lib/database/rulesConfig.js +2 -3
- package/lib/dataconnect/build.js +17 -5
- package/lib/dataconnect/checkIam.js +1 -2
- package/lib/dataconnect/client.js +17 -18
- package/lib/dataconnect/dataplaneClient.js +6 -6
- package/lib/dataconnect/ensureApis.js +13 -5
- package/lib/dataconnect/errors.js +3 -4
- package/lib/dataconnect/filters.js +2 -3
- package/lib/dataconnect/freeTrial.js +5 -13
- package/lib/dataconnect/graphqlError.js +2 -3
- package/lib/dataconnect/load.js +62 -37
- package/lib/dataconnect/names.js +8 -4
- package/lib/dataconnect/prompts.js +1 -2
- package/lib/dataconnect/provisionCloudSql.js +62 -27
- package/lib/dataconnect/schemaMigration.js +58 -12
- package/lib/dataconnect/types.js +35 -13
- package/lib/dataconnect/webhook.js +3 -3
- package/lib/defaultCredentials.js +3 -4
- package/lib/deploy/apphosting/deploy.js +48 -48
- package/lib/deploy/apphosting/prepare.js +32 -11
- package/lib/deploy/apphosting/release.js +25 -26
- package/lib/deploy/apphosting/util.js +7 -10
- package/lib/deploy/database/deploy.js +1 -2
- package/lib/deploy/database/prepare.js +2 -5
- package/lib/deploy/database/release.js +1 -2
- package/lib/deploy/dataconnect/context.js +37 -0
- package/lib/deploy/dataconnect/deploy.js +15 -6
- package/lib/deploy/dataconnect/prepare.js +15 -14
- package/lib/deploy/dataconnect/release.js +30 -7
- package/lib/deploy/extensions/deploy.js +1 -2
- package/lib/deploy/extensions/deploymentSummary.js +5 -5
- package/lib/deploy/extensions/planner.js +8 -9
- package/lib/deploy/extensions/prepare.js +5 -4
- package/lib/deploy/extensions/release.js +1 -2
- package/lib/deploy/extensions/secrets.js +2 -3
- package/lib/deploy/extensions/tasks.js +5 -6
- package/lib/deploy/extensions/v2FunctionHelper.js +2 -3
- package/lib/deploy/extensions/validate.js +1 -2
- package/lib/deploy/firestore/deploy.js +1 -47
- package/lib/deploy/firestore/prepare.js +52 -1
- package/lib/deploy/firestore/release.js +1 -1
- package/lib/deploy/functions/backend.js +71 -55
- package/lib/deploy/functions/build.js +28 -13
- package/lib/deploy/functions/cache/applyHash.js +1 -2
- package/lib/deploy/functions/cache/hash.js +4 -5
- package/lib/deploy/functions/cel.js +3 -3
- package/lib/deploy/functions/checkIam.js +9 -9
- package/lib/deploy/functions/containerCleaner.js +4 -4
- package/lib/deploy/functions/deploy.js +54 -15
- package/lib/deploy/functions/ensure.js +3 -4
- package/lib/deploy/functions/functionsDeployHelper.js +18 -18
- package/lib/deploy/functions/params.js +27 -17
- package/lib/deploy/functions/prepare.js +28 -20
- package/lib/deploy/functions/prepareFunctionsUpload.js +27 -9
- package/lib/deploy/functions/pricing.js +19 -4
- package/lib/deploy/functions/prompts.js +5 -6
- package/lib/deploy/functions/release/fabricator.js +20 -1
- package/lib/deploy/functions/release/index.js +13 -7
- package/lib/deploy/functions/release/planner.js +13 -11
- package/lib/deploy/functions/release/reporter.js +8 -5
- package/lib/deploy/functions/remoteSource.js +83 -0
- package/lib/deploy/functions/runtimes/discovery/index.js +5 -6
- package/lib/deploy/functions/runtimes/discovery/parsing.js +2 -3
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +16 -2
- package/lib/deploy/functions/runtimes/index.js +1 -2
- package/lib/deploy/functions/runtimes/node/index.js +13 -14
- 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 +7 -7
- package/lib/deploy/functions/runtimes/python/index.js +3 -3
- package/lib/deploy/functions/runtimes/supported/index.js +5 -6
- package/lib/deploy/functions/runtimes/supported/types.js +6 -0
- package/lib/deploy/functions/services/database.js +1 -2
- package/lib/deploy/functions/services/dataconnect.js +28 -0
- package/lib/deploy/functions/services/firebaseAlerts.js +1 -2
- package/lib/deploy/functions/services/firestore.js +2 -3
- package/lib/deploy/functions/services/index.js +13 -2
- package/lib/deploy/functions/services/remoteConfig.js +1 -2
- package/lib/deploy/functions/services/storage.js +2 -3
- package/lib/deploy/functions/services/testLab.js +1 -2
- package/lib/deploy/functions/triggerRegionHelper.js +1 -2
- package/lib/deploy/functions/validate.js +70 -8
- package/lib/deploy/hosting/convertConfig.js +2 -3
- package/lib/deploy/hosting/deploy.js +1 -2
- package/lib/deploy/hosting/hashcache.js +2 -3
- package/lib/deploy/hosting/prepare.js +4 -5
- package/lib/deploy/hosting/release.js +1 -2
- package/lib/deploy/hosting/uploader.js +1 -1
- package/lib/deploy/index.js +37 -18
- package/lib/deploy/lifecycleHooks.js +1 -2
- package/lib/deploy/remoteconfig/deploy.js +1 -1
- package/lib/deploy/remoteconfig/functions.js +4 -5
- package/lib/deploy/remoteconfig/prepare.js +1 -1
- package/lib/deploy/remoteconfig/release.js +1 -1
- 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 +4 -4
- package/lib/detectProjectRoot.js +2 -3
- 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 +4 -4
- package/lib/emulator/apphosting/serve.js +30 -31
- package/lib/emulator/auth/errors.js +2 -2
- package/lib/emulator/auth/handlers.js +1 -2
- package/lib/emulator/auth/index.js +1 -1
- package/lib/emulator/auth/operations.js +11 -5
- package/lib/emulator/auth/server.js +1 -2
- package/lib/emulator/auth/state.js +5 -5
- package/lib/emulator/auth/utils.js +11 -12
- package/lib/emulator/commandUtils.js +14 -14
- package/lib/emulator/controller.js +10 -11
- package/lib/emulator/databaseEmulator.js +1 -5
- package/lib/emulator/dataconnect/pgliteServer.js +2 -2
- package/lib/emulator/dataconnectEmulator.js +1 -1
- package/lib/emulator/download.js +2 -3
- package/lib/emulator/downloadableEmulatorInfo.json +39 -31
- package/lib/emulator/downloadableEmulators.js +97 -86
- package/lib/emulator/emulatorLogger.js +1 -1
- package/lib/emulator/env.js +3 -4
- package/lib/emulator/eventarcEmulatorUtils.js +1 -2
- package/lib/emulator/extensions/postinstall.js +1 -2
- package/lib/emulator/extensions/validation.js +2 -3
- package/lib/emulator/functionsEmulator.js +0 -40
- package/lib/emulator/functionsEmulatorRuntime.js +5 -114
- package/lib/emulator/functionsEmulatorShared.js +18 -20
- package/lib/emulator/functionsEmulatorUtils.js +8 -9
- package/lib/emulator/functionsRuntimeWorker.js +1 -1
- package/lib/emulator/hub.js +33 -33
- package/lib/emulator/hubExport.js +5 -0
- package/lib/emulator/initEmulators.js +1 -1
- package/lib/emulator/portUtils.js +4 -5
- package/lib/emulator/shared/request.js +1 -2
- package/lib/emulator/storage/apis/firebase.js +1 -2
- package/lib/emulator/storage/apis/gcloud.js +1 -2
- package/lib/emulator/storage/apis/shared.js +1 -2
- package/lib/emulator/storage/crc.js +2 -3
- package/lib/emulator/storage/metadata.js +2 -2
- 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 +1 -2
- package/lib/emulator/storage/rules/types.js +2 -2
- package/lib/emulator/storage/rules/utils.js +4 -5
- package/lib/emulator/storage/server.js +1 -2
- package/lib/emulator/storage/upload.js +2 -2
- package/lib/emulator/taskQueue.js +6 -1
- package/lib/emulator/types.js +6 -6
- package/lib/ensureApiEnabled.js +5 -5
- package/lib/env.js +2 -3
- package/lib/error.js +7 -7
- package/lib/errorOut.js +1 -2
- package/lib/experiments.js +31 -18
- package/lib/extensions/askUserForEventsConfig.js +7 -7
- package/lib/extensions/askUserForParam.js +7 -7
- 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 +5 -6
- package/lib/extensions/emulator/optionsHelper.js +4 -5
- package/lib/extensions/emulator/specHelper.js +6 -6
- package/lib/extensions/emulator/triggerHelper.js +1 -2
- package/lib/extensions/etags.js +2 -3
- package/lib/extensions/export.js +3 -4
- package/lib/extensions/extensionsApi.js +15 -16
- package/lib/extensions/extensionsHelper.js +31 -32
- package/lib/extensions/listExtensions.js +1 -2
- package/lib/extensions/localHelper.js +5 -5
- package/lib/extensions/manifest.js +11 -11
- package/lib/extensions/metricsUtils.js +3 -4
- package/lib/extensions/paramHelper.js +9 -10
- package/lib/extensions/provisioningHelper.js +5 -5
- package/lib/extensions/publishHelpers.js +1 -2
- package/lib/extensions/publisherApi.js +10 -11
- package/lib/extensions/refs.js +6 -7
- package/lib/extensions/runtimes/common.js +15 -16
- package/lib/extensions/runtimes/node.js +2 -2
- 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 +4 -5
- package/lib/extensions/versionHelper.js +1 -2
- package/lib/extensions/warnings.js +2 -3
- 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 +58 -14
- package/lib/firestore/backupUtils.js +3 -3
- package/lib/firestore/checkDatabaseType.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 +24 -4
- package/lib/firestore/validator.js +4 -5
- package/lib/frameworks/angular/index.js +10 -10
- package/lib/frameworks/angular/utils.js +10 -10
- package/lib/frameworks/astro/index.js +6 -6
- package/lib/frameworks/astro/utils.js +3 -4
- package/lib/frameworks/compose/discover/filesystem.js +2 -2
- package/lib/frameworks/compose/discover/frameworkMatcher.js +4 -5
- package/lib/frameworks/compose/discover/index.js +1 -2
- package/lib/frameworks/compose/driver/hooks.js +2 -2
- package/lib/frameworks/compose/driver/index.js +2 -2
- package/lib/frameworks/compose/index.js +1 -2
- package/lib/frameworks/constants.js +4 -4
- package/lib/frameworks/express/index.js +5 -5
- package/lib/frameworks/flutter/index.js +6 -6
- package/lib/frameworks/flutter/utils.js +3 -4
- package/lib/frameworks/index.js +4 -4
- package/lib/frameworks/next/index.js +33 -10
- package/lib/frameworks/next/utils.js +69 -29
- package/lib/frameworks/nuxt/index.js +9 -9
- package/lib/frameworks/nuxt/utils.js +2 -3
- package/lib/frameworks/nuxt2/index.js +6 -6
- package/lib/frameworks/sveltekit/index.js +4 -4
- package/lib/frameworks/utils.js +13 -14
- package/lib/frameworks/vite/index.js +11 -8
- package/lib/fsAsync.js +16 -5
- package/lib/fsutils.js +5 -6
- package/lib/functional.js +11 -11
- package/lib/functions/artifacts.js +14 -14
- package/lib/functions/ensureTargeted.js +1 -2
- package/lib/functions/env.js +10 -10
- package/lib/functions/events/v2.js +2 -1
- package/lib/functions/functionslog.js +2 -3
- package/lib/functions/projectConfig.js +16 -12
- package/lib/functions/python.js +3 -3
- package/lib/functions/secrets.js +23 -11
- package/lib/functionsConfig.js +49 -11
- package/lib/functionsConfigClone.js +1 -2
- package/lib/gcp/apphosting.js +18 -18
- package/lib/gcp/apptesting.js +18 -0
- package/lib/gcp/artifactregistry.js +5 -5
- package/lib/gcp/auth.js +9 -10
- package/lib/gcp/cloudbilling.js +4 -5
- package/lib/gcp/cloudbuild.js +10 -11
- package/lib/gcp/cloudfunctions.js +14 -14
- package/lib/gcp/cloudfunctionsv2.js +24 -16
- package/lib/gcp/cloudlogging.js +16 -10
- package/lib/gcp/cloudmonitoring.js +7 -7
- package/lib/gcp/cloudscheduler.js +20 -8
- package/lib/gcp/cloudsql/cloudsqladmin.js +21 -19
- package/lib/gcp/cloudsql/connect.js +24 -39
- 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 +13 -13
- package/lib/gcp/computeEngine.js +1 -2
- package/lib/gcp/devConnect.js +17 -17
- 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 +13 -13
- package/lib/gcp/runv2.js +43 -9
- package/lib/gcp/secretManager.js +24 -24
- package/lib/gcp/serviceusage.js +3 -3
- package/lib/gcp/storage.js +122 -25
- package/lib/gemini/fdcExperience.js +5 -5
- package/lib/getDefaultDatabaseInstance.js +3 -4
- package/lib/getDefaultHostingSite.js +2 -2
- package/lib/getProjectNumber.js +1 -2
- package/lib/hosting/api.js +26 -26
- package/lib/hosting/cloudRunProxy.js +1 -1
- package/lib/hosting/config.js +7 -8
- 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 +13 -19
- package/lib/hosting/proxy.js +2 -3
- package/lib/hosting/runTags.js +5 -5
- package/lib/index.js +44 -1
- package/lib/init/features/account.js +1 -2
- package/lib/init/features/ailogic/index.js +102 -0
- package/lib/init/features/ailogic/utils.js +73 -0
- package/lib/init/features/aitools/claude.js +1 -1
- package/lib/init/features/aitools/cursor.js +1 -1
- package/lib/init/features/aitools/promptUpdater.js +5 -6
- package/lib/init/features/aitools.js +1 -2
- package/lib/init/features/apphosting.js +2 -3
- package/lib/init/features/apptesting/index.js +2 -3
- package/lib/init/features/database.js +4 -4
- package/lib/init/features/dataconnect/create_app.js +4 -5
- package/lib/init/features/dataconnect/index.js +187 -63
- package/lib/init/features/dataconnect/resolver.js +107 -0
- package/lib/init/features/dataconnect/sdk.js +125 -53
- package/lib/init/features/emulators.js +1 -2
- package/lib/init/features/extensions/index.js +1 -2
- package/lib/init/features/firestore/index.js +2 -3
- 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 +2 -2
- 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 +107 -49
- package/lib/init/features/hosting/github.js +3 -8
- package/lib/init/features/hosting/index.js +86 -85
- package/lib/init/features/index.js +9 -2
- package/lib/init/features/project.js +66 -76
- package/lib/init/features/remoteconfig.js +1 -2
- package/lib/init/features/storage.js +2 -3
- package/lib/init/index.js +19 -6
- package/lib/init/spawn.js +3 -4
- package/lib/listFiles.js +1 -2
- package/lib/loadCJSON.js +1 -2
- package/lib/logError.js +1 -2
- package/lib/logger.js +5 -5
- package/lib/management/apps.js +47 -46
- package/lib/management/database.js +10 -10
- package/lib/management/projects.js +31 -19
- package/lib/management/provisioning/errorHandler.js +52 -0
- package/lib/management/provisioning/provision.js +113 -0
- package/lib/management/provisioning/types.js +2 -0
- package/lib/management/studio.js +2 -3
- package/lib/mcp/errors.js +7 -8
- package/lib/mcp/index.js +164 -96
- package/lib/mcp/prompt.js +7 -3
- package/lib/mcp/prompts/apptesting/index.js +9 -0
- package/lib/mcp/prompts/apptesting/run_test.js +127 -0
- package/lib/mcp/prompts/core/deploy.js +10 -11
- package/lib/mcp/prompts/core/index.js +3 -1
- package/lib/mcp/prompts/core/init.js +93 -0
- package/lib/mcp/prompts/crashlytics/connect.js +17 -90
- package/lib/mcp/prompts/dataconnect/schema.js +5 -2
- package/lib/mcp/prompts/firestore/generate_security_rules.js +384 -0
- package/lib/mcp/prompts/firestore/index.js +6 -0
- package/lib/mcp/prompts/index.js +52 -15
- package/lib/mcp/prompts/storage/generate_security_rules.js +272 -0
- package/lib/mcp/prompts/storage/index.js +6 -0
- package/lib/mcp/resource.js +27 -0
- package/lib/mcp/resources/docs.js +44 -0
- 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/guides/init_ai.js +158 -0
- package/lib/mcp/resources/guides/init_auth.js +38 -0
- package/lib/mcp/resources/guides/init_backend.js +50 -0
- package/lib/mcp/resources/guides/init_data_connect.js +30 -0
- package/lib/mcp/resources/guides/init_firestore.js +65 -0
- package/lib/mcp/resources/guides/init_firestore_rules.js +58 -0
- package/lib/mcp/resources/guides/init_hosting.js +39 -0
- package/lib/mcp/resources/guides/init_rtdb.js +30 -0
- package/lib/mcp/resources/index.js +63 -0
- package/lib/mcp/tool.js +9 -4
- package/lib/mcp/tools/apphosting/fetch_logs.js +4 -4
- package/lib/mcp/tools/apphosting/list_backends.js +3 -3
- package/lib/mcp/tools/apptesting/index.js +9 -0
- package/lib/mcp/tools/apptesting/tests.js +99 -0
- package/lib/mcp/tools/auth/get_users.js +54 -0
- package/lib/mcp/tools/auth/index.js +3 -11
- package/lib/mcp/tools/auth/set_sms_region_policy.js +2 -2
- package/lib/mcp/tools/auth/update_user.js +86 -0
- package/lib/mcp/tools/core/create_android_sha.js +2 -2
- package/lib/mcp/tools/core/create_app.js +2 -2
- package/lib/mcp/tools/core/create_project.js +2 -2
- package/lib/mcp/tools/core/get_environment.js +76 -30
- package/lib/mcp/tools/core/get_project.js +2 -2
- package/lib/mcp/tools/core/get_sdk_config.js +3 -2
- package/lib/mcp/tools/core/get_security_rules.js +54 -0
- package/lib/mcp/tools/core/index.js +6 -4
- package/lib/mcp/tools/core/init.js +59 -9
- package/lib/mcp/tools/core/list_apps.js +2 -2
- package/lib/mcp/tools/core/list_projects.js +2 -2
- package/lib/mcp/tools/core/login.js +2 -2
- package/lib/mcp/tools/core/logout.js +3 -4
- package/lib/mcp/tools/core/read_resources.js +40 -0
- package/lib/mcp/tools/core/update_environment.js +4 -3
- package/lib/mcp/tools/core/validate_security_rules.js +125 -0
- package/lib/mcp/tools/crashlytics/events.js +176 -0
- package/lib/mcp/tools/crashlytics/index.js +12 -20
- package/lib/mcp/tools/crashlytics/issues.js +77 -0
- package/lib/mcp/tools/crashlytics/notes.js +79 -0
- package/lib/mcp/tools/crashlytics/reports.js +78 -0
- package/lib/mcp/tools/dataconnect/compile.js +14 -8
- package/lib/mcp/tools/dataconnect/execute.js +12 -10
- package/lib/mcp/tools/dataconnect/index.js +1 -9
- package/lib/mcp/tools/dataconnect/list_services.js +4 -3
- package/lib/mcp/tools/firestore/converter.js +2 -3
- package/lib/mcp/tools/firestore/delete_document.js +2 -2
- package/lib/mcp/tools/firestore/get_documents.js +2 -2
- package/lib/mcp/tools/firestore/index.js +1 -10
- package/lib/mcp/tools/firestore/list_collections.js +2 -2
- package/lib/mcp/tools/firestore/query_collection.js +2 -2
- package/lib/mcp/tools/functions/get_logs.js +153 -0
- package/lib/mcp/tools/functions/index.js +6 -0
- package/lib/mcp/tools/functions/list_functions.js +48 -0
- package/lib/mcp/tools/index.js +66 -39
- package/lib/mcp/tools/messaging/send_message.js +2 -2
- package/lib/mcp/tools/{database → realtime_database}/get_data.js +2 -2
- package/lib/mcp/tools/{database → realtime_database}/index.js +1 -3
- package/lib/mcp/tools/{database → realtime_database}/set_data.js +2 -2
- package/lib/mcp/tools/remoteconfig/get_template.js +2 -2
- package/lib/mcp/tools/remoteconfig/index.js +2 -3
- package/lib/mcp/tools/remoteconfig/update_template.js +43 -0
- package/lib/mcp/tools/storage/get_download_url.js +2 -2
- package/lib/mcp/tools/storage/index.js +1 -7
- package/lib/mcp/types.js +2 -0
- package/lib/mcp/util/apptesting/availability.js +23 -0
- package/lib/mcp/util/availability.js +23 -0
- package/lib/mcp/util/crashlytics/availability.js +68 -0
- package/lib/mcp/util/dataconnect/compile.js +1 -2
- package/lib/mcp/util/dataconnect/converter.js +10 -10
- package/lib/mcp/util/dataconnect/emulator.js +1 -3
- package/lib/mcp/util.js +33 -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 +4 -5
- package/lib/prompt.js +9 -9
- package/lib/rc.js +2 -2
- package/lib/remoteconfig/deleteExperiment.js +31 -0
- package/lib/remoteconfig/deleteRollout.js +32 -0
- package/lib/remoteconfig/get.js +2 -3
- package/lib/remoteconfig/getExperiment.js +52 -0
- package/lib/remoteconfig/getRollout.js +43 -0
- package/lib/remoteconfig/interfaces.js +4 -2
- package/lib/remoteconfig/listExperiments.js +72 -0
- package/lib/remoteconfig/listRollouts.js +72 -0
- package/lib/remoteconfig/options.js +4 -0
- 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 +2 -3
- package/lib/requireConfig.js +1 -2
- package/lib/requireDatabaseInstance.js +3 -3
- 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 +8 -8
- package/lib/rtdb.js +2 -3
- package/lib/rulesDeploy.js +1 -1
- package/lib/serve/hosting.js +3 -4
- 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 +14 -12
- package/lib/tsconfig.publish.tsbuildinfo +1 -0
- package/lib/utils.js +76 -61
- package/lib/vsCodeUtils.js +2 -3
- package/package.json +17 -15
- package/schema/connector-yaml.json +30 -0
- package/schema/firebase-config.json +11 -1
- package/templates/extensions/typescript/index.ts +1 -1
- package/templates/extensions/typescript/package.lint.json +1 -1
- package/templates/extensions/typescript/package.nolint.json +1 -1
- package/templates/extensions/typescript/tsconfig.json +2 -1
- package/templates/genkit/firebase.1.18.0.template +72 -0
- package/templates/init/aitools/gemini-extension.json +1 -1
- package/templates/init/dataconnect/dataconnect-fdcwebhooks.yaml +14 -0
- package/templates/init/dataconnect/secondary_schema.yaml +5 -0
- package/templates/init/dataconnect/seed_data.gql +279 -0
- package/templates/init/functions/javascript/package.lint.json +3 -3
- package/templates/init/functions/javascript/package.nolint.json +3 -3
- package/templates/init/functions/typescript/package.lint.json +3 -3
- package/templates/init/functions/typescript/package.nolint.json +3 -3
- package/lib/crashlytics/addNote.js +0 -27
- package/lib/crashlytics/deleteNote.js +0 -23
- package/lib/crashlytics/getIssueDetails.js +0 -26
- package/lib/crashlytics/getSampleCrash.js +0 -34
- package/lib/crashlytics/listNotes.js +0 -29
- package/lib/crashlytics/listTopDevices.js +0 -33
- package/lib/crashlytics/listTopIssues.js +0 -30
- package/lib/crashlytics/listTopOperatingSystems.js +0 -32
- package/lib/crashlytics/listTopVersions.js +0 -32
- package/lib/crashlytics/updateIssue.js +0 -35
- package/lib/dataconnect/appFinder.js +0 -102
- package/lib/dataconnect/cloudAICompanionClient.js +0 -72
- package/lib/deploy/functions/runtimes/node/extractTriggers.js +0 -23
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +0 -345
- package/lib/deploy/functions/runtimes/node/triggerParser.js +0 -72
- package/lib/functions/deprecationWarnings.js +0 -21
- package/lib/functions/runtimeConfigExport.js +0 -140
- package/lib/handlePreviewToggles.js +0 -38
- package/lib/mcp/tools/auth/disable_user.js +0 -30
- package/lib/mcp/tools/auth/get_user.js +0 -45
- package/lib/mcp/tools/auth/list_users.js +0 -36
- package/lib/mcp/tools/auth/set_claims.js +0 -43
- package/lib/mcp/tools/core/consult_assistant.js +0 -33
- package/lib/mcp/tools/core/get_admin_sdk_config.js +0 -26
- package/lib/mcp/tools/crashlytics/add_note.js +0 -32
- package/lib/mcp/tools/crashlytics/constants.js +0 -11
- package/lib/mcp/tools/crashlytics/delete_note.js +0 -35
- package/lib/mcp/tools/crashlytics/get_issue_details.js +0 -31
- package/lib/mcp/tools/crashlytics/get_sample_crash.js +0 -43
- package/lib/mcp/tools/crashlytics/list_notes.js +0 -37
- package/lib/mcp/tools/crashlytics/list_top_devices.js +0 -33
- package/lib/mcp/tools/crashlytics/list_top_issues.js +0 -38
- package/lib/mcp/tools/crashlytics/list_top_operating_systems.js +0 -33
- package/lib/mcp/tools/crashlytics/list_top_versions.js +0 -33
- package/lib/mcp/tools/crashlytics/update_issue.js +0 -37
- package/lib/mcp/tools/database/get_rules.js +0 -39
- package/lib/mcp/tools/database/validate_rules.js +0 -41
- package/lib/mcp/tools/dataconnect/generate_operation.js +0 -34
- package/lib/mcp/tools/dataconnect/generate_schema.js +0 -26
- package/lib/mcp/tools/remoteconfig/publish_template.js +0 -34
- package/lib/mcp/tools/remoteconfig/rollback_template.js +0 -29
- package/lib/mcp/tools/rules/get_rules.js +0 -29
- package/lib/mcp/tools/rules/validate_rules.js +0 -97
- package/lib/mcp/tools/storage/get_rules.js +0 -26
- package/lib/parseBoltRules.js +0 -29
- package/templates/genkit/firebase.0.9.0.template +0 -57
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");
|
|
@@ -17,7 +19,6 @@ function parameterizeProject(projectId, projectNumber, spec) {
|
|
|
17
19
|
newSpec.params = newParams;
|
|
18
20
|
return newSpec;
|
|
19
21
|
}
|
|
20
|
-
exports.parameterizeProject = parameterizeProject;
|
|
21
22
|
async function setSecretParamsToLatest(spec) {
|
|
22
23
|
const newParams = { ...spec.params };
|
|
23
24
|
const extensionVersion = await (0, planner_1.getExtensionVersion)(spec);
|
|
@@ -31,7 +32,6 @@ async function setSecretParamsToLatest(spec) {
|
|
|
31
32
|
}
|
|
32
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,7 +43,6 @@ function displayExportInfo(withRef, withoutRef) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
exports.displayExportInfo = displayExportInfo;
|
|
47
46
|
function displaySpecs(specs) {
|
|
48
47
|
for (let i = 0; i < specs.length; i++) {
|
|
49
48
|
const spec = specs[i];
|
|
@@ -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");
|
|
@@ -66,7 +80,6 @@ async function createInstance(args) {
|
|
|
66
80
|
}
|
|
67
81
|
return await createInstanceHelper(args.projectId, args.instanceId, config, args.labels, args.validateOnly);
|
|
68
82
|
}
|
|
69
|
-
exports.createInstance = createInstance;
|
|
70
83
|
async function deleteInstance(projectId, instanceId) {
|
|
71
84
|
const deleteRes = await extensionsApiClient.delete(`/projects/${projectId}/instances/${instanceId}`);
|
|
72
85
|
const pollRes = await operationPoller.pollOperation({
|
|
@@ -77,7 +90,6 @@ async function deleteInstance(projectId, instanceId) {
|
|
|
77
90
|
});
|
|
78
91
|
return pollRes;
|
|
79
92
|
}
|
|
80
|
-
exports.deleteInstance = deleteInstance;
|
|
81
93
|
async function getInstance(projectId, instanceId) {
|
|
82
94
|
try {
|
|
83
95
|
const res = await extensionsApiClient.get(`/projects/${projectId}/instances/${instanceId}`);
|
|
@@ -92,7 +104,6 @@ async function getInstance(projectId, instanceId) {
|
|
|
92
104
|
throw err;
|
|
93
105
|
}
|
|
94
106
|
}
|
|
95
|
-
exports.getInstance = getInstance;
|
|
96
107
|
async function listInstances(projectId) {
|
|
97
108
|
const instances = [];
|
|
98
109
|
const getNextPage = async (pageToken = "") => {
|
|
@@ -112,7 +123,6 @@ async function listInstances(projectId) {
|
|
|
112
123
|
await getNextPage();
|
|
113
124
|
return instances;
|
|
114
125
|
}
|
|
115
|
-
exports.listInstances = listInstances;
|
|
116
126
|
async function configureInstance(args) {
|
|
117
127
|
const reqBody = {
|
|
118
128
|
projectId: args.projectId,
|
|
@@ -139,7 +149,6 @@ async function configureInstance(args) {
|
|
|
139
149
|
}
|
|
140
150
|
return patchInstance(reqBody);
|
|
141
151
|
}
|
|
142
|
-
exports.configureInstance = configureInstance;
|
|
143
152
|
async function updateInstance(args) {
|
|
144
153
|
const body = {
|
|
145
154
|
config: {
|
|
@@ -171,7 +180,6 @@ async function updateInstance(args) {
|
|
|
171
180
|
data: body,
|
|
172
181
|
});
|
|
173
182
|
}
|
|
174
|
-
exports.updateInstance = updateInstance;
|
|
175
183
|
async function updateInstanceFromRegistry(args) {
|
|
176
184
|
const ref = refs.parse(args.extRef);
|
|
177
185
|
const body = {
|
|
@@ -205,7 +213,6 @@ async function updateInstanceFromRegistry(args) {
|
|
|
205
213
|
data: body,
|
|
206
214
|
});
|
|
207
215
|
}
|
|
208
|
-
exports.updateInstanceFromRegistry = updateInstanceFromRegistry;
|
|
209
216
|
async function patchInstance(args) {
|
|
210
217
|
const updateRes = await extensionsApiClient.patch(`/projects/${args.projectId}/instances/${args.instanceId}`, args.data, {
|
|
211
218
|
queryParams: {
|
|
@@ -240,7 +247,6 @@ function populateSpec(spec) {
|
|
|
240
247
|
spec.systemParams = spec.systemParams ?? [];
|
|
241
248
|
}
|
|
242
249
|
}
|
|
243
|
-
exports.populateSpec = populateSpec;
|
|
244
250
|
async function createSource(projectId, packageUri, extensionRoot) {
|
|
245
251
|
const createRes = await extensionsApiClient.post(`/projects/${projectId}/sources/`, {
|
|
246
252
|
packageUri,
|
|
@@ -257,7 +263,6 @@ async function createSource(projectId, packageUri, extensionRoot) {
|
|
|
257
263
|
}
|
|
258
264
|
return pollRes;
|
|
259
265
|
}
|
|
260
|
-
exports.createSource = createSource;
|
|
261
266
|
async function getSource(sourceName) {
|
|
262
267
|
const res = await extensionsApiClient.get(`/${sourceName}`);
|
|
263
268
|
if (res.body.spec) {
|
|
@@ -265,7 +270,6 @@ async function getSource(sourceName) {
|
|
|
265
270
|
}
|
|
266
271
|
return res.body;
|
|
267
272
|
}
|
|
268
|
-
exports.getSource = getSource;
|
|
269
273
|
async function getExtensionVersion(extensionVersionRef) {
|
|
270
274
|
const ref = refs.parse(extensionVersionRef);
|
|
271
275
|
if (!ref.version) {
|
|
@@ -288,7 +292,6 @@ async function getExtensionVersion(extensionVersionRef) {
|
|
|
288
292
|
throw new error_1.FirebaseError(`Failed to query the extension version '${clc.bold(extensionVersionRef)}': ${(0, error_1.getErrMsg)(err)}`);
|
|
289
293
|
}
|
|
290
294
|
}
|
|
291
|
-
exports.getExtensionVersion = getExtensionVersion;
|
|
292
295
|
async function listExtensions(publisherId) {
|
|
293
296
|
const extensions = [];
|
|
294
297
|
const getNextPage = async (pageToken = "") => {
|
|
@@ -308,7 +311,6 @@ async function listExtensions(publisherId) {
|
|
|
308
311
|
await getNextPage();
|
|
309
312
|
return extensions;
|
|
310
313
|
}
|
|
311
|
-
exports.listExtensions = listExtensions;
|
|
312
314
|
async function listExtensionVersions(ref, filter = "", showPrereleases = false) {
|
|
313
315
|
const { publisherId, extensionId } = refs.parse(ref);
|
|
314
316
|
const extensionVersions = [];
|
|
@@ -331,7 +333,6 @@ async function listExtensionVersions(ref, filter = "", showPrereleases = false)
|
|
|
331
333
|
await getNextPage();
|
|
332
334
|
return extensionVersions;
|
|
333
335
|
}
|
|
334
|
-
exports.listExtensionVersions = listExtensionVersions;
|
|
335
336
|
async function getExtension(extensionRef) {
|
|
336
337
|
const ref = refs.parse(extensionRef);
|
|
337
338
|
try {
|
|
@@ -350,11 +351,9 @@ async function getExtension(extensionRef) {
|
|
|
350
351
|
});
|
|
351
352
|
}
|
|
352
353
|
}
|
|
353
|
-
exports.getExtension = getExtension;
|
|
354
354
|
function refNotFoundError(ref) {
|
|
355
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` +
|
|
356
356
|
` -The publisher ID '${clc.bold(ref.publisherId)}' doesn't exist or could be misspelled\n` +
|
|
357
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` +
|
|
358
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 });
|
|
359
359
|
}
|
|
360
|
-
exports.refNotFoundError = refNotFoundError;
|
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.resourceTypeToNiceName = exports.AUTOPOPULATED_PARAM_PLACEHOLDERS = exports.EXTENSIONS_BUCKET_NAME = exports.URL_REGEX = exports.logPrefix = exports.SourceOrigin = exports.SpecParamType = void 0;
|
|
4
|
+
exports.getDBInstanceFromURL = getDBInstanceFromURL;
|
|
5
|
+
exports.getFirebaseProjectParams = getFirebaseProjectParams;
|
|
6
|
+
exports.substituteParams = substituteParams;
|
|
7
|
+
exports.substituteSecretParams = substituteSecretParams;
|
|
8
|
+
exports.populateDefaultParams = populateDefaultParams;
|
|
9
|
+
exports.validateCommandLineParams = validateCommandLineParams;
|
|
10
|
+
exports.validateSpec = validateSpec;
|
|
11
|
+
exports.promptForValidInstanceId = promptForValidInstanceId;
|
|
12
|
+
exports.promptForValidRepoURI = promptForValidRepoURI;
|
|
13
|
+
exports.promptForExtensionRoot = promptForExtensionRoot;
|
|
14
|
+
exports.checkExtensionsApiEnabled = checkExtensionsApiEnabled;
|
|
15
|
+
exports.ensureExtensionsApiEnabled = ensureExtensionsApiEnabled;
|
|
16
|
+
exports.ensureExtensionsPublisherApiEnabled = ensureExtensionsPublisherApiEnabled;
|
|
17
|
+
exports.getNextVersionByStage = getNextVersionByStage;
|
|
18
|
+
exports.unpackExtensionState = unpackExtensionState;
|
|
19
|
+
exports.uploadExtensionVersionFromGitHubSource = uploadExtensionVersionFromGitHubSource;
|
|
20
|
+
exports.uploadExtensionVersionFromLocalSource = uploadExtensionVersionFromLocalSource;
|
|
21
|
+
exports.getMissingPublisherError = getMissingPublisherError;
|
|
22
|
+
exports.createSourceFromLocation = createSourceFromLocation;
|
|
23
|
+
exports.getPublisherProjectFromName = getPublisherProjectFromName;
|
|
24
|
+
exports.displayReleaseNotes = displayReleaseNotes;
|
|
25
|
+
exports.promptForRepeatInstance = promptForRepeatInstance;
|
|
26
|
+
exports.instanceIdExists = instanceIdExists;
|
|
27
|
+
exports.isUrlPath = isUrlPath;
|
|
28
|
+
exports.isLocalPath = isLocalPath;
|
|
29
|
+
exports.isLocalOrURLPath = isLocalOrURLPath;
|
|
30
|
+
exports.getSourceOrigin = getSourceOrigin;
|
|
31
|
+
exports.diagnoseAndFixProject = diagnoseAndFixProject;
|
|
4
32
|
const clc = require("colorette");
|
|
5
33
|
const ora = require("ora");
|
|
6
34
|
const semver = require("semver");
|
|
@@ -39,7 +67,7 @@ var SpecParamType;
|
|
|
39
67
|
SpecParamType["STRING"] = "string";
|
|
40
68
|
SpecParamType["SELECTRESOURCE"] = "selectResource";
|
|
41
69
|
SpecParamType["SECRET"] = "secret";
|
|
42
|
-
})(SpecParamType
|
|
70
|
+
})(SpecParamType || (exports.SpecParamType = SpecParamType = {}));
|
|
43
71
|
var SourceOrigin;
|
|
44
72
|
(function (SourceOrigin) {
|
|
45
73
|
SourceOrigin["OFFICIAL_EXTENSION"] = "official extension";
|
|
@@ -48,7 +76,7 @@ var SourceOrigin;
|
|
|
48
76
|
SourceOrigin["PUBLISHED_EXTENSION_VERSION"] = "specific version of a published extension";
|
|
49
77
|
SourceOrigin["URL"] = "unpublished extension (URL source)";
|
|
50
78
|
SourceOrigin["OFFICIAL_EXTENSION_VERSION"] = "specific version of an official extension";
|
|
51
|
-
})(SourceOrigin
|
|
79
|
+
})(SourceOrigin || (exports.SourceOrigin = SourceOrigin = {}));
|
|
52
80
|
exports.logPrefix = "extensions";
|
|
53
81
|
const VALID_LICENSES = ["apache-2.0"];
|
|
54
82
|
exports.URL_REGEX = /^https:/;
|
|
@@ -80,7 +108,6 @@ function getDBInstanceFromURL(databaseUrl = "") {
|
|
|
80
108
|
}
|
|
81
109
|
return "";
|
|
82
110
|
}
|
|
83
|
-
exports.getDBInstanceFromURL = getDBInstanceFromURL;
|
|
84
111
|
async function getFirebaseProjectParams(projectId, emulatorMode = false) {
|
|
85
112
|
if (!projectId) {
|
|
86
113
|
return {};
|
|
@@ -116,7 +143,6 @@ async function getFirebaseProjectParams(projectId, emulatorMode = false) {
|
|
|
116
143
|
DATABASE_INSTANCE: getDBInstanceFromURL(databaseURL),
|
|
117
144
|
};
|
|
118
145
|
}
|
|
119
|
-
exports.getFirebaseProjectParams = getFirebaseProjectParams;
|
|
120
146
|
function substituteParams(original, params) {
|
|
121
147
|
const startingString = JSON.stringify(original);
|
|
122
148
|
const applySubstitution = (str, paramVal, paramKey) => {
|
|
@@ -131,7 +157,6 @@ function substituteParams(original, params) {
|
|
|
131
157
|
const s = Object.entries(params).reduce((str, [key, val]) => applySubstitution(str, val, key), startingString);
|
|
132
158
|
return JSON.parse(s);
|
|
133
159
|
}
|
|
134
|
-
exports.substituteParams = substituteParams;
|
|
135
160
|
async function substituteSecretParams(projectNumber, params) {
|
|
136
161
|
const newParams = {};
|
|
137
162
|
for await (const [key, value] of Object.entries(params)) {
|
|
@@ -145,7 +170,6 @@ async function substituteSecretParams(projectNumber, params) {
|
|
|
145
170
|
}
|
|
146
171
|
return newParams;
|
|
147
172
|
}
|
|
148
|
-
exports.substituteSecretParams = substituteSecretParams;
|
|
149
173
|
function populateDefaultParams(paramVars, paramSpecs) {
|
|
150
174
|
const newParams = paramVars;
|
|
151
175
|
for (const param of paramSpecs) {
|
|
@@ -161,7 +185,6 @@ function populateDefaultParams(paramVars, paramSpecs) {
|
|
|
161
185
|
}
|
|
162
186
|
return newParams;
|
|
163
187
|
}
|
|
164
|
-
exports.populateDefaultParams = populateDefaultParams;
|
|
165
188
|
function validateCommandLineParams(envVars, paramSpec) {
|
|
166
189
|
const paramNames = paramSpec.map((p) => p.param);
|
|
167
190
|
const misnamedParams = Object.keys(envVars).filter((key) => {
|
|
@@ -181,7 +204,6 @@ function validateCommandLineParams(envVars, paramSpec) {
|
|
|
181
204
|
throw new error_1.FirebaseError(`Some param values are not valid. Please check your params file.`);
|
|
182
205
|
}
|
|
183
206
|
}
|
|
184
|
-
exports.validateCommandLineParams = validateCommandLineParams;
|
|
185
207
|
function validateSpec(spec) {
|
|
186
208
|
const errors = [];
|
|
187
209
|
if (!spec.name) {
|
|
@@ -275,7 +297,6 @@ function validateSpec(spec) {
|
|
|
275
297
|
throw new error_1.FirebaseError(message);
|
|
276
298
|
}
|
|
277
299
|
}
|
|
278
|
-
exports.validateSpec = validateSpec;
|
|
279
300
|
async function promptForValidInstanceId(instanceId) {
|
|
280
301
|
let instanceIdIsValid = false;
|
|
281
302
|
let newInstanceId = "";
|
|
@@ -298,7 +319,6 @@ async function promptForValidInstanceId(instanceId) {
|
|
|
298
319
|
}
|
|
299
320
|
return newInstanceId;
|
|
300
321
|
}
|
|
301
|
-
exports.promptForValidInstanceId = promptForValidInstanceId;
|
|
302
322
|
async function promptForValidRepoURI() {
|
|
303
323
|
let repoIsValid = false;
|
|
304
324
|
let extensionRoot = "";
|
|
@@ -313,14 +333,12 @@ async function promptForValidRepoURI() {
|
|
|
313
333
|
}
|
|
314
334
|
return extensionRoot;
|
|
315
335
|
}
|
|
316
|
-
exports.promptForValidRepoURI = promptForValidRepoURI;
|
|
317
336
|
async function promptForExtensionRoot(defaultRoot) {
|
|
318
337
|
return await (0, prompt_1.input)({
|
|
319
338
|
message: "Enter this extension's root directory in the repo (defaults to previous root if set):",
|
|
320
339
|
default: defaultRoot,
|
|
321
340
|
});
|
|
322
341
|
}
|
|
323
|
-
exports.promptForExtensionRoot = promptForExtensionRoot;
|
|
324
342
|
async function promptForReleaseStage(args) {
|
|
325
343
|
let stage = "rc";
|
|
326
344
|
if (!args.nonInteractive) {
|
|
@@ -366,7 +384,6 @@ async function checkExtensionsApiEnabled(options) {
|
|
|
366
384
|
}
|
|
367
385
|
return await (0, ensureApiEnabled_1.check)(projectId, (0, api_1.extensionsOrigin)(), "extensions", options.markdown);
|
|
368
386
|
}
|
|
369
|
-
exports.checkExtensionsApiEnabled = checkExtensionsApiEnabled;
|
|
370
387
|
async function ensureExtensionsApiEnabled(options) {
|
|
371
388
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
372
389
|
if (!projectId) {
|
|
@@ -374,7 +391,6 @@ async function ensureExtensionsApiEnabled(options) {
|
|
|
374
391
|
}
|
|
375
392
|
return await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.extensionsOrigin)(), "extensions", options.markdown);
|
|
376
393
|
}
|
|
377
|
-
exports.ensureExtensionsApiEnabled = ensureExtensionsApiEnabled;
|
|
378
394
|
async function ensureExtensionsPublisherApiEnabled(options) {
|
|
379
395
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
380
396
|
if (!projectId) {
|
|
@@ -382,10 +398,8 @@ async function ensureExtensionsPublisherApiEnabled(options) {
|
|
|
382
398
|
}
|
|
383
399
|
return await (0, ensureApiEnabled_1.ensure)(projectId, (0, api_1.extensionsPublisherOrigin)(), "extensions", options.markdown);
|
|
384
400
|
}
|
|
385
|
-
exports.ensureExtensionsPublisherApiEnabled = ensureExtensionsPublisherApiEnabled;
|
|
386
401
|
async function archiveAndUploadSource(extPath, bucketName) {
|
|
387
402
|
const zippedSource = await (0, archiveDirectory_1.archiveDirectory)(extPath, {
|
|
388
|
-
type: "zip",
|
|
389
403
|
ignore: ["node_modules", ".git"],
|
|
390
404
|
});
|
|
391
405
|
const res = await (0, storage_1.uploadObject)(zippedSource, bucketName);
|
|
@@ -416,7 +430,6 @@ async function getNextVersionByStage(extensionRef, newVersion) {
|
|
|
416
430
|
versionByStage.set("stable", newVersion);
|
|
417
431
|
return { versionByStage, hasVersions: extensionVersions.length > 0 };
|
|
418
432
|
}
|
|
419
|
-
exports.getNextVersionByStage = getNextVersionByStage;
|
|
420
433
|
async function validateExtensionSpec(rootDirectory, extensionId) {
|
|
421
434
|
const extensionSpec = await (0, localHelper_1.getLocalExtensionSpec)(rootDirectory);
|
|
422
435
|
if (extensionSpec.name !== extensionId) {
|
|
@@ -475,7 +488,6 @@ function unpackExtensionState(extension) {
|
|
|
475
488
|
return "-";
|
|
476
489
|
}
|
|
477
490
|
}
|
|
478
|
-
exports.unpackExtensionState = unpackExtensionState;
|
|
479
491
|
function displayExtensionHeader(extensionRef, extension, extensionRoot) {
|
|
480
492
|
if (extension) {
|
|
481
493
|
let source = "Local source";
|
|
@@ -637,7 +649,6 @@ async function uploadExtensionVersionFromGitHubSource(args) {
|
|
|
637
649
|
}
|
|
638
650
|
return res;
|
|
639
651
|
}
|
|
640
|
-
exports.uploadExtensionVersionFromGitHubSource = uploadExtensionVersionFromGitHubSource;
|
|
641
652
|
async function uploadExtensionVersionFromLocalSource(args) {
|
|
642
653
|
const extensionRef = `${args.publisherId}/${args.extensionId}`;
|
|
643
654
|
let extension;
|
|
@@ -717,11 +728,9 @@ async function uploadExtensionVersionFromLocalSource(args) {
|
|
|
717
728
|
await deleteUploadedSource(objectPath);
|
|
718
729
|
return res;
|
|
719
730
|
}
|
|
720
|
-
exports.uploadExtensionVersionFromLocalSource = uploadExtensionVersionFromLocalSource;
|
|
721
731
|
function getMissingPublisherError(publisherId) {
|
|
722
732
|
return new error_1.FirebaseError(`Couldn't find publisher ID '${clc.bold(publisherId)}'. Please ensure that you have registered this ID. For step-by-step instructions on getting started as a publisher, see https://firebase.google.com/docs/extensions/publishers/get-started.`);
|
|
723
733
|
}
|
|
724
|
-
exports.getMissingPublisherError = getMissingPublisherError;
|
|
725
734
|
async function createSourceFromLocation(projectId, sourceUri) {
|
|
726
735
|
const extensionRoot = "/";
|
|
727
736
|
let packageUri;
|
|
@@ -744,7 +753,6 @@ async function createSourceFromLocation(projectId, sourceUri) {
|
|
|
744
753
|
});
|
|
745
754
|
}
|
|
746
755
|
}
|
|
747
|
-
exports.createSourceFromLocation = createSourceFromLocation;
|
|
748
756
|
async function deleteUploadedSource(objectPath) {
|
|
749
757
|
if (objectPath.length) {
|
|
750
758
|
try {
|
|
@@ -764,7 +772,6 @@ function getPublisherProjectFromName(publisherName) {
|
|
|
764
772
|
}
|
|
765
773
|
throw new error_1.FirebaseError(`Could not find publisher with name '${publisherName}'.`);
|
|
766
774
|
}
|
|
767
|
-
exports.getPublisherProjectFromName = getPublisherProjectFromName;
|
|
768
775
|
function displayReleaseNotes(args) {
|
|
769
776
|
const source = args.sourceUri || "Local source";
|
|
770
777
|
const releaseNotesMessage = args.releaseNotes
|
|
@@ -779,7 +786,6 @@ function displayReleaseNotes(args) {
|
|
|
779
786
|
`Once an extension version is uploaded, it becomes installable by other users and cannot be changed. If you wish to make changes after uploading, you will need to upload a new version.\n`;
|
|
780
787
|
logger_1.logger.info(message);
|
|
781
788
|
}
|
|
782
|
-
exports.displayReleaseNotes = displayReleaseNotes;
|
|
783
789
|
async function promptForRepeatInstance(projectName, extensionName) {
|
|
784
790
|
const message = `An extension with the ID '${clc.bold(extensionName)}' already exists in the project '${clc.bold(projectName)}'. What would you like to do?`;
|
|
785
791
|
return await (0, prompt_1.select)({
|
|
@@ -791,7 +797,6 @@ async function promptForRepeatInstance(projectName, extensionName) {
|
|
|
791
797
|
],
|
|
792
798
|
});
|
|
793
799
|
}
|
|
794
|
-
exports.promptForRepeatInstance = promptForRepeatInstance;
|
|
795
800
|
async function instanceIdExists(projectId, instanceId) {
|
|
796
801
|
try {
|
|
797
802
|
await (0, extensionsApi_1.getInstance)(projectId, instanceId);
|
|
@@ -812,11 +817,9 @@ async function instanceIdExists(projectId, instanceId) {
|
|
|
812
817
|
}
|
|
813
818
|
return true;
|
|
814
819
|
}
|
|
815
|
-
exports.instanceIdExists = instanceIdExists;
|
|
816
820
|
function isUrlPath(extInstallPath) {
|
|
817
821
|
return extInstallPath.startsWith("https:");
|
|
818
822
|
}
|
|
819
|
-
exports.isUrlPath = isUrlPath;
|
|
820
823
|
function isLocalPath(extInstallPath) {
|
|
821
824
|
const trimmedPath = extInstallPath.trim();
|
|
822
825
|
return (trimmedPath.startsWith(`~${path.sep}`) ||
|
|
@@ -829,11 +832,9 @@ function isLocalPath(extInstallPath) {
|
|
|
829
832
|
trimmedPath.startsWith(`/`) ||
|
|
830
833
|
[".", ".."].includes(trimmedPath));
|
|
831
834
|
}
|
|
832
|
-
exports.isLocalPath = isLocalPath;
|
|
833
835
|
function isLocalOrURLPath(extInstallPath) {
|
|
834
836
|
return isLocalPath(extInstallPath) || isUrlPath(extInstallPath);
|
|
835
837
|
}
|
|
836
|
-
exports.isLocalOrURLPath = isLocalOrURLPath;
|
|
837
838
|
function getSourceOrigin(sourceOrVersion) {
|
|
838
839
|
if (isLocalPath(sourceOrVersion)) {
|
|
839
840
|
return SourceOrigin.LOCAL;
|
|
@@ -857,7 +858,6 @@ function getSourceOrigin(sourceOrVersion) {
|
|
|
857
858
|
}
|
|
858
859
|
throw new error_1.FirebaseError(`Could not find source '${clc.bold(sourceOrVersion)}'. Check to make sure the source is correct, and then please try again.`);
|
|
859
860
|
}
|
|
860
|
-
exports.getSourceOrigin = getSourceOrigin;
|
|
861
861
|
async function diagnoseAndFixProject(options) {
|
|
862
862
|
const projectId = (0, projectUtils_1.getProjectId)(options);
|
|
863
863
|
if (!projectId) {
|
|
@@ -868,4 +868,3 @@ async function diagnoseAndFixProject(options) {
|
|
|
868
868
|
throw new error_1.FirebaseError("Unable to proceed until all issues are resolved.");
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
|
-
exports.diagnoseAndFixProject = diagnoseAndFixProject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listExtensions =
|
|
3
|
+
exports.listExtensions = listExtensions;
|
|
4
4
|
const clc = require("colorette");
|
|
5
5
|
const Table = require("cli-table3");
|
|
6
6
|
const extensionsApi_1 = require("./extensionsApi");
|
|
@@ -49,4 +49,3 @@ async function listExtensions(projectId) {
|
|
|
49
49
|
logger_1.logger.info(table.toString());
|
|
50
50
|
return formatted;
|
|
51
51
|
}
|
|
52
|
-
exports.listExtensions = listExtensions;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.EXTENSIONS_SPEC_FILE = void 0;
|
|
4
|
+
exports.getLocalExtensionSpec = getLocalExtensionSpec;
|
|
5
|
+
exports.findExtensionYaml = findExtensionYaml;
|
|
6
|
+
exports.readFile = readFile;
|
|
7
|
+
exports.isLocalExtension = isLocalExtension;
|
|
4
8
|
const fs = require("fs-extra");
|
|
5
9
|
const path = require("path");
|
|
6
10
|
const yaml = require("yaml");
|
|
@@ -29,7 +33,6 @@ async function getLocalExtensionSpec(directory) {
|
|
|
29
33
|
}
|
|
30
34
|
return spec;
|
|
31
35
|
}
|
|
32
|
-
exports.getLocalExtensionSpec = getLocalExtensionSpec;
|
|
33
36
|
function fixLifecycleEvents(lifecycleEvents) {
|
|
34
37
|
const stages = {
|
|
35
38
|
onInstall: "ON_INSTALL",
|
|
@@ -62,7 +65,6 @@ function findExtensionYaml(directory) {
|
|
|
62
65
|
}
|
|
63
66
|
return directory;
|
|
64
67
|
}
|
|
65
|
-
exports.findExtensionYaml = findExtensionYaml;
|
|
66
68
|
function readFile(pathToFile) {
|
|
67
69
|
try {
|
|
68
70
|
return fs.readFileSync(pathToFile, "utf8");
|
|
@@ -74,7 +76,6 @@ function readFile(pathToFile) {
|
|
|
74
76
|
throw new error_1.FirebaseError(`Failed to read file at "${pathToFile}"`, { original: err });
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
|
-
exports.readFile = readFile;
|
|
78
79
|
function isLocalExtension(extensionName) {
|
|
79
80
|
try {
|
|
80
81
|
fs.readdirSync(extensionName);
|
|
@@ -84,7 +85,6 @@ function isLocalExtension(extensionName) {
|
|
|
84
85
|
}
|
|
85
86
|
return true;
|
|
86
87
|
}
|
|
87
|
-
exports.isLocalExtension = isLocalExtension;
|
|
88
88
|
function parseYAML(source) {
|
|
89
89
|
try {
|
|
90
90
|
return yaml.parse(source);
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ENV_DIRECTORY = void 0;
|
|
4
|
+
exports.writeToManifest = writeToManifest;
|
|
5
|
+
exports.writeEmptyManifest = writeEmptyManifest;
|
|
6
|
+
exports.writeLocalSecrets = writeLocalSecrets;
|
|
7
|
+
exports.removeFromManifest = removeFromManifest;
|
|
8
|
+
exports.loadConfig = loadConfig;
|
|
9
|
+
exports.instanceExists = instanceExists;
|
|
10
|
+
exports.getInstanceTarget = getInstanceTarget;
|
|
11
|
+
exports.getInstanceRef = getInstanceRef;
|
|
12
|
+
exports.writeExtensionsToFirebaseJson = writeExtensionsToFirebaseJson;
|
|
13
|
+
exports.readInstanceParam = readInstanceParam;
|
|
4
14
|
const path = require("path");
|
|
5
15
|
const fs = require("fs-extra");
|
|
6
16
|
const refs = require("./refs");
|
|
@@ -38,7 +48,6 @@ async function writeToManifest(specs, config, options, allowOverwrite = false) {
|
|
|
38
48
|
await writeEnvFiles(specs, config, options.force);
|
|
39
49
|
await writeLocalSecrets(specs, config, options.force);
|
|
40
50
|
}
|
|
41
|
-
exports.writeToManifest = writeToManifest;
|
|
42
51
|
async function writeEmptyManifest(config, options) {
|
|
43
52
|
if (!fs.existsSync(config.path("extensions"))) {
|
|
44
53
|
fs.mkdirSync(config.path("extensions"));
|
|
@@ -58,7 +67,6 @@ async function writeEmptyManifest(config, options) {
|
|
|
58
67
|
}
|
|
59
68
|
config.set("extensions", {});
|
|
60
69
|
}
|
|
61
|
-
exports.writeEmptyManifest = writeEmptyManifest;
|
|
62
70
|
async function writeLocalSecrets(specs, config, force) {
|
|
63
71
|
for (const spec of specs) {
|
|
64
72
|
const extensionSpec = await (0, planner_1.getExtensionSpec)(spec);
|
|
@@ -83,7 +91,6 @@ async function writeLocalSecrets(specs, config, force) {
|
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
}
|
|
86
|
-
exports.writeLocalSecrets = writeLocalSecrets;
|
|
87
94
|
function removeFromManifest(instanceId, config) {
|
|
88
95
|
if (!instanceExists(instanceId, config)) {
|
|
89
96
|
throw new error_1.FirebaseError(`Extension instance ${instanceId} not found in firebase.json.`);
|
|
@@ -104,7 +111,6 @@ function removeFromManifest(instanceId, config) {
|
|
|
104
111
|
logger_1.logger.info(`Removed extension instance local secret config extensions/${instanceId}.secret.local`);
|
|
105
112
|
}
|
|
106
113
|
}
|
|
107
|
-
exports.removeFromManifest = removeFromManifest;
|
|
108
114
|
function loadConfig(options) {
|
|
109
115
|
const existingConfig = config_1.Config.load(options, true);
|
|
110
116
|
if (!existingConfig) {
|
|
@@ -112,18 +118,15 @@ function loadConfig(options) {
|
|
|
112
118
|
}
|
|
113
119
|
return existingConfig;
|
|
114
120
|
}
|
|
115
|
-
exports.loadConfig = loadConfig;
|
|
116
121
|
function instanceExists(instanceId, config) {
|
|
117
122
|
return !!config.get("extensions", {})[instanceId];
|
|
118
123
|
}
|
|
119
|
-
exports.instanceExists = instanceExists;
|
|
120
124
|
function getInstanceTarget(instanceId, config) {
|
|
121
125
|
if (!instanceExists(instanceId, config)) {
|
|
122
126
|
throw new error_1.FirebaseError(`Could not find extension instance ${instanceId} in firebase.json`);
|
|
123
127
|
}
|
|
124
128
|
return config.get("extensions", {})[instanceId];
|
|
125
129
|
}
|
|
126
|
-
exports.getInstanceTarget = getInstanceTarget;
|
|
127
130
|
function getInstanceRef(instanceId, config) {
|
|
128
131
|
const source = getInstanceTarget(instanceId, config);
|
|
129
132
|
if ((0, extensionsHelper_1.isLocalPath)(source)) {
|
|
@@ -131,7 +134,6 @@ function getInstanceRef(instanceId, config) {
|
|
|
131
134
|
}
|
|
132
135
|
return refs.parse(source);
|
|
133
136
|
}
|
|
134
|
-
exports.getInstanceRef = getInstanceRef;
|
|
135
137
|
function writeExtensionsToFirebaseJson(specs, config) {
|
|
136
138
|
const extensions = config.get("extensions", {});
|
|
137
139
|
for (const s of specs) {
|
|
@@ -150,7 +152,6 @@ function writeExtensionsToFirebaseJson(specs, config) {
|
|
|
150
152
|
config.set("extensions", extensions);
|
|
151
153
|
config.writeProjectFile("firebase.json", config.src);
|
|
152
154
|
}
|
|
153
|
-
exports.writeExtensionsToFirebaseJson = writeExtensionsToFirebaseJson;
|
|
154
155
|
async function writeEnvFiles(specs, config, force) {
|
|
155
156
|
for (const spec of specs) {
|
|
156
157
|
const content = Object.entries(spec.params)
|
|
@@ -192,7 +193,6 @@ function readInstanceParam(args) {
|
|
|
192
193
|
}
|
|
193
194
|
return combinedParams;
|
|
194
195
|
}
|
|
195
|
-
exports.readInstanceParam = readInstanceParam;
|
|
196
196
|
function readParamsFile(projectDir, fileName) {
|
|
197
197
|
const paramPath = path.join(projectDir, exports.ENV_DIRECTORY, fileName);
|
|
198
198
|
const params = (0, paramHelper_1.readEnvFile)(paramPath);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseTimeseriesResponse = parseTimeseriesResponse;
|
|
4
|
+
exports.parseBucket = parseBucket;
|
|
5
|
+
exports.buildMetricsTableRow = buildMetricsTableRow;
|
|
4
6
|
const semver = require("semver");
|
|
5
7
|
const clc = require("colorette");
|
|
6
8
|
function parseTimeseriesResponse(series) {
|
|
@@ -40,7 +42,6 @@ function parseTimeseriesResponse(series) {
|
|
|
40
42
|
});
|
|
41
43
|
return ret;
|
|
42
44
|
}
|
|
43
|
-
exports.parseTimeseriesResponse = parseTimeseriesResponse;
|
|
44
45
|
function parseBucket(value) {
|
|
45
46
|
const v = Number(value);
|
|
46
47
|
if (v >= 200) {
|
|
@@ -51,7 +52,6 @@ function parseBucket(value) {
|
|
|
51
52
|
}
|
|
52
53
|
return { low: 0, high: 0 };
|
|
53
54
|
}
|
|
54
|
-
exports.parseBucket = parseBucket;
|
|
55
55
|
function buildMetricsTableRow(metric) {
|
|
56
56
|
const ret = [metric.ref.version];
|
|
57
57
|
if (metric.valueToday) {
|
|
@@ -64,7 +64,6 @@ function buildMetricsTableRow(metric) {
|
|
|
64
64
|
ret.push(renderChangeCell(metric.value28dAgo, metric.valueToday));
|
|
65
65
|
return ret;
|
|
66
66
|
}
|
|
67
|
-
exports.buildMetricsTableRow = buildMetricsTableRow;
|
|
68
67
|
function renderChangeCell(before, after) {
|
|
69
68
|
if (!(before && after)) {
|
|
70
69
|
return "Insufficient data";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getBaseParamBindings = getBaseParamBindings;
|
|
4
|
+
exports.buildBindingOptionsWithBaseValue = buildBindingOptionsWithBaseValue;
|
|
5
|
+
exports.setNewDefaults = setNewDefaults;
|
|
6
|
+
exports.getParams = getParams;
|
|
7
|
+
exports.getParamsForUpdate = getParamsForUpdate;
|
|
8
|
+
exports.promptForNewParams = promptForNewParams;
|
|
9
|
+
exports.readEnvFile = readEnvFile;
|
|
10
|
+
exports.isSystemParam = isSystemParam;
|
|
11
|
+
exports.populateDefaultParams = populateDefaultParams;
|
|
4
12
|
const path = require("path");
|
|
5
13
|
const clc = require("colorette");
|
|
6
14
|
const fs = require("fs-extra");
|
|
@@ -22,7 +30,6 @@ function getBaseParamBindings(params) {
|
|
|
22
30
|
}
|
|
23
31
|
return ret;
|
|
24
32
|
}
|
|
25
|
-
exports.getBaseParamBindings = getBaseParamBindings;
|
|
26
33
|
function buildBindingOptionsWithBaseValue(baseParams) {
|
|
27
34
|
let paramOptions = {};
|
|
28
35
|
for (const [k, v] of Object.entries(baseParams)) {
|
|
@@ -33,7 +40,6 @@ function buildBindingOptionsWithBaseValue(baseParams) {
|
|
|
33
40
|
}
|
|
34
41
|
return paramOptions;
|
|
35
42
|
}
|
|
36
|
-
exports.buildBindingOptionsWithBaseValue = buildBindingOptionsWithBaseValue;
|
|
37
43
|
function setNewDefaults(params, newDefaults) {
|
|
38
44
|
for (const param of params) {
|
|
39
45
|
if (newDefaults[param.param]) {
|
|
@@ -46,7 +52,6 @@ function setNewDefaults(params, newDefaults) {
|
|
|
46
52
|
}
|
|
47
53
|
return params;
|
|
48
54
|
}
|
|
49
|
-
exports.setNewDefaults = setNewDefaults;
|
|
50
55
|
async function getParams(args) {
|
|
51
56
|
let params;
|
|
52
57
|
if (args.nonInteractive) {
|
|
@@ -64,7 +69,6 @@ async function getParams(args) {
|
|
|
64
69
|
}
|
|
65
70
|
return params;
|
|
66
71
|
}
|
|
67
|
-
exports.getParams = getParams;
|
|
68
72
|
async function getParamsForUpdate(args) {
|
|
69
73
|
let params;
|
|
70
74
|
if (args.nonInteractive) {
|
|
@@ -81,7 +85,6 @@ async function getParamsForUpdate(args) {
|
|
|
81
85
|
}
|
|
82
86
|
return params;
|
|
83
87
|
}
|
|
84
|
-
exports.getParamsForUpdate = getParamsForUpdate;
|
|
85
88
|
async function promptForNewParams(args) {
|
|
86
89
|
const newParamBindingOptions = buildBindingOptionsWithBaseValue(args.currentParams);
|
|
87
90
|
const firebaseProjectParams = await (0, extensionsHelper_1.getFirebaseProjectParams)(args.projectId);
|
|
@@ -129,7 +132,6 @@ async function promptForNewParams(args) {
|
|
|
129
132
|
}
|
|
130
133
|
return newParamBindingOptions;
|
|
131
134
|
}
|
|
132
|
-
exports.promptForNewParams = promptForNewParams;
|
|
133
135
|
function readEnvFile(envPath) {
|
|
134
136
|
const buf = fs.readFileSync(path.resolve(envPath), "utf8");
|
|
135
137
|
const result = env.parse(buf.toString().trim());
|
|
@@ -138,12 +140,10 @@ function readEnvFile(envPath) {
|
|
|
138
140
|
}
|
|
139
141
|
return result.envs;
|
|
140
142
|
}
|
|
141
|
-
exports.readEnvFile = readEnvFile;
|
|
142
143
|
function isSystemParam(paramName) {
|
|
143
144
|
const regex = /^firebaseextensions\.[a-zA-Z0-9\.]*\//;
|
|
144
145
|
return regex.test(paramName);
|
|
145
146
|
}
|
|
146
|
-
exports.isSystemParam = isSystemParam;
|
|
147
147
|
function populateDefaultParams(params, spec) {
|
|
148
148
|
const ret = { ...params };
|
|
149
149
|
for (const p of spec.params) {
|
|
@@ -151,4 +151,3 @@ function populateDefaultParams(params, spec) {
|
|
|
151
151
|
}
|
|
152
152
|
return ret;
|
|
153
153
|
}
|
|
154
|
-
exports.populateDefaultParams = populateDefaultParams;
|