firebase-tools-with-isolate 13.29.1 → 14.10.1-1
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/README.md +53 -4
- package/lib/api.js +10 -2
- package/lib/appdistribution/client.js +2 -2
- package/lib/apphosting/backend.js +157 -55
- package/lib/apphosting/config.js +121 -101
- package/lib/apphosting/githubConnections.js +65 -100
- package/lib/apphosting/repo.js +22 -36
- package/lib/apphosting/rollout.js +5 -11
- package/lib/apphosting/secrets/dialogs.js +13 -11
- package/lib/apphosting/secrets/index.js +47 -5
- package/lib/apphosting/utils.js +1 -3
- package/lib/apphosting/yaml.js +35 -49
- package/lib/auth.js +23 -6
- package/lib/bin/cli.js +99 -0
- package/lib/bin/firebase.js +7 -123
- package/lib/bin/mcp.js +49 -0
- package/lib/checkValidTargetFilters.js +1 -0
- package/lib/command.js +3 -2
- package/lib/commands/appdistribution-distribute.js +1 -1
- package/lib/commands/appdistribution-groups-create.js +1 -1
- package/lib/commands/appdistribution-groups-delete.js +1 -1
- package/lib/commands/appdistribution-groups-list.js +2 -2
- package/lib/commands/appdistribution-testers-add.js +1 -1
- package/lib/commands/appdistribution-testers-list.js +3 -3
- package/lib/commands/appdistribution-testers-remove.js +1 -1
- package/lib/commands/apphosting-backends-create.js +3 -3
- package/lib/commands/apphosting-backends-delete.js +23 -27
- package/lib/commands/apphosting-backends-get.js +12 -12
- package/lib/commands/apphosting-backends-list.js +5 -5
- package/lib/commands/apphosting-builds-create.js +8 -2
- package/lib/commands/apphosting-builds-get.js +8 -1
- package/lib/commands/apphosting-rollouts-create.js +3 -3
- package/lib/commands/apphosting-rollouts-list.js +8 -2
- package/lib/commands/apphosting-secrets-access.js +1 -1
- package/lib/commands/apphosting-secrets-describe.js +2 -2
- package/lib/commands/apphosting-secrets-grantaccess.js +20 -10
- package/lib/commands/apphosting-secrets-set.js +27 -1
- package/lib/commands/apps-android-sha-create.js +1 -1
- package/lib/commands/apps-android-sha-delete.js +1 -1
- package/lib/commands/apps-android-sha-list.js +2 -2
- package/lib/commands/apps-create.js +4 -108
- package/lib/commands/apps-init.js +94 -0
- package/lib/commands/apps-list.js +1 -1
- package/lib/commands/apps-sdkconfig.js +5 -10
- package/lib/commands/auth-export.js +1 -1
- package/lib/commands/auth-import.js +1 -1
- package/lib/commands/database-import.js +4 -6
- package/lib/commands/database-instances-create.js +1 -1
- package/lib/commands/database-instances-list.js +1 -1
- package/lib/commands/database-profile.js +1 -2
- package/lib/commands/database-remove.js +4 -6
- package/lib/commands/database-set.js +6 -6
- package/lib/commands/database-settings-set.js +1 -1
- package/lib/commands/database-update.js +6 -6
- package/lib/commands/dataconnect-sdk-generate.js +5 -2
- package/lib/commands/dataconnect-services-list.js +2 -2
- package/lib/commands/dataconnect-sql-diff.js +2 -2
- package/lib/commands/dataconnect-sql-grant.js +3 -3
- package/lib/commands/dataconnect-sql-migrate.js +2 -2
- package/lib/commands/dataconnect-sql-setup.js +39 -0
- package/lib/commands/dataconnect-sql-shell.js +5 -7
- package/lib/commands/deploy.js +4 -3
- package/lib/commands/emulators-exec.js +1 -1
- package/lib/commands/emulators-start.js +4 -3
- package/lib/commands/experiments-list.js +1 -1
- package/lib/commands/ext-dev-deprecate.js +1 -0
- package/lib/commands/ext-dev-init.js +3 -12
- package/lib/commands/ext-dev-list.js +1 -1
- package/lib/commands/ext-dev-register.js +3 -5
- package/lib/commands/ext-dev-undeprecate.js +1 -2
- package/lib/commands/ext-dev-usage.js +4 -6
- package/lib/commands/ext-export.js +1 -2
- package/lib/commands/ext-install.js +3 -3
- package/lib/commands/ext-sdk-install.js +1 -0
- package/lib/commands/ext-update.js +1 -0
- package/lib/commands/firestore-backups-delete.js +3 -4
- package/lib/commands/firestore-backups-get.js +1 -1
- package/lib/commands/firestore-backups-list.js +2 -2
- package/lib/commands/firestore-backups-schedules-create.js +4 -4
- package/lib/commands/firestore-backups-schedules-delete.js +3 -4
- package/lib/commands/firestore-backups-schedules-list.js +2 -2
- package/lib/commands/firestore-backups-schedules-update.js +1 -1
- package/lib/commands/firestore-databases-create.js +6 -6
- package/lib/commands/firestore-databases-delete.js +3 -7
- package/lib/commands/firestore-databases-get.js +1 -1
- package/lib/commands/firestore-databases-list.js +1 -1
- package/lib/commands/firestore-databases-restore.js +5 -5
- package/lib/commands/firestore-databases-update.js +4 -4
- package/lib/commands/firestore-delete.js +13 -14
- package/lib/commands/firestore-indexes-list.js +4 -4
- package/lib/commands/firestore-locations.js +1 -1
- package/lib/commands/functions-artifacts-setpolicy.js +132 -0
- package/lib/commands/functions-config-export.js +6 -10
- package/lib/commands/functions-delete.js +5 -7
- package/lib/commands/functions-deletegcfartifacts.js +5 -5
- package/lib/commands/functions-list.js +24 -33
- package/lib/commands/functions-secrets-access.js +1 -1
- package/lib/commands/functions-secrets-describe.js +1 -1
- package/lib/commands/functions-secrets-destroy.js +10 -12
- package/lib/commands/functions-secrets-get.js +1 -1
- package/lib/commands/functions-secrets-prune.js +14 -15
- package/lib/commands/functions-secrets-set.js +14 -18
- package/lib/commands/hosting-channel-create.js +1 -2
- package/lib/commands/hosting-channel-delete.js +4 -4
- package/lib/commands/hosting-channel-list.js +1 -1
- package/lib/commands/hosting-channel-open.js +2 -3
- package/lib/commands/hosting-disable.js +5 -5
- package/lib/commands/hosting-sites-delete.js +4 -4
- package/lib/commands/hosting-sites-get.js +1 -1
- package/lib/commands/hosting-sites-list.js +1 -1
- package/lib/commands/index.js +7 -4
- package/lib/commands/init.js +54 -60
- package/lib/commands/internaltesting-frameworks-compose.js +1 -1
- package/lib/commands/login-use.js +2 -11
- package/lib/commands/login.js +10 -8
- package/lib/commands/logout.js +2 -3
- package/lib/commands/mcp.js +11 -0
- package/lib/commands/open.js +4 -2
- package/lib/commands/projects-create.js +1 -2
- package/lib/commands/projects-list.js +1 -1
- package/lib/commands/remoteconfig-get.js +1 -1
- package/lib/commands/remoteconfig-rollback.js +5 -5
- package/lib/commands/remoteconfig-versions-list.js +2 -2
- package/lib/commands/setup-emulators-database.js +1 -1
- package/lib/commands/setup-emulators-dataconnect.js +1 -1
- package/lib/commands/setup-emulators-firestore.js +1 -1
- package/lib/commands/setup-emulators-pubsub.js +1 -1
- package/lib/commands/setup-emulators-storage.js +1 -1
- package/lib/commands/setup-emulators-ui.js +1 -1
- package/lib/commands/use.js +115 -111
- package/lib/config.js +49 -33
- package/lib/crashlytics/buildToolsJarHelper.js +1 -1
- package/lib/crashlytics/listTopIssues.js +45 -0
- package/lib/dataconnect/build.js +61 -4
- package/lib/dataconnect/client.js +26 -17
- package/lib/dataconnect/cloudAICompanionClient.js +72 -0
- package/lib/dataconnect/dataplaneClient.js +19 -2
- package/lib/dataconnect/ensureApis.js +6 -3
- package/lib/dataconnect/fileUtils.js +39 -6
- package/lib/dataconnect/freeTrial.js +21 -9
- package/lib/dataconnect/graphqlError.js +56 -2
- package/lib/dataconnect/provisionCloudSql.js +23 -12
- package/lib/dataconnect/schemaMigration.js +46 -26
- package/lib/dataconnect/types.js +5 -1
- package/lib/defaultCredentials.js +12 -1
- package/lib/deploy/apphosting/args.js +2 -0
- package/lib/deploy/apphosting/deploy.js +77 -0
- package/lib/deploy/apphosting/index.js +9 -0
- package/lib/deploy/apphosting/prepare.js +138 -0
- package/lib/deploy/apphosting/release.js +56 -0
- package/lib/deploy/apphosting/util.js +65 -0
- package/lib/deploy/dataconnect/deploy.js +14 -7
- package/lib/deploy/dataconnect/prepare.js +3 -5
- package/lib/deploy/extensions/v2FunctionHelper.js +2 -1
- package/lib/deploy/firestore/deploy.js +50 -4
- package/lib/deploy/functions/build.js +1 -0
- package/lib/deploy/functions/checkIam.js +41 -6
- package/lib/deploy/functions/containerCleaner.js +17 -2
- package/lib/deploy/functions/ensure.js +2 -1
- package/lib/deploy/functions/params.js +10 -17
- package/lib/deploy/functions/prepare.js +51 -18
- package/lib/deploy/functions/prepareFunctionsUpload.js +9 -5
- package/lib/deploy/functions/prompts.js +24 -17
- package/lib/deploy/functions/release/fabricator.js +4 -4
- package/lib/deploy/functions/release/index.js +27 -9
- package/lib/deploy/functions/release/planner.js +1 -0
- package/lib/deploy/functions/runtimes/discovery/index.js +13 -5
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +4 -4
- package/lib/deploy/functions/runtimes/python/index.js +4 -1
- package/lib/deploy/functions/runtimes/supported/types.js +17 -11
- package/lib/deploy/functions/services/firestore.js +23 -4
- package/lib/deploy/index.js +29 -10
- package/lib/deploy/lifecycleHooks.js +6 -12
- package/lib/emulator/ExpressBasedEmulator.js +1 -1
- package/lib/emulator/apphosting/config.js +15 -14
- package/lib/emulator/apphosting/index.js +2 -0
- package/lib/emulator/apphosting/serve.js +147 -10
- package/lib/emulator/auth/cloudFunctions.js +13 -1
- package/lib/emulator/auth/operations.js +2 -1
- package/lib/emulator/auth/widget_ui.js +2 -1
- package/lib/emulator/commandUtils.js +14 -20
- package/lib/emulator/constants.js +2 -0
- package/lib/emulator/controller.js +24 -9
- package/lib/emulator/dataconnect/pgliteServer.js +136 -45
- package/lib/emulator/dataconnectEmulator.js +34 -6
- package/lib/emulator/dataconnectToolkitController.js +5 -0
- package/lib/emulator/downloadableEmulatorInfo.json +81 -0
- package/lib/emulator/downloadableEmulators.js +28 -80
- package/lib/emulator/env.js +47 -1
- package/lib/emulator/extensionsEmulator.js +5 -3
- package/lib/emulator/functionsEmulator.js +6 -26
- package/lib/emulator/hub.js +5 -4
- package/lib/emulator/hubClient.js +5 -0
- package/lib/emulator/initEmulators.js +29 -15
- package/lib/emulator/ui.js +4 -8
- package/lib/ensureApiEnabled.js +32 -1
- package/lib/experiments.js +11 -12
- package/lib/extensions/askUserForEventsConfig.js +6 -15
- package/lib/extensions/askUserForParam.js +23 -52
- package/lib/extensions/change-log.js +1 -25
- package/lib/extensions/checkProjectBilling.js +3 -9
- package/lib/extensions/diagnose.js +3 -6
- package/lib/extensions/emulator/triggerHelper.js +4 -0
- package/lib/extensions/extensionsHelper.js +25 -31
- package/lib/extensions/listExtensions.js +1 -1
- package/lib/extensions/manifest.js +3 -7
- package/lib/extensions/paramHelper.js +11 -2
- package/lib/extensions/provisioningHelper.js +1 -1
- package/lib/extensions/tos.js +4 -2
- package/lib/extensions/utils.js +1 -10
- package/lib/firebaseConfigValidate.js +7 -5
- package/lib/firestore/delete.js +5 -4
- package/lib/firestore/pretty-print.js +1 -1
- package/lib/frameworks/angular/index.js +11 -6
- package/lib/frameworks/angular/utils.js +76 -47
- package/lib/frameworks/constants.js +1 -1
- package/lib/frameworks/index.js +6 -4
- package/lib/frameworks/next/index.js +7 -4
- package/lib/frameworks/utils.js +11 -3
- package/lib/frameworks/vite/index.js +2 -3
- package/lib/fsAsync.js +9 -2
- package/lib/fsutils.js +16 -1
- package/lib/functions/artifacts.js +196 -0
- package/lib/functions/secrets.js +15 -16
- package/lib/gcp/apphosting.js +13 -1
- package/lib/gcp/artifactregistry.js +27 -2
- package/lib/gcp/auth.js +113 -1
- package/lib/gcp/cloudbilling.js +12 -1
- package/lib/gcp/cloudfunctions.js +32 -4
- package/lib/gcp/cloudfunctionsv2.js +15 -9
- package/lib/gcp/cloudscheduler.js +2 -2
- package/lib/gcp/cloudsql/cloudsqladmin.js +32 -11
- package/lib/gcp/cloudsql/connect.js +21 -14
- package/lib/gcp/cloudsql/interactive.js +1 -1
- package/lib/gcp/cloudsql/permissions.js +46 -99
- package/lib/gcp/cloudsql/permissionsSetup.js +224 -0
- package/lib/gcp/computeEngine.js +19 -2
- package/lib/gcp/devConnect.js +6 -1
- package/lib/gcp/firestore.js +55 -16
- package/lib/gcp/iam.js +1 -5
- package/lib/gcp/proto.js +4 -3
- package/lib/gcp/run.js +18 -1
- package/lib/gcp/serviceusage.js +2 -1
- package/lib/gcp/storage.js +47 -1
- package/lib/gemini/fdcExperience.js +56 -0
- package/lib/gemini/types.js +2 -0
- package/lib/hosting/api.js +4 -0
- package/lib/hosting/implicitInit.js +7 -3
- package/lib/hosting/interactive.js +2 -3
- package/lib/index.js +1 -2
- package/lib/init/features/account.js +2 -4
- package/lib/init/features/apphosting.js +75 -6
- package/lib/init/features/database.js +63 -62
- package/lib/init/features/dataconnect/index.js +131 -85
- package/lib/init/features/dataconnect/sdk.js +73 -18
- package/lib/init/features/emulators.js +29 -46
- package/lib/init/features/firestore/index.js +79 -43
- package/lib/init/features/firestore/indexes.js +30 -45
- package/lib/init/features/firestore/rules.js +36 -62
- package/lib/init/features/functions/index.js +11 -16
- package/lib/init/features/functions/javascript.js +17 -30
- package/lib/init/features/functions/npm-dependencies.js +4 -8
- package/lib/init/features/functions/python.js +1 -3
- package/lib/init/features/functions/typescript.js +25 -43
- package/lib/init/features/genkit/index.js +111 -106
- package/lib/init/features/hosting/github.js +22 -52
- package/lib/init/features/hosting/index.js +37 -57
- package/lib/init/features/index.js +10 -5
- package/lib/init/features/project.js +18 -21
- package/lib/init/features/remoteconfig.js +5 -10
- package/lib/init/features/storage.js +30 -10
- package/lib/init/index.js +79 -24
- package/lib/logger.js +76 -3
- package/lib/management/apps.js +292 -7
- package/lib/management/projects.js +100 -52
- package/lib/mcp/errors.js +20 -0
- package/lib/mcp/index.js +227 -0
- package/lib/mcp/tool.js +12 -0
- package/lib/mcp/tools/apphosting/fetch_logs.js +68 -0
- package/lib/mcp/tools/apphosting/index.js +6 -0
- package/lib/mcp/tools/apphosting/list_backends.js +51 -0
- package/lib/mcp/tools/auth/disable_user.js +30 -0
- package/lib/mcp/tools/auth/get_user.js +38 -0
- package/lib/mcp/tools/auth/index.js +15 -0
- package/lib/mcp/tools/auth/list_users.js +36 -0
- package/lib/mcp/tools/auth/set_claims.js +43 -0
- package/lib/mcp/tools/auth/set_sms_region_policy.js +36 -0
- package/lib/mcp/tools/core/consult_assistant.js +28 -0
- package/lib/mcp/tools/core/create_android_sha.js +43 -0
- package/lib/mcp/tools/core/create_app.js +90 -0
- package/lib/mcp/tools/core/create_project.js +68 -0
- package/lib/mcp/tools/core/get_admin_sdk_config.js +26 -0
- package/lib/mcp/tools/core/get_environment.js +51 -0
- package/lib/mcp/tools/core/get_project.js +22 -0
- package/lib/mcp/tools/core/get_sdk_config.js +40 -0
- package/lib/mcp/tools/core/index.js +29 -0
- package/lib/mcp/tools/core/init.js +153 -0
- package/lib/mcp/tools/core/list_apps.js +34 -0
- package/lib/mcp/tools/core/list_projects.js +45 -0
- package/lib/mcp/tools/core/update_environment.js +55 -0
- package/lib/mcp/tools/crashlytics/index.js +5 -0
- package/lib/mcp/tools/crashlytics/list_top_issues.js +39 -0
- package/lib/mcp/tools/dataconnect/converter.js +60 -0
- package/lib/mcp/tools/dataconnect/emulator.js +16 -0
- package/lib/mcp/tools/dataconnect/execute_graphql.js +48 -0
- package/lib/mcp/tools/dataconnect/execute_graphql_read.js +48 -0
- package/lib/mcp/tools/dataconnect/execute_mutation.js +62 -0
- package/lib/mcp/tools/dataconnect/execute_query.js +62 -0
- package/lib/mcp/tools/dataconnect/generate_operation.js +34 -0
- package/lib/mcp/tools/dataconnect/generate_schema.js +26 -0
- package/lib/mcp/tools/dataconnect/get_connector.js +31 -0
- package/lib/mcp/tools/dataconnect/get_schema.js +31 -0
- package/lib/mcp/tools/dataconnect/index.js +23 -0
- package/lib/mcp/tools/dataconnect/list_services.js +23 -0
- package/lib/mcp/tools/firestore/converter.js +102 -0
- package/lib/mcp/tools/firestore/delete_document.js +50 -0
- package/lib/mcp/tools/firestore/get_documents.js +58 -0
- package/lib/mcp/tools/firestore/index.js +17 -0
- package/lib/mcp/tools/firestore/list_collections.js +36 -0
- package/lib/mcp/tools/firestore/query_collection.js +132 -0
- package/lib/mcp/tools/index.js +62 -0
- package/lib/mcp/tools/messaging/index.js +5 -0
- package/lib/mcp/tools/messaging/send_message.js +42 -0
- package/lib/mcp/tools/remoteconfig/get_template.js +27 -0
- package/lib/mcp/tools/remoteconfig/index.js +7 -0
- package/lib/mcp/tools/remoteconfig/publish_template.js +34 -0
- package/lib/mcp/tools/remoteconfig/rollback_template.js +29 -0
- package/lib/mcp/tools/rules/get_rules.js +29 -0
- package/lib/mcp/tools/rules/validate_rules.js +97 -0
- package/lib/mcp/tools/storage/get_download_url.js +40 -0
- package/lib/mcp/tools/storage/get_rules.js +26 -0
- package/lib/mcp/tools/storage/index.js +11 -0
- package/lib/mcp/types.js +13 -0
- package/lib/mcp/util.js +214 -0
- package/lib/mcp/util.test.js +468 -0
- package/lib/messaging/interfaces.js +2 -0
- package/lib/messaging/sendMessage.js +48 -0
- package/lib/operation-poller.js +3 -1
- package/lib/profileReport.js +1 -1
- package/lib/prompt.js +86 -54
- package/lib/remoteconfig/publish.js +39 -0
- package/lib/requireAuth.js +2 -2
- package/lib/requireTosAcceptance.js +4 -0
- package/lib/rulesDeploy.js +10 -15
- package/lib/track.js +7 -37
- package/lib/utils.js +28 -41
- package/lib/vsCodeUtils.js +7 -3
- package/package.json +31 -15
- package/schema/connector-yaml.json +12 -0
- package/schema/dataconnect-yaml.json +5 -0
- package/schema/extension-yaml.json +17 -4
- package/schema/firebase-config.json +1117 -2121
- package/standalone/package-lock.json +1255 -992
- package/standalone/package.json +1 -1
- package/templates/dataconnect-prompts/operation-generation-cursor-windsurf-rule.txt +273 -0
- package/templates/dataconnect-prompts/schema-generation-cursor-windsurf-rule.txt +653 -0
- package/templates/genkit/firebase.0.9.0.template +1 -1
- package/templates/genkit/firebase.1.0.0.template +71 -0
- package/templates/init/dataconnect/connector.yaml +4 -1
- package/templates/init/dataconnect/dataconnect.yaml +1 -1
- package/templates/init/dataconnect/mutations.gql +9 -26
- package/templates/init/dataconnect/queries.gql +9 -14
- package/templates/init/dataconnect/schema.gql +28 -21
- package/templates/init/firestore/firestore.rules +2 -0
- package/templates/init/functions/javascript/index.js +14 -1
- package/templates/init/functions/javascript/package.lint.json +1 -1
- package/templates/init/functions/javascript/package.nolint.json +1 -1
- package/templates/init/functions/python/_gitignore +6 -1
- package/templates/init/functions/python/main.py +8 -0
- package/templates/init/functions/typescript/index.ts +14 -1
- package/templates/init/functions/typescript/package.lint.json +2 -2
- package/templates/init/functions/typescript/package.nolint.json +3 -3
- package/lib/commands/apphosting-config-export.js +0 -28
- package/lib/commands/experimental-functions-shell.js +0 -13
- package/lib/emulator/dataconnect/pg-gateway/auth/base-auth-flow.js +0 -11
- package/lib/emulator/dataconnect/pg-gateway/auth/cert.js +0 -58
- package/lib/emulator/dataconnect/pg-gateway/auth/index.js +0 -22
- package/lib/emulator/dataconnect/pg-gateway/auth/md5.js +0 -124
- package/lib/emulator/dataconnect/pg-gateway/auth/password.js +0 -54
- package/lib/emulator/dataconnect/pg-gateway/auth/sasl/sasl-mechanism.js +0 -34
- package/lib/emulator/dataconnect/pg-gateway/auth/sasl/scram-sha-256.js +0 -270
- package/lib/emulator/dataconnect/pg-gateway/backend-error.js +0 -75
- package/lib/emulator/dataconnect/pg-gateway/buffer-reader.js +0 -54
- package/lib/emulator/dataconnect/pg-gateway/buffer-writer.js +0 -79
- package/lib/emulator/dataconnect/pg-gateway/connection.js +0 -315
- package/lib/emulator/dataconnect/pg-gateway/connection.types.js +0 -8
- package/lib/emulator/dataconnect/pg-gateway/crypto.js +0 -40
- package/lib/emulator/dataconnect/pg-gateway/duplex.js +0 -53
- package/lib/emulator/dataconnect/pg-gateway/index.js +0 -27
- package/lib/emulator/dataconnect/pg-gateway/message-buffer.js +0 -82
- package/lib/emulator/dataconnect/pg-gateway/message-codes.js +0 -52
- package/lib/emulator/dataconnect/pg-gateway/platforms/node/index.js +0 -16
- package/lib/emulator/dataconnect/pg-gateway/polyfills/readable-stream-async-iterator.js +0 -35
- package/lib/emulator/dataconnect/pg-gateway/utils.js +0 -40
- package/templates/setup/web.js +0 -5
- /package/lib/{emulator/dataconnect/pg-gateway/auth/trust.js → dataconnect/cloudAICompanionTypes.js} +0 -0
|
@@ -11,7 +11,7 @@ const clc = require("colorette");
|
|
|
11
11
|
const constants_1 = require("../emulator/constants");
|
|
12
12
|
const utils_1 = require("../utils");
|
|
13
13
|
const webhook_1 = require("../dataconnect/webhook");
|
|
14
|
-
const Table = require("cli-
|
|
14
|
+
const Table = require("cli-table3");
|
|
15
15
|
function stylizeLink(url) {
|
|
16
16
|
return clc.underline(clc.bold(url));
|
|
17
17
|
}
|
|
@@ -104,11 +104,12 @@ function printEmulatorOverview(options) {
|
|
|
104
104
|
const extensionsEmulatorInstance = registry_1.EmulatorRegistry.get(types_1.Emulators.EXTENSIONS);
|
|
105
105
|
extensionsTable = extensionsEmulatorInstance.extensionsInfoTable();
|
|
106
106
|
}
|
|
107
|
+
const hubInfo = registry_1.EmulatorRegistry.getInfo(types_1.Emulators.HUB);
|
|
107
108
|
logger_1.logger.info(`\n${successMessageTable}
|
|
108
109
|
|
|
109
110
|
${emulatorsTable}
|
|
110
|
-
${
|
|
111
|
-
? clc.blackBright(
|
|
111
|
+
${hubInfo
|
|
112
|
+
? clc.blackBright(` Emulator Hub host: ${hubInfo.host} port: ${hubInfo.port}`)
|
|
112
113
|
: clc.blackBright(" Emulator Hub not running.")}
|
|
113
114
|
${clc.blackBright(" Other reserved ports:")} ${reservedPortsString}
|
|
114
115
|
${extensionsTable}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const command_1 = require("../command");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const experiments = require("../experiments");
|
|
7
7
|
const functional_1 = require("../functional");
|
|
8
8
|
const logger_1 = require("../logger");
|
|
@@ -50,6 +50,7 @@ async function deprecate(extensionRef, versionPredicate, options) {
|
|
|
50
50
|
});
|
|
51
51
|
if (filteredExtensionVersions.length > 0) {
|
|
52
52
|
const consent = await (0, prompt_1.confirm)({
|
|
53
|
+
message: "Continue?",
|
|
53
54
|
default: false,
|
|
54
55
|
force: options.force,
|
|
55
56
|
nonInteractive: options.nonInteractive,
|
|
@@ -30,9 +30,7 @@ exports.command = new command_1.Command("ext:dev:init")
|
|
|
30
30
|
const config = new config_1.Config({}, { projectDir: cwd, cwd: cwd });
|
|
31
31
|
try {
|
|
32
32
|
let welcome;
|
|
33
|
-
const lang = await (0, prompt_1.
|
|
34
|
-
type: "list",
|
|
35
|
-
name: "language",
|
|
33
|
+
const lang = await (0, prompt_1.select)({
|
|
36
34
|
message: "In which language do you want to write the Cloud Functions for your extension?",
|
|
37
35
|
default: "javascript",
|
|
38
36
|
choices: [
|
|
@@ -83,9 +81,7 @@ async function typescriptSelected(config) {
|
|
|
83
81
|
const gitignoreTemplate = (0, templates_1.readTemplateSync)("extensions/typescript/_gitignore");
|
|
84
82
|
const mocharcTemplate = (0, templates_1.readTemplateSync)("extensions/typescript/_mocharc");
|
|
85
83
|
const eslintTemplate = (0, templates_1.readTemplateSync)("init/functions/typescript/_eslintrc");
|
|
86
|
-
const lint = await (0, prompt_1.
|
|
87
|
-
name: "lint",
|
|
88
|
-
type: "confirm",
|
|
84
|
+
const lint = await (0, prompt_1.confirm)({
|
|
89
85
|
message: "Do you want to use ESLint to catch probable bugs and enforce style?",
|
|
90
86
|
default: true,
|
|
91
87
|
});
|
|
@@ -119,12 +115,7 @@ async function javascriptSelected(config) {
|
|
|
119
115
|
const packageNoLintingTemplate = (0, templates_1.readTemplateSync)("extensions/javascript/package.nolint.json");
|
|
120
116
|
const gitignoreTemplate = (0, templates_1.readTemplateSync)("extensions/javascript/_gitignore");
|
|
121
117
|
const eslintTemplate = (0, templates_1.readTemplateSync)("init/functions/javascript/_eslintrc");
|
|
122
|
-
const lint = await (0, prompt_1.
|
|
123
|
-
name: "lint",
|
|
124
|
-
type: "confirm",
|
|
125
|
-
message: "Do you want to use ESLint to catch probable bugs and enforce style?",
|
|
126
|
-
default: false,
|
|
127
|
-
});
|
|
118
|
+
const lint = await (0, prompt_1.confirm)("Do you want to use ESLint to catch probable bugs and enforce style?");
|
|
128
119
|
const templates = readCommonTemplates();
|
|
129
120
|
await config.askWriteProjectFile("extension.yaml", templates.extSpecTemplate);
|
|
130
121
|
await config.askWriteProjectFile("PREINSTALL.md", templates.preinstallTemplate);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const command_1 = require("../command");
|
|
7
7
|
const error_1 = require("../error");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
@@ -6,14 +6,14 @@ const marked_1 = require("marked");
|
|
|
6
6
|
const command_1 = require("../command");
|
|
7
7
|
const publisherApi_1 = require("../extensions/publisherApi");
|
|
8
8
|
const projectUtils_1 = require("../projectUtils");
|
|
9
|
-
const prompt_1 = require("../prompt");
|
|
10
9
|
const extensionsHelper_1 = require("../extensions/extensionsHelper");
|
|
11
10
|
const tos_1 = require("../extensions/tos");
|
|
12
11
|
const requirePermissions_1 = require("../requirePermissions");
|
|
13
12
|
const error_1 = require("../error");
|
|
14
13
|
const utils = require("../utils");
|
|
14
|
+
const prompt_1 = require("../prompt");
|
|
15
15
|
exports.command = new command_1.Command("ext:dev:register")
|
|
16
|
-
.description("register a publisher ID; run this before publishing your first extension
|
|
16
|
+
.description("register a publisher ID; run this before publishing your first extension")
|
|
17
17
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.sources.create"])
|
|
18
18
|
.before(extensionsHelper_1.ensureExtensionsPublisherApiEnabled)
|
|
19
19
|
.before(extensionsHelper_1.ensureExtensionsApiEnabled)
|
|
@@ -24,9 +24,7 @@ exports.command = new command_1.Command("ext:dev:register")
|
|
|
24
24
|
"This value identifies you in Firebase's registry of extensions as the author of your extensions. " +
|
|
25
25
|
"Examples: my-company-name, MyGitHubUsername.\n\n" +
|
|
26
26
|
"You can only do this once for each project.";
|
|
27
|
-
const publisherId = await (0, prompt_1.
|
|
28
|
-
name: "publisherId",
|
|
29
|
-
type: "input",
|
|
27
|
+
const publisherId = await (0, prompt_1.input)({
|
|
30
28
|
message: msg,
|
|
31
29
|
default: projectId,
|
|
32
30
|
});
|
|
@@ -37,8 +37,7 @@ exports.command = new command_1.Command("ext:dev:undeprecate <extensionRef> <ver
|
|
|
37
37
|
if (extensionVersions.length > 0) {
|
|
38
38
|
if (!options.force) {
|
|
39
39
|
const confirmMessage = "You are about to undeprecate these extension version(s). Do you wish to continue?";
|
|
40
|
-
const consent = await (0, prompt_1.
|
|
41
|
-
type: "confirm",
|
|
40
|
+
const consent = await (0, prompt_1.confirm)({
|
|
42
41
|
message: confirmMessage,
|
|
43
42
|
default: false,
|
|
44
43
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = void 0;
|
|
4
|
-
const Table = require("cli-
|
|
4
|
+
const Table = require("cli-table3");
|
|
5
5
|
const clc = require("colorette");
|
|
6
6
|
const utils = require("../utils");
|
|
7
7
|
const command_1 = require("../command");
|
|
@@ -16,10 +16,10 @@ const logger_1 = require("../logger");
|
|
|
16
16
|
const prompt_1 = require("../prompt");
|
|
17
17
|
const shortenUrl_1 = require("../shortenUrl");
|
|
18
18
|
exports.command = new command_1.Command("ext:dev:usage <publisherId>")
|
|
19
|
-
.description("get usage for an extension")
|
|
19
|
+
.description("get usage statistics for an extension")
|
|
20
20
|
.help("use this command to get the usage of extensions you published. " +
|
|
21
21
|
"Specify the publisher ID you used to publish your extensions, " +
|
|
22
|
-
"or the extension ref of your published extension
|
|
22
|
+
"or the extension ref of your published extension")
|
|
23
23
|
.before(requireAuth_1.requireAuth)
|
|
24
24
|
.before(checkMinRequiredVersion_1.checkMinRequiredVersion, "extDevMinVersion")
|
|
25
25
|
.action(async (input) => {
|
|
@@ -44,9 +44,7 @@ exports.command = new command_1.Command("ext:dev:usage <publisherId>")
|
|
|
44
44
|
" - This publisher has not published any extensions\n\n" +
|
|
45
45
|
"If you are expecting some extensions to appear, please make sure you have the correct publisher ID and try again.");
|
|
46
46
|
}
|
|
47
|
-
extensionName = await (0, prompt_1.
|
|
48
|
-
type: "list",
|
|
49
|
-
name: "extension",
|
|
47
|
+
extensionName = await (0, prompt_1.select)({
|
|
50
48
|
message: "Which published extension do you want to view the stats for?",
|
|
51
49
|
choices: extensions.map((e) => {
|
|
52
50
|
const [_, name] = e.ref.split("/");
|
|
@@ -37,9 +37,8 @@ exports.command = new command_1.Command("ext:export")
|
|
|
37
37
|
(0, export_1.displayExportInfo)(withRefSubbed, withoutRef);
|
|
38
38
|
if (!options.nonInteractive &&
|
|
39
39
|
!options.force &&
|
|
40
|
-
!(await (0, prompt_1.
|
|
40
|
+
!(await (0, prompt_1.confirm)({
|
|
41
41
|
message: "Do you wish to add these Extension instances to firebase.json?",
|
|
42
|
-
type: "confirm",
|
|
43
42
|
default: true,
|
|
44
43
|
}))) {
|
|
45
44
|
logger_1.logger.info("Exiting. No changes made.");
|
|
@@ -23,9 +23,8 @@ const track_1 = require("../track");
|
|
|
23
23
|
const prompt_1 = require("../prompt");
|
|
24
24
|
const manifest = require("../extensions/manifest");
|
|
25
25
|
const tos_1 = require("../extensions/tos");
|
|
26
|
-
exports.command = new command_1.Command("ext:install [
|
|
27
|
-
.description("add an
|
|
28
|
-
"or, add a local extension if [localPath] is provided")
|
|
26
|
+
exports.command = new command_1.Command("ext:install [extensionRefOrLocalPath]")
|
|
27
|
+
.description("add an extension to firebase.json")
|
|
29
28
|
.option("--local", "deprecated")
|
|
30
29
|
.withForce()
|
|
31
30
|
.before(requirePermissions_1.requirePermissions, ["firebaseextensions.instances.create"])
|
|
@@ -75,6 +74,7 @@ exports.command = new command_1.Command("ext:install [extensionRef]")
|
|
|
75
74
|
throw new error_1.FirebaseError(`Failed to parse ${clc.bold(extensionRef)} as an extension version or a path to a local extension. Please specify a valid reference.`);
|
|
76
75
|
}
|
|
77
76
|
if (!(await (0, prompt_1.confirm)({
|
|
77
|
+
message: "Continue?",
|
|
78
78
|
nonInteractive: options.nonInteractive,
|
|
79
79
|
force: options.force,
|
|
80
80
|
default: true,
|
|
@@ -52,6 +52,7 @@ exports.command = new command_1.Command("ext:update <extensionInstanceId> [updat
|
|
|
52
52
|
}
|
|
53
53
|
utils.logLabeledBullet(extensionsHelper_1.logPrefix, `Updating ${clc.bold(instanceId)} from version ${clc.bold(oldExtensionVersion.ref)} to version ${clc.bold(newExtensionVersion.ref)}.`);
|
|
54
54
|
if (!(await (0, prompt_1.confirm)({
|
|
55
|
+
message: "Continue?",
|
|
55
56
|
nonInteractive: options.nonInteractive,
|
|
56
57
|
force: options.force,
|
|
57
58
|
default: false,
|
|
@@ -11,16 +11,15 @@ const types_1 = require("../emulator/types");
|
|
|
11
11
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
12
12
|
const error_1 = require("../error");
|
|
13
13
|
exports.command = new command_1.Command("firestore:backups:delete <backup>")
|
|
14
|
-
.description("
|
|
15
|
-
.option("--force", "
|
|
14
|
+
.description("delete a backup under your Cloud Firestore database")
|
|
15
|
+
.option("--force", "attempt to delete backup without prompting for confirmation")
|
|
16
16
|
.before(requirePermissions_1.requirePermissions, ["datastore.backups.delete"])
|
|
17
17
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
18
18
|
.action(async (backupName, options) => {
|
|
19
19
|
const backup = await (0, firestore_1.getBackup)(backupName);
|
|
20
20
|
if (!options.force) {
|
|
21
21
|
const confirmMessage = `You are about to delete ${backupName}. Do you wish to continue?`;
|
|
22
|
-
const consent = await (0, prompt_1.
|
|
23
|
-
type: "confirm",
|
|
22
|
+
const consent = await (0, prompt_1.confirm)({
|
|
24
23
|
message: confirmMessage,
|
|
25
24
|
default: false,
|
|
26
25
|
});
|
|
@@ -9,7 +9,7 @@ const commandUtils_1 = require("../emulator/commandUtils");
|
|
|
9
9
|
const firestore_1 = require("../gcp/firestore");
|
|
10
10
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
11
11
|
exports.command = new command_1.Command("firestore:backups:get <backup>")
|
|
12
|
-
.description("
|
|
12
|
+
.description("get a Cloud Firestore database backup")
|
|
13
13
|
.before(requirePermissions_1.requirePermissions, ["datastore.backups.get"])
|
|
14
14
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
15
15
|
.action(async (backupName, options) => {
|
|
@@ -10,8 +10,8 @@ const firestore_1 = require("../gcp/firestore");
|
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
11
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
12
12
|
exports.command = new command_1.Command("firestore:backups:list")
|
|
13
|
-
.description("
|
|
14
|
-
.option("-l, --location <locationId>", "
|
|
13
|
+
.description("list all Cloud Firestore backups in a given location")
|
|
14
|
+
.option("-l, --location <locationId>", "location to search for backups, for example 'nam5'. Run 'firebase firestore:locations' to get a list of eligible locations. Defaults to all locations")
|
|
15
15
|
.before(requirePermissions_1.requirePermissions, ["datastore.backups.list"])
|
|
16
16
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
17
17
|
.action(async (options) => {
|
|
@@ -13,11 +13,11 @@ const commandUtils_1 = require("../emulator/commandUtils");
|
|
|
13
13
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
14
14
|
const error_1 = require("../error");
|
|
15
15
|
exports.command = new command_1.Command("firestore:backups:schedules:create")
|
|
16
|
-
.description("
|
|
17
|
-
.option("-d, --database <databaseId>", "
|
|
16
|
+
.description("create a backup schedule under your Cloud Firestore database")
|
|
17
|
+
.option("-d, --database <databaseId>", "database under which you want to create a schedule. Defaults to the (default) database")
|
|
18
18
|
.option("--retention <duration>", "duration string (e.g. 12h or 30d) for backup retention")
|
|
19
|
-
.option("--recurrence <recurrence>", "
|
|
20
|
-
.option("--day-of-week <dayOfWeek>", "
|
|
19
|
+
.option("--recurrence <recurrence>", "recurrence settings; either DAILY or WEEKLY")
|
|
20
|
+
.option("--day-of-week <dayOfWeek>", "on which day of the week to perform backups; one of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, or SUNDAY")
|
|
21
21
|
.before(requirePermissions_1.requirePermissions, ["datastore.backupSchedules.create"])
|
|
22
22
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
23
23
|
.action(async (options) => {
|
|
@@ -11,16 +11,15 @@ const types_1 = require("../emulator/types");
|
|
|
11
11
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
12
12
|
const error_1 = require("../error");
|
|
13
13
|
exports.command = new command_1.Command("firestore:backups:schedules:delete <backupSchedule>")
|
|
14
|
-
.description("
|
|
15
|
-
.option("--force", "
|
|
14
|
+
.description("delete a backup schedule under your Cloud Firestore database")
|
|
15
|
+
.option("--force", "attempt to delete backup schedule without prompting for confirmation")
|
|
16
16
|
.before(requirePermissions_1.requirePermissions, ["datastore.backupSchedules.delete"])
|
|
17
17
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
18
18
|
.action(async (backupScheduleName, options) => {
|
|
19
19
|
const backupSchedule = await (0, firestore_1.getBackupSchedule)(backupScheduleName);
|
|
20
20
|
if (!options.force) {
|
|
21
21
|
const confirmMessage = `You are about to delete ${backupScheduleName}. Do you wish to continue?`;
|
|
22
|
-
const consent = await (0, prompt_1.
|
|
23
|
-
type: "confirm",
|
|
22
|
+
const consent = await (0, prompt_1.confirm)({
|
|
24
23
|
message: confirmMessage,
|
|
25
24
|
default: false,
|
|
26
25
|
});
|
|
@@ -9,8 +9,8 @@ const commandUtils_1 = require("../emulator/commandUtils");
|
|
|
9
9
|
const firestore_1 = require("../gcp/firestore");
|
|
10
10
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
11
11
|
exports.command = new command_1.Command("firestore:backups:schedules:list")
|
|
12
|
-
.description("
|
|
13
|
-
.option("-d, --database <databaseId>", "
|
|
12
|
+
.description("list backup schedules under your Cloud Firestore database")
|
|
13
|
+
.option("-d, --database <databaseId>", "database whose schedules you wish to list. Defaults to the (default) database")
|
|
14
14
|
.before(requirePermissions_1.requirePermissions, ["datastore.backupSchedules.list"])
|
|
15
15
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
16
16
|
.action(async (options) => {
|
|
@@ -12,7 +12,7 @@ const commandUtils_1 = require("../emulator/commandUtils");
|
|
|
12
12
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
13
13
|
const error_1 = require("../error");
|
|
14
14
|
exports.command = new command_1.Command("firestore:backups:schedules:update <backupSchedule>")
|
|
15
|
-
.description("
|
|
15
|
+
.description("update a backup schedule under your Cloud Firestore database")
|
|
16
16
|
.option("--retention <duration>", "duration string (e.g. 12h or 30d) for backup retention")
|
|
17
17
|
.before(requirePermissions_1.requirePermissions, ["datastore.backupSchedules.update"])
|
|
18
18
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
@@ -12,13 +12,13 @@ const commandUtils_1 = require("../emulator/commandUtils");
|
|
|
12
12
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
13
13
|
const error_1 = require("../error");
|
|
14
14
|
exports.command = new command_1.Command("firestore:databases:create <database>")
|
|
15
|
-
.description("
|
|
16
|
-
.option("--location <locationId>", "
|
|
17
|
-
.option("--delete-protection <deleteProtectionState>", "
|
|
18
|
-
.option("--point-in-time-recovery <enablement>", "
|
|
19
|
-
.option("-k, --kms-key-name <kmsKeyName>", "
|
|
15
|
+
.description("create a database in your Firebase project")
|
|
16
|
+
.option("--location <locationId>", "region to create database, for example 'nam5'. Run 'firebase firestore:locations' to get a list of eligible locations (required)")
|
|
17
|
+
.option("--delete-protection <deleteProtectionState>", "whether or not to prevent deletion of database, for example 'ENABLED' or 'DISABLED'. Default is 'DISABLED'")
|
|
18
|
+
.option("--point-in-time-recovery <enablement>", "whether to enable the PITR feature on this database, for example 'ENABLED' or 'DISABLED'. Default is 'DISABLED'")
|
|
19
|
+
.option("-k, --kms-key-name <kmsKeyName>", "the resource ID of a Cloud KMS key. If set, the database created will be a " +
|
|
20
20
|
"Customer-managed Encryption Key (CMEK) database encrypted with this key. " +
|
|
21
|
-
"This feature is allowlist only in initial launch
|
|
21
|
+
"This feature is allowlist only in initial launch")
|
|
22
22
|
.before(requirePermissions_1.requirePermissions, ["datastore.databases.create"])
|
|
23
23
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
24
24
|
.action(async (database, options) => {
|
|
@@ -12,8 +12,8 @@ const commandUtils_1 = require("../emulator/commandUtils");
|
|
|
12
12
|
const error_1 = require("../error");
|
|
13
13
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
14
14
|
exports.command = new command_1.Command("firestore:databases:delete <database>")
|
|
15
|
-
.description("
|
|
16
|
-
.option("--force", "
|
|
15
|
+
.description("delete a database in your Cloud Firestore project")
|
|
16
|
+
.option("--force", "attempt to delete database without prompting for confirmation")
|
|
17
17
|
.before(requirePermissions_1.requirePermissions, ["datastore.databases.delete"])
|
|
18
18
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
19
19
|
.action(async (database, options) => {
|
|
@@ -21,11 +21,7 @@ exports.command = new command_1.Command("firestore:databases:delete <database>")
|
|
|
21
21
|
const printer = new pretty_print_1.PrettyPrint();
|
|
22
22
|
if (!options.force) {
|
|
23
23
|
const confirmMessage = `You are about to delete projects/${options.project}/databases/${database}. Do you wish to continue?`;
|
|
24
|
-
const consent = await (0, prompt_1.
|
|
25
|
-
type: "confirm",
|
|
26
|
-
message: confirmMessage,
|
|
27
|
-
default: false,
|
|
28
|
-
});
|
|
24
|
+
const consent = await (0, prompt_1.confirm)(confirmMessage);
|
|
29
25
|
if (!consent) {
|
|
30
26
|
throw new error_1.FirebaseError("Delete database canceled.");
|
|
31
27
|
}
|
|
@@ -9,7 +9,7 @@ const types_1 = require("../emulator/types");
|
|
|
9
9
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
10
10
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
11
11
|
exports.command = new command_1.Command("firestore:databases:get [database]")
|
|
12
|
-
.description("
|
|
12
|
+
.description("get information about a Cloud Firestore database")
|
|
13
13
|
.before(requirePermissions_1.requirePermissions, ["datastore.databases.get"])
|
|
14
14
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
15
15
|
.action(async (database, options) => {
|
|
@@ -9,7 +9,7 @@ const types_1 = require("../emulator/types");
|
|
|
9
9
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
10
10
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
11
11
|
exports.command = new command_1.Command("firestore:databases:list")
|
|
12
|
-
.description("
|
|
12
|
+
.description("list the Cloud Firestore databases on your project")
|
|
13
13
|
.before(requirePermissions_1.requirePermissions, ["datastore.databases.list"])
|
|
14
14
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
15
15
|
.action(async (options) => {
|
|
@@ -12,13 +12,13 @@ const options_1 = require("../firestore/options");
|
|
|
12
12
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
13
13
|
const error_1 = require("../error");
|
|
14
14
|
exports.command = new command_1.Command("firestore:databases:restore")
|
|
15
|
-
.description("
|
|
15
|
+
.description("restore a Firestore database from a backup")
|
|
16
16
|
.option("-d, --database <databaseID>", "ID of the database to restore into")
|
|
17
|
-
.option("-b, --backup <backup>", "
|
|
18
|
-
.option("-e, --encryption-type <encryptionType>", `
|
|
17
|
+
.option("-b, --backup <backup>", "backup from which to restore")
|
|
18
|
+
.option("-e, --encryption-type <encryptionType>", `encryption method of the restored database; one of ${options_1.EncryptionType.USE_SOURCE_ENCRYPTION} (default), ` +
|
|
19
19
|
`${options_1.EncryptionType.CUSTOMER_MANAGED_ENCRYPTION}, ${options_1.EncryptionType.GOOGLE_DEFAULT_ENCRYPTION}`)
|
|
20
|
-
.option("-k, --kms-key-name <kmsKeyName>", "
|
|
21
|
-
"feature is allowlist only in initial launch
|
|
20
|
+
.option("-k, --kms-key-name <kmsKeyName>", "resource ID of the Cloud KMS key to encrypt the restored database. This " +
|
|
21
|
+
"feature is allowlist only in initial launch")
|
|
22
22
|
.before(requirePermissions_1.requirePermissions, ["datastore.backups.restoreDatabase"])
|
|
23
23
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
24
24
|
.action(async (options) => {
|
|
@@ -12,10 +12,10 @@ const commandUtils_1 = require("../emulator/commandUtils");
|
|
|
12
12
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
13
13
|
const error_1 = require("../error");
|
|
14
14
|
exports.command = new command_1.Command("firestore:databases:update <database>")
|
|
15
|
-
.description("
|
|
16
|
-
.option("--json", "
|
|
17
|
-
.option("--delete-protection <deleteProtectionState>", "
|
|
18
|
-
.option("--point-in-time-recovery <enablement>", "
|
|
15
|
+
.description("update a database in your Firebase project. Must specify at least one property to update")
|
|
16
|
+
.option("--json", "prints raw json response of the create API call if specified")
|
|
17
|
+
.option("--delete-protection <deleteProtectionState>", "whether or not to prevent deletion of database, for example 'ENABLED' or 'DISABLED'. Default is 'DISABLED'")
|
|
18
|
+
.option("--point-in-time-recovery <enablement>", "whether to enable the PITR feature on this database, for example 'ENABLED' or 'DISABLED'. Default is 'DISABLED'")
|
|
19
19
|
.before(requirePermissions_1.requirePermissions, ["datastore.databases.update"])
|
|
20
20
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
21
21
|
.action(async (database, options) => {
|
|
@@ -47,15 +47,14 @@ function confirmationMessage(deleteOp, options) {
|
|
|
47
47
|
". Are you sure?");
|
|
48
48
|
}
|
|
49
49
|
exports.command = new command_1.Command("firestore:delete [path]")
|
|
50
|
-
.description("
|
|
51
|
-
.option("-r, --recursive", "
|
|
52
|
-
"specified level. May not be passed along with --shallow
|
|
53
|
-
.option("--shallow", "
|
|
50
|
+
.description("delete data from a Cloud Firestore database")
|
|
51
|
+
.option("-r, --recursive", "if set, recursively delete all documents and subcollections at and under the " +
|
|
52
|
+
"specified level. May not be passed along with --shallow")
|
|
53
|
+
.option("--shallow", "delete only documents at the specified level and ignore documents in " +
|
|
54
54
|
"subcollections. This action can potentially orphan documents nested in " +
|
|
55
|
-
"subcollections. May not be passed along with -r
|
|
56
|
-
.option("--all-collections", "
|
|
57
|
-
|
|
58
|
-
.option("-f, --force", "No confirmation. Otherwise, a confirmation prompt will appear.")
|
|
55
|
+
"subcollections. May not be passed along with -r")
|
|
56
|
+
.option("--all-collections", "deletes all collections and documents in the Firestore database")
|
|
57
|
+
.withForce()
|
|
59
58
|
.option("--database <databaseId>", 'Database ID for database to delete from. "(default)" if none is provided.')
|
|
60
59
|
.before(commandUtils_1.printNoticeIfEmulated, types_1.Emulators.FIRESTORE)
|
|
61
60
|
.before(requirePermissions_1.requirePermissions, ["datastore.entities.list", "datastore.entities.delete"])
|
|
@@ -72,13 +71,13 @@ exports.command = new command_1.Command("firestore:delete [path]")
|
|
|
72
71
|
allCollections: options.allCollections,
|
|
73
72
|
databaseId: options.database,
|
|
74
73
|
});
|
|
75
|
-
const
|
|
76
|
-
type: "confirm",
|
|
77
|
-
name: "force",
|
|
78
|
-
default: false,
|
|
74
|
+
const confirmed = await (0, prompt_1.confirm)({
|
|
79
75
|
message: confirmationMessage(deleteOp, options),
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
default: false,
|
|
77
|
+
force: options.force,
|
|
78
|
+
nonInteractive: options.nonInteractive,
|
|
79
|
+
});
|
|
80
|
+
if (!confirmed) {
|
|
82
81
|
return utils.reject("Command aborted.", { exit: 1 });
|
|
83
82
|
}
|
|
84
83
|
if (options.allCollections) {
|
|
@@ -11,10 +11,10 @@ const commandUtils_1 = require("../emulator/commandUtils");
|
|
|
11
11
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
12
12
|
const projectUtils_1 = require("../projectUtils");
|
|
13
13
|
exports.command = new command_1.Command("firestore:indexes")
|
|
14
|
-
.description("
|
|
15
|
-
.option("--pretty", "
|
|
16
|
-
"JSON specification format
|
|
17
|
-
.option("--database <databaseId>", "
|
|
14
|
+
.description("list indexes in a Cloud Firestore database")
|
|
15
|
+
.option("--pretty", "pretty print the indexes. When not specified the indexes are printed in the " +
|
|
16
|
+
"JSON specification format")
|
|
17
|
+
.option("--database <databaseId>", "database ID of the firestore database from which to list indexes. (default) if none provided")
|
|
18
18
|
.before(requirePermissions_1.requirePermissions, ["datastore.indexes.list"])
|
|
19
19
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
20
20
|
.action(async (options) => {
|
|
@@ -9,7 +9,7 @@ const types_1 = require("../emulator/types");
|
|
|
9
9
|
const commandUtils_1 = require("../emulator/commandUtils");
|
|
10
10
|
const pretty_print_1 = require("../firestore/pretty-print");
|
|
11
11
|
exports.command = new command_1.Command("firestore:locations")
|
|
12
|
-
.description("
|
|
12
|
+
.description("list possible locations for your Cloud Firestore database")
|
|
13
13
|
.before(requirePermissions_1.requirePermissions, ["datastore.locations.list"])
|
|
14
14
|
.before(commandUtils_1.warnEmulatorNotSupported, types_1.Emulators.FIRESTORE)
|
|
15
15
|
.action(async (options) => {
|