firebase-tools-with-isolate 13.29.1 → 14.10.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/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
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseChangelog = exports.getLocalChangelog = exports.breakingChangesInUpdate = exports.
|
|
4
|
-
const clc = require("colorette");
|
|
3
|
+
exports.parseChangelog = exports.getLocalChangelog = exports.breakingChangesInUpdate = exports.getReleaseNotesForUpdate = void 0;
|
|
5
4
|
const marked_1 = require("marked");
|
|
6
5
|
const path = require("path");
|
|
7
6
|
const semver = require("semver");
|
|
8
7
|
const marked_terminal_1 = require("marked-terminal");
|
|
9
|
-
const Table = require("cli-table");
|
|
10
8
|
const extensionsApi_1 = require("./extensionsApi");
|
|
11
9
|
const localHelper_1 = require("./localHelper");
|
|
12
|
-
const logger_1 = require("../logger");
|
|
13
10
|
const refs = require("./refs");
|
|
14
|
-
const utils_1 = require("../utils");
|
|
15
11
|
marked_1.marked.use((0, marked_terminal_1.markedTerminal)());
|
|
16
12
|
const EXTENSIONS_CHANGELOG = "CHANGELOG.md";
|
|
17
13
|
const VERSION_LINE_REGEX = /##.+?(\d+\.\d+\.\d+(?:-((\d+|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(\d+|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?).*/;
|
|
@@ -31,26 +27,6 @@ async function getReleaseNotesForUpdate(args) {
|
|
|
31
27
|
return releaseNotes;
|
|
32
28
|
}
|
|
33
29
|
exports.getReleaseNotesForUpdate = getReleaseNotesForUpdate;
|
|
34
|
-
function displayReleaseNotes(releaseNotes, fromVersion) {
|
|
35
|
-
const versions = [fromVersion].concat(Object.keys(releaseNotes));
|
|
36
|
-
const breakingVersions = breakingChangesInUpdate(versions);
|
|
37
|
-
const table = new Table({ head: ["Version", "What's New"], style: { head: ["yellow", "bold"] } });
|
|
38
|
-
for (const [version, note] of Object.entries(releaseNotes)) {
|
|
39
|
-
if (breakingVersions.includes(version)) {
|
|
40
|
-
table.push([clc.yellow(clc.bold(version)), (0, marked_1.marked)(note)]);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
table.push([version, (0, marked_1.marked)(note)]);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
logger_1.logger.info(clc.bold("What's new with this update:"));
|
|
47
|
-
if (breakingVersions.length) {
|
|
48
|
-
(0, utils_1.logLabeledWarning)("warning", "This is a major version update, which means it may contain breaking changes." +
|
|
49
|
-
" Read the release notes carefully before continuing with this update.");
|
|
50
|
-
}
|
|
51
|
-
logger_1.logger.info(table.toString());
|
|
52
|
-
}
|
|
53
|
-
exports.displayReleaseNotes = displayReleaseNotes;
|
|
54
30
|
function breakingChangesInUpdate(versionsInUpdate) {
|
|
55
31
|
const breakingVersions = [];
|
|
56
32
|
const semvers = versionsInUpdate.map((v) => semver.parse(v)).sort(semver.compare);
|
|
@@ -25,9 +25,7 @@ async function openBillingAccount(projectId, url, open) {
|
|
|
25
25
|
logger_1.logger.debug("Unable to open billing URL: " + err.stack);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
await prompt.
|
|
29
|
-
name: "continue",
|
|
30
|
-
type: "confirm",
|
|
28
|
+
await prompt.confirm({
|
|
31
29
|
message: "Press enter when finished upgrading your project to continue setting up your extension.",
|
|
32
30
|
default: true,
|
|
33
31
|
});
|
|
@@ -36,9 +34,7 @@ async function openBillingAccount(projectId, url, open) {
|
|
|
36
34
|
async function chooseBillingAccount(projectId, accounts) {
|
|
37
35
|
const choices = accounts.map((m) => m.displayName);
|
|
38
36
|
choices.push(ADD_BILLING_ACCOUNT);
|
|
39
|
-
const answer = await prompt.
|
|
40
|
-
name: "billing",
|
|
41
|
-
type: "list",
|
|
37
|
+
const answer = await prompt.select({
|
|
42
38
|
message: `Extensions require your project to be upgraded to the Blaze plan. You have access to the following billing accounts.
|
|
43
39
|
Please select the one that you would like to associate with this project:`,
|
|
44
40
|
choices: choices,
|
|
@@ -61,9 +57,7 @@ async function setUpBillingAccount(projectId) {
|
|
|
61
57
|
logger_1.logger.info();
|
|
62
58
|
logger_1.logger.info(clc.bold(clc.underline(billingURL)));
|
|
63
59
|
logger_1.logger.info();
|
|
64
|
-
const open = await prompt.
|
|
65
|
-
name: "open-url",
|
|
66
|
-
type: "confirm",
|
|
60
|
+
const open = await prompt.confirm({
|
|
67
61
|
message: "Press enter to open the URL.",
|
|
68
62
|
default: true,
|
|
69
63
|
});
|
|
@@ -5,8 +5,8 @@ const extensionsHelper_1 = require("./extensionsHelper");
|
|
|
5
5
|
const getProjectNumber_1 = require("../getProjectNumber");
|
|
6
6
|
const utils = require("../utils");
|
|
7
7
|
const resourceManager = require("../gcp/resourceManager");
|
|
8
|
-
const extensionsApi_1 = require("./extensionsApi");
|
|
9
8
|
const prompt_1 = require("../prompt");
|
|
9
|
+
const extensionsApi_1 = require("./extensionsApi");
|
|
10
10
|
const logger_1 = require("../logger");
|
|
11
11
|
const error_1 = require("../error");
|
|
12
12
|
const SERVICE_AGENT_ROLE = "roles/firebasemods.serviceAgent";
|
|
@@ -36,11 +36,8 @@ async function diagnose(projectId) {
|
|
|
36
36
|
else {
|
|
37
37
|
utils.logWarning("Firebase Extensions Service Agent is missing a required IAM role " +
|
|
38
38
|
"`Firebase Extensions API Service Agent`.");
|
|
39
|
-
const fix = await (0, prompt_1.
|
|
40
|
-
|
|
41
|
-
message: "Would you like to fix the issue by updating IAM policy to include Firebase " +
|
|
42
|
-
"Extensions Service Agent with role `Firebase Extensions API Service Agent`",
|
|
43
|
-
});
|
|
39
|
+
const fix = await (0, prompt_1.confirm)("Would you like to fix the issue by updating IAM policy to include Firebase " +
|
|
40
|
+
"Extensions Service Agent with role `Firebase Extensions API Service Agent`");
|
|
44
41
|
if (fix) {
|
|
45
42
|
policy.bindings.push({
|
|
46
43
|
role: SERVICE_AGENT_ROLE,
|
|
@@ -91,6 +91,10 @@ function functionResourceToEmulatedTriggerDefintion(resource, systemParams = {})
|
|
|
91
91
|
eventFilterPathPatterns[filter.attribute] = filter.value;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
if (properties.eventTrigger.eventType.includes("google.cloud.firestore")) {
|
|
95
|
+
eventFilters["database"] = eventFilters["database"] ?? "(default)";
|
|
96
|
+
eventFilters["namespace"] = eventFilters["namespace"] ?? "(default)";
|
|
97
|
+
}
|
|
94
98
|
etd.eventTrigger.eventFilters = eventFilters;
|
|
95
99
|
etd.eventTrigger.eventFilterPathPatterns = eventFilterPathPatterns;
|
|
96
100
|
}
|
|
@@ -26,9 +26,9 @@ const storage_1 = require("../gcp/storage");
|
|
|
26
26
|
const projectUtils_1 = require("../projectUtils");
|
|
27
27
|
const extensionsApi_1 = require("./extensionsApi");
|
|
28
28
|
const publisherApi_1 = require("./publisherApi");
|
|
29
|
+
const prompt_1 = require("../prompt");
|
|
29
30
|
const refs = require("./refs");
|
|
30
31
|
const localHelper_1 = require("./localHelper");
|
|
31
|
-
const prompt_1 = require("../prompt");
|
|
32
32
|
const logger_1 = require("../logger");
|
|
33
33
|
const utils_2 = require("../utils");
|
|
34
34
|
const change_log_1 = require("./change-log");
|
|
@@ -283,8 +283,7 @@ async function promptForValidInstanceId(instanceId) {
|
|
|
283
283
|
let newInstanceId = "";
|
|
284
284
|
const instanceIdRegex = /^[a-z][a-z\d\-]*[a-z\d]$/;
|
|
285
285
|
while (!instanceIdIsValid) {
|
|
286
|
-
newInstanceId = await (0, prompt_1.
|
|
287
|
-
type: "input",
|
|
286
|
+
newInstanceId = await (0, prompt_1.input)({
|
|
288
287
|
default: instanceId,
|
|
289
288
|
message: `Please enter a new name for this instance:`,
|
|
290
289
|
});
|
|
@@ -306,10 +305,7 @@ async function promptForValidRepoURI() {
|
|
|
306
305
|
let repoIsValid = false;
|
|
307
306
|
let extensionRoot = "";
|
|
308
307
|
while (!repoIsValid) {
|
|
309
|
-
extensionRoot = await (0, prompt_1.
|
|
310
|
-
type: "input",
|
|
311
|
-
message: "Enter the GitHub repo URI where this extension's source code is located:",
|
|
312
|
-
});
|
|
308
|
+
extensionRoot = await (0, prompt_1.input)("Enter the GitHub repo URI where this extension's source code is located:");
|
|
313
309
|
if (!repoRegex.test(extensionRoot)) {
|
|
314
310
|
logger_1.logger.info("Repo URI must follow this format: https://github.com/<user>/<repo>");
|
|
315
311
|
}
|
|
@@ -321,8 +317,7 @@ async function promptForValidRepoURI() {
|
|
|
321
317
|
}
|
|
322
318
|
exports.promptForValidRepoURI = promptForValidRepoURI;
|
|
323
319
|
async function promptForExtensionRoot(defaultRoot) {
|
|
324
|
-
return await (0, prompt_1.
|
|
325
|
-
type: "input",
|
|
320
|
+
return await (0, prompt_1.input)({
|
|
326
321
|
message: "Enter this extension's root directory in the repo (defaults to previous root if set):",
|
|
327
322
|
default: defaultRoot,
|
|
328
323
|
});
|
|
@@ -343,22 +338,20 @@ async function promptForReleaseStage(args) {
|
|
|
343
338
|
};
|
|
344
339
|
choices.push(stableChoice);
|
|
345
340
|
}
|
|
346
|
-
stage = await (0, prompt_1.
|
|
347
|
-
type: "list",
|
|
341
|
+
stage = await (0, prompt_1.select)({
|
|
348
342
|
message: "Choose the release stage:",
|
|
349
343
|
choices: choices,
|
|
350
344
|
default: stage,
|
|
351
345
|
});
|
|
352
346
|
if (stage === "stable" && !args.hasVersions) {
|
|
353
|
-
logger_1.logger.info(`${clc.bold(clc.yellow("Warning:"))} It's highly recommended to first upload a pre-release version before choosing stable.`);
|
|
354
347
|
const confirmed = await (0, prompt_1.confirm)({
|
|
348
|
+
message: `${clc.bold(clc.yellow("Warning:"))} It's highly recommended to first upload a pre-release version before choosing stable.`,
|
|
355
349
|
nonInteractive: args.nonInteractive,
|
|
356
350
|
force: args.force,
|
|
357
351
|
default: false,
|
|
358
352
|
});
|
|
359
353
|
if (!confirmed) {
|
|
360
|
-
stage = await (0, prompt_1.
|
|
361
|
-
type: "list",
|
|
354
|
+
stage = await (0, prompt_1.select)({
|
|
362
355
|
message: "Choose the release stage:",
|
|
363
356
|
choices: choices,
|
|
364
357
|
default: stage,
|
|
@@ -577,8 +570,7 @@ async function uploadExtensionVersionFromGitHubSource(args) {
|
|
|
577
570
|
const defaultSourceRef = "HEAD";
|
|
578
571
|
if (!sourceRef) {
|
|
579
572
|
if (!args.nonInteractive) {
|
|
580
|
-
sourceRef = await (0, prompt_1.
|
|
581
|
-
type: "input",
|
|
573
|
+
sourceRef = await (0, prompt_1.input)({
|
|
582
574
|
message: "Enter the commit hash, branch, or tag name to build from in the repo:",
|
|
583
575
|
default: defaultSourceRef,
|
|
584
576
|
});
|
|
@@ -617,6 +609,7 @@ async function uploadExtensionVersionFromGitHubSource(args) {
|
|
|
617
609
|
autoReview: stage === "stable" && autoReview,
|
|
618
610
|
});
|
|
619
611
|
const confirmed = await (0, prompt_1.confirm)({
|
|
612
|
+
message: "Continue?",
|
|
620
613
|
nonInteractive: args.nonInteractive,
|
|
621
614
|
force: args.force,
|
|
622
615
|
default: false,
|
|
@@ -685,6 +678,7 @@ async function uploadExtensionVersionFromLocalSource(args) {
|
|
|
685
678
|
const releaseNotes = validateReleaseNotes(args.rootDirectory, extensionSpec.version, extension);
|
|
686
679
|
displayReleaseNotes({ extensionRef, newVersion, releaseNotes, autoReview: false });
|
|
687
680
|
const confirmed = await (0, prompt_1.confirm)({
|
|
681
|
+
message: "Continue?",
|
|
688
682
|
nonInteractive: args.nonInteractive,
|
|
689
683
|
force: args.force,
|
|
690
684
|
default: false,
|
|
@@ -790,9 +784,7 @@ function displayReleaseNotes(args) {
|
|
|
790
784
|
exports.displayReleaseNotes = displayReleaseNotes;
|
|
791
785
|
async function promptForOfficialExtension(message) {
|
|
792
786
|
const officialExts = await (0, resolveSource_1.getExtensionRegistry)(true);
|
|
793
|
-
return await (0, prompt_1.
|
|
794
|
-
name: "input",
|
|
795
|
-
type: "list",
|
|
787
|
+
return await (0, prompt_1.select)({
|
|
796
788
|
message,
|
|
797
789
|
choices: (0, utils_1.convertOfficialExtensionsToList)(officialExts),
|
|
798
790
|
pageSize: Object.keys(officialExts).length,
|
|
@@ -801,15 +793,13 @@ async function promptForOfficialExtension(message) {
|
|
|
801
793
|
exports.promptForOfficialExtension = promptForOfficialExtension;
|
|
802
794
|
async function promptForRepeatInstance(projectName, extensionName) {
|
|
803
795
|
const message = `An extension with the ID '${clc.bold(extensionName)}' already exists in the project '${clc.bold(projectName)}'. What would you like to do?`;
|
|
804
|
-
|
|
805
|
-
{ name: "Update or reconfigure the existing instance", value: "updateExisting" },
|
|
806
|
-
{ name: "Install a new instance with a different ID", value: "installNew" },
|
|
807
|
-
{ name: "Cancel extension installation", value: "cancel" },
|
|
808
|
-
];
|
|
809
|
-
return await (0, prompt_1.promptOnce)({
|
|
810
|
-
type: "list",
|
|
796
|
+
return await (0, prompt_1.select)({
|
|
811
797
|
message,
|
|
812
|
-
choices
|
|
798
|
+
choices: [
|
|
799
|
+
{ name: "Update or reconfigure the existing instance", value: "updateExisting" },
|
|
800
|
+
{ name: "Install a new instance with a different ID", value: "installNew" },
|
|
801
|
+
{ name: "Cancel extension installation", value: "cancel" },
|
|
802
|
+
],
|
|
813
803
|
});
|
|
814
804
|
}
|
|
815
805
|
exports.promptForRepeatInstance = promptForRepeatInstance;
|
|
@@ -840,10 +830,14 @@ function isUrlPath(extInstallPath) {
|
|
|
840
830
|
exports.isUrlPath = isUrlPath;
|
|
841
831
|
function isLocalPath(extInstallPath) {
|
|
842
832
|
const trimmedPath = extInstallPath.trim();
|
|
843
|
-
return (trimmedPath.startsWith(
|
|
844
|
-
trimmedPath.startsWith(
|
|
845
|
-
trimmedPath.startsWith(
|
|
846
|
-
trimmedPath.startsWith(
|
|
833
|
+
return (trimmedPath.startsWith(`~${path.sep}`) ||
|
|
834
|
+
trimmedPath.startsWith(`.${path.sep}`) ||
|
|
835
|
+
trimmedPath.startsWith(`..${path.sep}`) ||
|
|
836
|
+
trimmedPath.startsWith(`${path.sep}`) ||
|
|
837
|
+
trimmedPath.startsWith(`~/`) ||
|
|
838
|
+
trimmedPath.startsWith(`./`) ||
|
|
839
|
+
trimmedPath.startsWith(`../`) ||
|
|
840
|
+
trimmedPath.startsWith(`/`) ||
|
|
847
841
|
[".", ".."].includes(trimmedPath));
|
|
848
842
|
}
|
|
849
843
|
exports.isLocalPath = isLocalPath;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listExtensions = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const extensionsApi_1 = require("./extensionsApi");
|
|
7
7
|
const logger_1 = require("../logger");
|
|
8
8
|
const utils_1 = require("../utils");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readInstanceParam = exports.writeExtensionsToFirebaseJson = exports.getInstanceRef = exports.getInstanceTarget = exports.instanceExists = exports.loadConfig = exports.removeFromManifest = exports.writeLocalSecrets = exports.writeEmptyManifest = exports.writeToManifest = exports.ENV_DIRECTORY = void 0;
|
|
4
|
-
const clc = require("colorette");
|
|
5
4
|
const path = require("path");
|
|
6
5
|
const fs = require("fs-extra");
|
|
7
6
|
const refs = require("./refs");
|
|
@@ -11,7 +10,6 @@ const logger_1 = require("../logger");
|
|
|
11
10
|
const prompt_1 = require("../prompt");
|
|
12
11
|
const paramHelper_1 = require("./paramHelper");
|
|
13
12
|
const error_1 = require("../error");
|
|
14
|
-
const utils = require("../utils");
|
|
15
13
|
const extensionsHelper_1 = require("./extensionsHelper");
|
|
16
14
|
const types_1 = require("./types");
|
|
17
15
|
exports.ENV_DIRECTORY = "extensions";
|
|
@@ -24,8 +22,7 @@ async function writeToManifest(specs, config, options, allowOverwrite = false) {
|
|
|
24
22
|
.map((i) => `${i[0]}: ${i[1]}`)
|
|
25
23
|
.join("\n\t");
|
|
26
24
|
if (allowOverwrite) {
|
|
27
|
-
const overwrite = await (0, prompt_1.
|
|
28
|
-
type: "list",
|
|
25
|
+
const overwrite = await (0, prompt_1.select)({
|
|
29
26
|
message: `firebase.json already contains extensions:\n${currentExtensions}\nWould you like to overwrite or merge?`,
|
|
30
27
|
choices: [
|
|
31
28
|
{ name: "Overwrite", value: true },
|
|
@@ -52,8 +49,8 @@ async function writeEmptyManifest(config, options) {
|
|
|
52
49
|
.join("\n\t");
|
|
53
50
|
if (!(await (0, prompt_1.confirm)({
|
|
54
51
|
message: `firebase.json already contains extensions:\n${currentExtensions}\nWould you like to overwrite them?`,
|
|
55
|
-
nonInteractive: options
|
|
56
|
-
force: options
|
|
52
|
+
nonInteractive: options?.nonInteractive,
|
|
53
|
+
force: options?.force,
|
|
57
54
|
default: false,
|
|
58
55
|
}))) {
|
|
59
56
|
return;
|
|
@@ -152,7 +149,6 @@ function writeExtensionsToFirebaseJson(specs, config) {
|
|
|
152
149
|
}
|
|
153
150
|
config.set("extensions", extensions);
|
|
154
151
|
config.writeProjectFile("firebase.json", config.src);
|
|
155
|
-
utils.logSuccess("Wrote extensions to " + clc.bold("firebase.json") + "...");
|
|
156
152
|
}
|
|
157
153
|
exports.writeExtensionsToFirebaseJson = writeExtensionsToFirebaseJson;
|
|
158
154
|
async function writeEnvFiles(specs, config, force) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSystemParam = exports.readEnvFile = exports.promptForNewParams = exports.getParamsForUpdate = exports.getParams = exports.setNewDefaults = exports.buildBindingOptionsWithBaseValue = exports.getBaseParamBindings = void 0;
|
|
3
|
+
exports.populateDefaultParams = exports.isSystemParam = exports.readEnvFile = exports.promptForNewParams = exports.getParamsForUpdate = exports.getParams = exports.setNewDefaults = exports.buildBindingOptionsWithBaseValue = exports.getBaseParamBindings = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const clc = require("colorette");
|
|
6
6
|
const fs = require("fs-extra");
|
|
@@ -39,7 +39,8 @@ function setNewDefaults(params, newDefaults) {
|
|
|
39
39
|
if (newDefaults[param.param]) {
|
|
40
40
|
param.default = newDefaults[param.param];
|
|
41
41
|
}
|
|
42
|
-
else if (
|
|
42
|
+
else if (param.param === `firebaseextensions.v1beta.function/location` &&
|
|
43
|
+
newDefaults["LOCATION"]) {
|
|
43
44
|
param.default = newDefaults["LOCATION"];
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -143,3 +144,11 @@ function isSystemParam(paramName) {
|
|
|
143
144
|
return regex.test(paramName);
|
|
144
145
|
}
|
|
145
146
|
exports.isSystemParam = isSystemParam;
|
|
147
|
+
function populateDefaultParams(params, spec) {
|
|
148
|
+
const ret = { ...params };
|
|
149
|
+
for (const p of spec.params) {
|
|
150
|
+
ret[p.param] = ret[p.param] ?? p.default;
|
|
151
|
+
}
|
|
152
|
+
return ret;
|
|
153
|
+
}
|
|
154
|
+
exports.populateDefaultParams = populateDefaultParams;
|
|
@@ -94,7 +94,7 @@ async function isStorageProvisioned(projectId) {
|
|
|
94
94
|
return !!resp.body?.buckets?.find((bucket) => {
|
|
95
95
|
const bucketResourceName = bucket.name;
|
|
96
96
|
const bucketResourceNameTokens = bucketResourceName.split("/");
|
|
97
|
-
const pattern = "^" + projectId + "(.[[a-z0-9]+)*.appspot.com$";
|
|
97
|
+
const pattern = "^" + projectId + "(.[[a-z0-9]+)*.(appspot.com|firebasestorage.app)$";
|
|
98
98
|
return new RegExp(pattern).test(bucketResourceNameTokens[bucketResourceNameTokens.length - 1]);
|
|
99
99
|
});
|
|
100
100
|
}
|
package/lib/extensions/tos.js
CHANGED
|
@@ -50,8 +50,9 @@ async function acceptLatestPublisherTOS(options, projectId) {
|
|
|
50
50
|
const tosLink = extensionsTosUrl("publisher");
|
|
51
51
|
logger_1.logger.info(`To continue, you must accept the Firebase Extensions Publisher Terms of Service: ${tosLink}`);
|
|
52
52
|
if (await (0, prompt_1.confirm)({
|
|
53
|
-
...options,
|
|
54
53
|
message: "Do you accept the Firebase Extensions Publisher Terms of Service?",
|
|
54
|
+
nonInteractive: options.nonInteractive,
|
|
55
|
+
force: options.force,
|
|
55
56
|
})) {
|
|
56
57
|
return acceptPublisherTOS(projectId, currentAcceptance.latestTosVersion);
|
|
57
58
|
}
|
|
@@ -73,8 +74,9 @@ async function acceptLatestAppDeveloperTOS(options, projectId, instanceIds) {
|
|
|
73
74
|
logger_1.logger.debug(`User Terms of Service aready accepted on project ${projectId}.`);
|
|
74
75
|
}
|
|
75
76
|
else if (!(await (0, prompt_1.confirm)({
|
|
76
|
-
...options,
|
|
77
77
|
message: "Do you accept the Firebase Extensions User Terms of Service?",
|
|
78
|
+
nonInteractive: options.nonInteractive,
|
|
79
|
+
force: options.force,
|
|
78
80
|
}))) {
|
|
79
81
|
throw new error_1.FirebaseError("You must accept the terms of service to continue.");
|
|
80
82
|
}
|
package/lib/extensions/utils.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getResourceRuntime = exports.formatTimestamp = exports.getRandomString = exports.convertOfficialExtensionsToList = exports.convertExtensionOptionToLabeledList =
|
|
4
|
-
const prompt_1 = require("../prompt");
|
|
3
|
+
exports.getResourceRuntime = exports.formatTimestamp = exports.getRandomString = exports.convertOfficialExtensionsToList = exports.convertExtensionOptionToLabeledList = void 0;
|
|
5
4
|
const types_1 = require("./types");
|
|
6
|
-
async function onceWithJoin(question) {
|
|
7
|
-
const response = await (0, prompt_1.promptOnce)(question);
|
|
8
|
-
if (Array.isArray(response)) {
|
|
9
|
-
return response.join(",");
|
|
10
|
-
}
|
|
11
|
-
return response;
|
|
12
|
-
}
|
|
13
|
-
exports.onceWithJoin = onceWithJoin;
|
|
14
5
|
function convertExtensionOptionToLabeledList(options) {
|
|
15
6
|
return options.map((option) => {
|
|
16
7
|
return {
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getErrorMessage = exports.getValidator = void 0;
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const ajv_1 = require("ajv");
|
|
7
|
+
const ajv_formats_1 = require("ajv-formats");
|
|
8
|
+
const ajv = new ajv_1.Ajv({ allowUnionTypes: true });
|
|
9
|
+
(0, ajv_formats_1.default)(ajv);
|
|
8
10
|
let _VALIDATOR = undefined;
|
|
9
11
|
function getValidator() {
|
|
10
12
|
if (!_VALIDATOR) {
|
|
@@ -17,13 +19,13 @@ function getValidator() {
|
|
|
17
19
|
exports.getValidator = getValidator;
|
|
18
20
|
function getErrorMessage(e) {
|
|
19
21
|
if (e.keyword === "additionalProperties") {
|
|
20
|
-
return `Object "${e.
|
|
22
|
+
return `Object "${e.instancePath}" in "firebase.json" has unknown property: ${JSON.stringify(e.params)}`;
|
|
21
23
|
}
|
|
22
24
|
else if (e.keyword === "required") {
|
|
23
|
-
return `Object "${e.
|
|
25
|
+
return `Object "${e.instancePath}" in "firebase.json" is missing required property: ${JSON.stringify(e.params)}`;
|
|
24
26
|
}
|
|
25
27
|
else {
|
|
26
|
-
return `Field "${e.
|
|
28
|
+
return `Field "${e.instancePath}" in "firebase.json" is possibly invalid: ${e.message}`;
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
exports.getErrorMessage = getErrorMessage;
|
package/lib/firestore/delete.js
CHANGED
|
@@ -18,6 +18,7 @@ class FirestoreDelete {
|
|
|
18
18
|
this.shallow = Boolean(options.shallow);
|
|
19
19
|
this.allCollections = Boolean(options.allCollections);
|
|
20
20
|
this.databaseId = options.databaseId;
|
|
21
|
+
this.urlPrefix = options.urlPrefix ?? (0, api_1.firestoreOriginOrEmulator)();
|
|
21
22
|
this.readBatchSize = 7500;
|
|
22
23
|
this.maxPendingDeletes = 15;
|
|
23
24
|
this.deleteBatchSize = 250;
|
|
@@ -41,7 +42,7 @@ class FirestoreDelete {
|
|
|
41
42
|
this.apiClient = new apiv2.Client({
|
|
42
43
|
auth: true,
|
|
43
44
|
apiVersion: "v1",
|
|
44
|
-
urlPrefix:
|
|
45
|
+
urlPrefix: this.urlPrefix,
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
setDeleteBatchSize(size) {
|
|
@@ -219,7 +220,7 @@ class FirestoreDelete {
|
|
|
219
220
|
}
|
|
220
221
|
numPendingDeletes++;
|
|
221
222
|
firestore
|
|
222
|
-
.deleteDocuments(this.project, toDelete,
|
|
223
|
+
.deleteDocuments(this.project, toDelete, this.databaseId, this.urlPrefix)
|
|
223
224
|
.then((numDeleted) => {
|
|
224
225
|
FirestoreDelete.progressBar.tick(numDeleted);
|
|
225
226
|
numDocsDeleted += numDeleted;
|
|
@@ -291,7 +292,7 @@ class FirestoreDelete {
|
|
|
291
292
|
let initialDelete;
|
|
292
293
|
if (this.isDocumentPath) {
|
|
293
294
|
const doc = { name: this.root + "/" + this.path };
|
|
294
|
-
initialDelete = firestore.deleteDocument(doc,
|
|
295
|
+
initialDelete = firestore.deleteDocument(doc, this.urlPrefix).catch((err) => {
|
|
295
296
|
logger_1.logger.debug("deletePath:initialDelete:error", err);
|
|
296
297
|
if (this.allDescendants) {
|
|
297
298
|
return Promise.resolve();
|
|
@@ -308,7 +309,7 @@ class FirestoreDelete {
|
|
|
308
309
|
}
|
|
309
310
|
deleteDatabase() {
|
|
310
311
|
return firestore
|
|
311
|
-
.listCollectionIds(this.project,
|
|
312
|
+
.listCollectionIds(this.project, this.databaseId, this.urlPrefix)
|
|
312
313
|
.catch((err) => {
|
|
313
314
|
logger_1.logger.debug("deleteDatabase:listCollectionIds:error", err);
|
|
314
315
|
return utils.reject("Unable to list collection IDs");
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PrettyPrint = void 0;
|
|
4
4
|
const clc = require("colorette");
|
|
5
|
-
const Table = require("cli-
|
|
5
|
+
const Table = require("cli-table3");
|
|
6
6
|
const sort = require("./api-sort");
|
|
7
7
|
const types = require("./api-types");
|
|
8
8
|
const logger_1 = require("../logger");
|
|
@@ -15,7 +15,7 @@ exports.support = "preview";
|
|
|
15
15
|
exports.type = 3;
|
|
16
16
|
exports.docsUrl = "https://firebase.google.com/docs/hosting/frameworks/angular";
|
|
17
17
|
const DEFAULT_BUILD_SCRIPT = ["ng build"];
|
|
18
|
-
exports.supportedRange = "16 -
|
|
18
|
+
exports.supportedRange = "16 - 20";
|
|
19
19
|
async function discover(dir) {
|
|
20
20
|
if (!(await (0, fs_extra_1.pathExists)((0, path_1.join)(dir, "package.json"))))
|
|
21
21
|
return;
|
|
@@ -181,17 +181,22 @@ exports.handle = function(req,res) {
|
|
|
181
181
|
}
|
|
182
182
|
else if (serverOutputPath) {
|
|
183
183
|
bootstrapScript = `
|
|
184
|
-
const app = new Promise((resolve) => {
|
|
184
|
+
const app = new Promise((resolve, reject) => {
|
|
185
185
|
setTimeout(() => {
|
|
186
186
|
const port = process.env.PORT;
|
|
187
187
|
const socket = 'express.sock';
|
|
188
188
|
process.env.PORT = socket;
|
|
189
|
-
|
|
189
|
+
|
|
190
190
|
${serverEntry?.endsWith(".mjs")
|
|
191
191
|
? `import(\`./${serverOutputPath}/${serverEntry}\`)`
|
|
192
|
-
: `Promise.resolve(require('./${serverOutputPath}/${serverEntry}'))`}.then(({ app }) => {
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
: `Promise.resolve(require('./${serverOutputPath}/${serverEntry}'))`}.then(({ default: defHandler, reqHandler, app }) => {
|
|
193
|
+
const handler = app?.() ?? reqHandler ?? defHandler;
|
|
194
|
+
if (!handler) {
|
|
195
|
+
reject(\`The file at "./${serverOutputPath}/${serverEntry}" did not export a valid request handler. Expected exports: 'app', 'default', or 'reqHandler'.\`);
|
|
196
|
+
} else {
|
|
197
|
+
process.env.PORT = port;
|
|
198
|
+
resolve(handler);
|
|
199
|
+
}
|
|
195
200
|
});
|
|
196
201
|
}, 0);
|
|
197
202
|
});
|