firebase-tools 15.1.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/accountExporter.js +3 -5
- package/lib/accountImporter.js +4 -5
- package/lib/api.js +3 -3
- package/lib/apiv2.js +9 -13
- package/lib/appUtils.js +19 -21
- package/lib/appdistribution/client.js +4 -8
- package/lib/appdistribution/distribution.js +4 -4
- package/lib/appdistribution/options-parser-util.js +8 -9
- package/lib/appdistribution/types.js +2 -2
- package/lib/appdistribution/yaml_helper.js +33 -17
- package/lib/apphosting/app.js +8 -13
- package/lib/apphosting/backend.js +34 -24
- package/lib/apphosting/config.js +14 -14
- package/lib/apphosting/githubConnections.js +38 -35
- package/lib/apphosting/localbuilds.js +4 -6
- package/lib/apphosting/repo.js +24 -20
- package/lib/apphosting/rollout.js +12 -5
- package/lib/apphosting/secrets/dialogs.js +9 -9
- package/lib/apphosting/secrets/index.js +9 -11
- package/lib/apphosting/utils.js +2 -3
- package/lib/apphosting/yaml.js +12 -11
- package/lib/apptesting/ensureProjectConfigured.js +1 -2
- package/lib/apptesting/invokeTests.js +2 -3
- package/lib/apptesting/parseTestFiles.js +5 -6
- package/lib/apptesting/types.js +2 -2
- package/lib/archiveDirectory.js +1 -2
- package/lib/auth.js +36 -40
- package/lib/bin/cli.js +2 -3
- package/lib/bin/mcp.js +1 -2
- package/lib/checkMinRequiredVersion.js +1 -2
- package/lib/checkValidTargetFilters.js +1 -2
- package/lib/command.js +6 -9
- package/lib/commands/appdistribution-testers-list.js +2 -3
- package/lib/commands/apphosting-backends-list.js +4 -6
- package/lib/commands/apphosting-builds-create.js +2 -3
- package/lib/commands/apphosting-builds-get.js +1 -2
- package/lib/commands/apphosting-rollouts-list.js +1 -2
- package/lib/commands/apps-init.js +1 -1
- package/lib/commands/{apptesting-execute.js → apptesting-wata.js} +3 -4
- package/lib/commands/crashlytics-symbols-upload.js +2 -2
- package/lib/commands/dataconnect-execute.js +4 -4
- package/lib/commands/dataconnect-sdk-generate.js +5 -6
- package/lib/commands/dataconnect-services-list.js +7 -8
- package/lib/commands/dataconnect-sql-diff.js +1 -2
- package/lib/commands/dataconnect-sql-migrate.js +4 -3
- package/lib/commands/dataconnect-sql-setup.js +2 -2
- package/lib/commands/dataconnect-sql-shell.js +5 -1
- package/lib/commands/emulators-start.js +1 -2
- package/lib/commands/ext-configure.js +6 -4
- package/lib/commands/ext-dev-list.js +2 -3
- package/lib/commands/ext-dev-upload.js +2 -2
- package/lib/commands/ext-export.js +1 -1
- package/lib/commands/ext-info.js +2 -3
- package/lib/commands/ext-install.js +5 -7
- package/lib/commands/firestore-backups-list.js +1 -2
- package/lib/commands/firestore-backups-schedules-list.js +1 -2
- package/lib/commands/firestore-indexes-list.js +1 -2
- package/lib/commands/firestore-utils.js +1 -2
- package/lib/commands/functions-artifacts-setpolicy.js +1 -2
- package/lib/commands/functions-config-export.js +2 -3
- package/lib/commands/hosting-channel-deploy.js +2 -2
- package/lib/commands/hosting-clone.js +2 -3
- package/lib/commands/hosting-sites-create.js +1 -1
- package/lib/commands/index.js +2 -3
- package/lib/commands/init.js +4 -5
- package/lib/commands/internaltesting-functions-discover.js +1 -1
- package/lib/commands/login.js +4 -5
- package/lib/commands/logout.js +3 -3
- package/lib/commands/projects-create.js +1 -1
- package/lib/commands/remoteconfig-experiments-list.js +2 -3
- package/lib/commands/remoteconfig-get.js +1 -1
- package/lib/commands/remoteconfig-rollback.js +1 -2
- package/lib/commands/remoteconfig-rollouts-list.js +2 -3
- package/lib/commands/remoteconfig-versions-list.js +3 -4
- package/lib/commands/use.js +3 -3
- package/lib/config.js +4 -5
- package/lib/crashlytics/buildToolsJarHelper.js +3 -5
- package/lib/crashlytics/events.js +4 -7
- package/lib/crashlytics/filters.js +10 -12
- package/lib/crashlytics/issues.js +2 -3
- package/lib/crashlytics/notes.js +3 -4
- package/lib/crashlytics/reports.js +21 -15
- package/lib/crashlytics/types.js +7 -7
- package/lib/crashlytics/utils.js +4 -4
- package/lib/database/api.js +2 -3
- package/lib/database/import.js +4 -4
- package/lib/database/metadata.js +5 -6
- package/lib/database/rulesConfig.js +2 -3
- package/lib/dataconnect/build.js +10 -13
- package/lib/dataconnect/checkIam.js +1 -2
- package/lib/dataconnect/client.js +15 -18
- package/lib/dataconnect/dataplaneClient.js +6 -6
- package/lib/dataconnect/ensureApis.js +2 -3
- package/lib/dataconnect/errors.js +8 -11
- package/lib/dataconnect/filters.js +2 -3
- package/lib/dataconnect/freeTrial.js +3 -4
- package/lib/dataconnect/graphqlError.js +5 -8
- package/lib/dataconnect/load.js +10 -11
- package/lib/dataconnect/names.js +14 -18
- package/lib/dataconnect/prompts.js +1 -2
- package/lib/dataconnect/provisionCloudSql.js +13 -17
- package/lib/dataconnect/schemaMigration.js +60 -27
- package/lib/dataconnect/types.js +10 -12
- package/lib/dataconnect/webhook.js +3 -3
- package/lib/defaultCredentials.js +3 -4
- package/lib/deploy/apphosting/deploy.js +2 -3
- package/lib/deploy/apphosting/prepare.js +3 -5
- package/lib/deploy/apphosting/release.js +1 -1
- package/lib/deploy/apphosting/util.js +1 -2
- package/lib/deploy/database/deploy.js +1 -2
- package/lib/deploy/database/prepare.js +1 -2
- package/lib/deploy/database/release.js +1 -2
- package/lib/deploy/dataconnect/context.js +15 -4
- package/lib/deploy/dataconnect/deploy.js +5 -6
- package/lib/deploy/dataconnect/prepare.js +7 -9
- package/lib/deploy/dataconnect/release.js +7 -10
- package/lib/deploy/extensions/deploy.js +7 -9
- package/lib/deploy/extensions/deploymentSummary.js +6 -7
- package/lib/deploy/extensions/planner.js +15 -18
- package/lib/deploy/extensions/prepare.js +9 -11
- package/lib/deploy/extensions/release.js +10 -12
- package/lib/deploy/extensions/secrets.js +8 -11
- package/lib/deploy/extensions/tasks.js +6 -8
- package/lib/deploy/extensions/v2FunctionHelper.js +2 -3
- package/lib/deploy/extensions/validate.js +1 -2
- package/lib/deploy/firestore/deploy.js +3 -5
- package/lib/deploy/firestore/prepare.js +2 -3
- package/lib/deploy/firestore/release.js +3 -4
- package/lib/deploy/functions/backend.js +52 -42
- package/lib/deploy/functions/build.js +41 -15
- package/lib/deploy/functions/cache/applyHash.js +3 -5
- package/lib/deploy/functions/cache/hash.js +4 -5
- package/lib/deploy/functions/cel.js +3 -3
- package/lib/deploy/functions/checkIam.js +8 -8
- package/lib/deploy/functions/containerCleaner.js +10 -6
- package/lib/deploy/functions/deploy.js +6 -8
- package/lib/deploy/functions/ensure.js +6 -9
- package/lib/deploy/functions/functionsDeployHelper.js +10 -11
- package/lib/deploy/functions/params.js +10 -10
- package/lib/deploy/functions/prepare.js +41 -36
- package/lib/deploy/functions/prepareFunctionsUpload.js +24 -10
- package/lib/deploy/functions/pricing.js +3 -3
- package/lib/deploy/functions/prompts.js +7 -10
- package/lib/deploy/functions/release/executor.js +5 -6
- package/lib/deploy/functions/release/fabricator.js +76 -29
- package/lib/deploy/functions/release/index.js +23 -14
- package/lib/deploy/functions/release/planner.js +15 -14
- package/lib/deploy/functions/release/reporter.js +20 -20
- package/lib/deploy/functions/release/sourceTokenScraper.js +4 -5
- package/lib/deploy/functions/remoteSource.js +3 -4
- package/lib/deploy/functions/runtimes/discovery/index.js +9 -12
- package/lib/deploy/functions/runtimes/discovery/parsing.js +2 -3
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +29 -10
- package/lib/deploy/functions/runtimes/index.js +1 -2
- package/lib/deploy/functions/runtimes/node/index.js +18 -9
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +2 -2
- package/lib/deploy/functions/runtimes/node/validate.js +1 -2
- package/lib/deploy/functions/runtimes/node/versioning.js +6 -7
- package/lib/deploy/functions/runtimes/python/index.js +12 -12
- package/lib/deploy/functions/runtimes/supported/index.js +5 -6
- package/lib/deploy/functions/services/auth.js +49 -36
- package/lib/deploy/functions/services/database.js +1 -2
- package/lib/deploy/functions/services/dataconnect.js +16 -2
- package/lib/deploy/functions/services/firebaseAlerts.js +1 -2
- package/lib/deploy/functions/services/firestore.js +3 -5
- package/lib/deploy/functions/services/index.js +2 -2
- package/lib/deploy/functions/services/remoteConfig.js +1 -2
- package/lib/deploy/functions/services/storage.js +3 -5
- package/lib/deploy/functions/services/testLab.js +1 -2
- package/lib/deploy/functions/triggerRegionHelper.js +1 -2
- package/lib/deploy/functions/validate.js +12 -11
- package/lib/deploy/hosting/convertConfig.js +38 -22
- package/lib/deploy/hosting/deploy.js +4 -7
- package/lib/deploy/hosting/hashcache.js +2 -3
- package/lib/deploy/hosting/prepare.js +14 -14
- package/lib/deploy/hosting/release.js +1 -2
- package/lib/deploy/index.js +7 -8
- package/lib/deploy/lifecycleHooks.js +3 -5
- package/lib/deploy/remoteconfig/deploy.js +1 -1
- package/lib/deploy/remoteconfig/functions.js +5 -6
- package/lib/deploy/remoteconfig/prepare.js +2 -3
- package/lib/deploy/remoteconfig/release.js +2 -2
- package/lib/deploy/storage/deploy.js +1 -1
- package/lib/deploy/storage/prepare.js +1 -1
- package/lib/deploy/storage/release.js +1 -1
- package/lib/deploymentTool.js +5 -6
- package/lib/detectProjectRoot.js +1 -2
- package/lib/downloadUtils.js +2 -3
- package/lib/emulator/adminSdkConfig.js +2 -3
- package/lib/emulator/apphosting/config.js +1 -2
- package/lib/emulator/apphosting/developmentServer.js +3 -3
- package/lib/emulator/apphosting/serve.js +20 -14
- package/lib/emulator/auth/cloudFunctions.js +2 -3
- package/lib/emulator/auth/errors.js +2 -2
- package/lib/emulator/auth/handlers.js +3 -4
- package/lib/emulator/auth/index.js +6 -6
- package/lib/emulator/auth/operations.js +171 -129
- package/lib/emulator/auth/server.js +30 -22
- package/lib/emulator/auth/state.js +26 -36
- package/lib/emulator/auth/utils.js +12 -13
- package/lib/emulator/commandUtils.js +20 -20
- package/lib/emulator/controller.js +32 -29
- package/lib/emulator/databaseEmulator.js +1 -2
- package/lib/emulator/dataconnect/pgliteServer.js +48 -104
- package/lib/emulator/dataconnectEmulator.js +6 -9
- package/lib/emulator/download.js +2 -3
- package/lib/emulator/downloadableEmulatorInfo.json +7 -7
- package/lib/emulator/downloadableEmulators.js +49 -24
- package/lib/emulator/emulatorLogger.js +19 -4
- package/lib/emulator/env.js +6 -8
- package/lib/emulator/eventarcEmulator.js +2 -3
- package/lib/emulator/eventarcEmulatorUtils.js +3 -6
- package/lib/emulator/extensions/postinstall.js +1 -2
- package/lib/emulator/extensions/validation.js +4 -7
- package/lib/emulator/extensionsEmulator.js +6 -9
- package/lib/emulator/functionsEmulator.js +89 -46
- package/lib/emulator/functionsEmulatorRuntime.js +1 -1
- package/lib/emulator/functionsEmulatorShared.js +30 -30
- package/lib/emulator/functionsEmulatorShell.js +4 -6
- package/lib/emulator/functionsEmulatorUtils.js +8 -9
- package/lib/emulator/functionsRuntimeWorker.js +18 -9
- package/lib/emulator/hub.js +41 -34
- package/lib/emulator/hubClient.js +1 -1
- package/lib/emulator/initEmulators.js +2 -3
- package/lib/emulator/loggingEmulator.js +2 -2
- package/lib/emulator/portUtils.js +4 -5
- package/lib/emulator/registry.js +10 -4
- package/lib/emulator/shared/request.js +1 -2
- package/lib/emulator/storage/apis/firebase.js +16 -20
- package/lib/emulator/storage/apis/gcloud.js +6 -9
- package/lib/emulator/storage/apis/shared.js +1 -2
- package/lib/emulator/storage/crc.js +2 -3
- package/lib/emulator/storage/files.js +18 -41
- package/lib/emulator/storage/metadata.js +10 -4
- package/lib/emulator/storage/multipart.js +1 -2
- package/lib/emulator/storage/rfc.js +1 -2
- package/lib/emulator/storage/rules/config.js +1 -2
- package/lib/emulator/storage/rules/manager.js +3 -5
- package/lib/emulator/storage/rules/runtime.js +15 -13
- package/lib/emulator/storage/rules/types.js +2 -2
- package/lib/emulator/storage/rules/utils.js +5 -6
- package/lib/emulator/storage/server.js +1 -2
- package/lib/emulator/storage/upload.js +3 -4
- package/lib/emulator/taskQueue.js +11 -4
- package/lib/emulator/tasksEmulator.js +11 -12
- package/lib/emulator/types.js +6 -6
- package/lib/emulator/ui.js +6 -1
- package/lib/ensureApiEnabled.js +7 -9
- package/lib/env.js +2 -3
- package/lib/error.js +11 -13
- package/lib/errorOut.js +1 -2
- package/lib/experiments.js +15 -18
- package/lib/extensions/askUserForEventsConfig.js +12 -13
- package/lib/extensions/askUserForParam.js +11 -12
- package/lib/extensions/change-log.js +4 -5
- package/lib/extensions/checkProjectBilling.js +1 -2
- package/lib/extensions/diagnose.js +1 -2
- package/lib/extensions/displayExtensionInfo.js +25 -32
- package/lib/extensions/emulator/optionsHelper.js +6 -8
- package/lib/extensions/emulator/specHelper.js +15 -16
- package/lib/extensions/emulator/triggerHelper.js +3 -5
- package/lib/extensions/etags.js +2 -3
- package/lib/extensions/export.js +7 -9
- package/lib/extensions/extensionsApi.js +23 -29
- package/lib/extensions/extensionsHelper.js +52 -80
- package/lib/extensions/listExtensions.js +3 -5
- package/lib/extensions/localHelper.js +5 -5
- package/lib/extensions/manifest.js +15 -16
- package/lib/extensions/metricsUtils.js +3 -4
- package/lib/extensions/paramHelper.js +21 -18
- package/lib/extensions/provisioningHelper.js +17 -21
- package/lib/extensions/publishHelpers.js +1 -2
- package/lib/extensions/publisherApi.js +11 -13
- package/lib/extensions/refs.js +6 -7
- package/lib/extensions/runtimes/common.js +18 -19
- package/lib/extensions/runtimes/node.js +5 -6
- package/lib/extensions/secretsUtils.js +8 -8
- package/lib/extensions/tos.js +7 -8
- package/lib/extensions/types.js +3 -3
- package/lib/extensions/updateHelper.js +6 -7
- package/lib/extensions/utils.js +6 -8
- package/lib/extensions/versionHelper.js +1 -2
- package/lib/extensions/warnings.js +6 -8
- package/lib/fetchMOTD.js +1 -2
- package/lib/fetchWebSetup.js +3 -4
- package/lib/filterTargets.js +1 -2
- package/lib/firebaseConfigValidate.js +2 -3
- package/lib/firestore/api-sort.js +8 -9
- package/lib/firestore/api-types.js +15 -15
- package/lib/firestore/api.js +15 -13
- package/lib/firestore/backupUtils.js +3 -3
- package/lib/firestore/checkDatabaseType.js +1 -2
- package/lib/firestore/delete.js +1 -2
- package/lib/firestore/encodeFirestoreValue.js +1 -2
- package/lib/firestore/fsConfig.js +1 -2
- package/lib/firestore/options.js +1 -1
- package/lib/firestore/util.js +5 -6
- package/lib/firestore/validator.js +4 -5
- package/lib/frameworks/angular/index.js +14 -15
- package/lib/frameworks/angular/utils.js +21 -23
- package/lib/frameworks/astro/index.js +7 -7
- package/lib/frameworks/astro/utils.js +4 -6
- package/lib/frameworks/compose/discover/filesystem.js +3 -3
- package/lib/frameworks/compose/discover/frameworkMatcher.js +4 -5
- package/lib/frameworks/compose/discover/index.js +1 -2
- package/lib/frameworks/compose/discover/runtime/node.js +8 -11
- package/lib/frameworks/compose/driver/docker.js +3 -5
- package/lib/frameworks/compose/driver/hooks.js +2 -2
- package/lib/frameworks/compose/driver/index.js +2 -2
- package/lib/frameworks/compose/driver/local.js +2 -3
- package/lib/frameworks/compose/index.js +5 -7
- package/lib/frameworks/constants.js +3 -3
- package/lib/frameworks/express/index.js +7 -8
- package/lib/frameworks/flutter/index.js +6 -7
- package/lib/frameworks/flutter/utils.js +4 -5
- package/lib/frameworks/index.js +21 -22
- package/lib/frameworks/next/constants.js +5 -2
- package/lib/frameworks/next/index.js +34 -32
- package/lib/frameworks/next/utils.js +40 -39
- package/lib/frameworks/nuxt/index.js +9 -9
- package/lib/frameworks/nuxt/utils.js +4 -6
- package/lib/frameworks/nuxt2/index.js +7 -7
- package/lib/frameworks/sveltekit/index.js +6 -8
- package/lib/frameworks/utils.js +26 -24
- package/lib/frameworks/vite/index.js +8 -9
- package/lib/fsAsync.js +1 -2
- package/lib/fsutils.js +5 -6
- package/lib/functional.js +11 -11
- package/lib/functions/artifacts.js +25 -22
- package/lib/functions/ensureTargeted.js +1 -2
- package/lib/functions/env.js +13 -14
- package/lib/functions/functionslog.js +2 -3
- package/lib/functions/projectConfig.js +29 -33
- package/lib/functions/python.js +10 -4
- package/lib/functions/secrets.js +32 -18
- package/lib/functionsConfig.js +14 -14
- package/lib/functionsConfigClone.js +1 -2
- package/lib/functionsShellCommandAction.js +2 -3
- package/lib/gcp/apphosting.js +43 -28
- package/lib/gcp/apptesting.js +2 -2
- package/lib/gcp/artifactregistry.js +5 -5
- package/lib/gcp/auth.js +11 -13
- package/lib/gcp/cloudbilling.js +4 -5
- package/lib/gcp/cloudbuild.js +10 -11
- package/lib/gcp/cloudfunctions.js +61 -45
- package/lib/gcp/cloudfunctionsv2.js +81 -43
- package/lib/gcp/cloudlogging.js +2 -4
- package/lib/gcp/cloudmonitoring.js +7 -7
- package/lib/gcp/cloudscheduler.js +12 -14
- package/lib/gcp/cloudsql/cloudsqladmin.js +18 -20
- package/lib/gcp/cloudsql/connect.js +14 -9
- package/lib/gcp/cloudsql/fbToolsAuthClient.js +5 -3
- package/lib/gcp/cloudsql/interactive.js +2 -3
- package/lib/gcp/cloudsql/permissions.js +8 -8
- package/lib/gcp/cloudsql/permissionsSetup.js +9 -9
- package/lib/gcp/cloudtasks.js +19 -18
- package/lib/gcp/computeEngine.js +1 -2
- package/lib/gcp/devConnect.js +32 -29
- package/lib/gcp/docker.js +2 -4
- package/lib/gcp/eventarc.js +5 -5
- package/lib/gcp/firedata.js +4 -4
- package/lib/gcp/firestore.js +16 -16
- package/lib/gcp/iam.js +11 -12
- package/lib/gcp/identityPlatform.js +4 -5
- package/lib/gcp/k8s.js +1 -2
- package/lib/gcp/location.js +2 -2
- package/lib/gcp/proto.js +10 -11
- package/lib/gcp/pubsub.js +4 -5
- package/lib/gcp/resourceManager.js +5 -5
- package/lib/gcp/rules.js +13 -14
- package/lib/gcp/run.js +24 -31
- package/lib/gcp/runv2.js +39 -27
- package/lib/gcp/secretManager.js +60 -39
- package/lib/gcp/serviceusage.js +8 -4
- package/lib/gcp/storage.js +22 -20
- package/lib/gemini/fdcExperience.js +5 -5
- package/lib/getDefaultDatabaseInstance.js +2 -4
- package/lib/getDefaultHostingSite.js +3 -4
- package/lib/getProjectNumber.js +1 -2
- package/lib/hosting/api.js +32 -36
- package/lib/hosting/cloudRunProxy.js +2 -3
- package/lib/hosting/config.js +17 -17
- package/lib/hosting/expireUtils.js +3 -3
- package/lib/hosting/functionsProxy.js +1 -2
- package/lib/hosting/implicitInit.js +1 -2
- package/lib/hosting/initMiddleware.js +1 -2
- package/lib/hosting/interactive.js +1 -2
- package/lib/hosting/proxy.js +3 -5
- package/lib/hosting/runTags.js +8 -11
- package/lib/init/features/account.js +1 -2
- package/lib/init/features/ailogic/index.js +3 -5
- package/lib/init/features/ailogic/utils.js +6 -8
- package/lib/init/features/aitools/claude.js +1 -2
- package/lib/init/features/aitools/cursor.js +1 -2
- package/lib/init/features/aitools/gemini.js +1 -1
- package/lib/init/features/aitools/promptUpdater.js +10 -12
- package/lib/init/features/aitools.js +1 -2
- package/lib/init/features/apphosting.js +3 -4
- package/lib/init/features/apptesting/index.js +9 -9
- package/lib/init/features/database.js +4 -5
- package/lib/init/features/dataconnect/create_app.js +3 -4
- package/lib/init/features/dataconnect/index.js +25 -22
- package/lib/init/features/dataconnect/resolver.js +6 -10
- package/lib/init/features/dataconnect/sdk.js +31 -24
- package/lib/init/features/emulators.js +7 -6
- package/lib/init/features/extensions/index.js +3 -5
- package/lib/init/features/firestore/index.js +7 -9
- package/lib/init/features/firestore/indexes.js +2 -2
- package/lib/init/features/firestore/rules.js +3 -3
- package/lib/init/features/functions/index.js +3 -5
- package/lib/init/features/functions/javascript.js +1 -2
- package/lib/init/features/functions/npm-dependencies.js +1 -2
- package/lib/init/features/functions/python.js +1 -2
- package/lib/init/features/functions/typescript.js +1 -2
- package/lib/init/features/genkit/index.js +44 -18
- package/lib/init/features/hosting/github.js +6 -8
- package/lib/init/features/hosting/index.js +10 -13
- package/lib/init/features/project.js +4 -7
- package/lib/init/features/remoteconfig.js +1 -2
- package/lib/init/features/storage.js +3 -5
- package/lib/init/index.js +4 -7
- package/lib/init/spawn.js +7 -9
- package/lib/listFiles.js +1 -2
- package/lib/loadCJSON.js +1 -2
- package/lib/localFunction.js +14 -15
- package/lib/logError.js +1 -2
- package/lib/logger.js +7 -7
- package/lib/management/apps.js +22 -22
- package/lib/management/database.js +11 -12
- package/lib/management/projects.js +57 -56
- package/lib/management/provisioning/errorHandler.js +3 -5
- package/lib/management/provisioning/provision.js +15 -9
- package/lib/management/studio.js +2 -3
- package/lib/mcp/errors.js +4 -4
- package/lib/mcp/index.js +16 -23
- package/lib/mcp/prompt.js +1 -2
- package/lib/mcp/prompts/core/consult.js +2 -3
- package/lib/mcp/prompts/crashlytics/connect.js +15 -122
- package/lib/mcp/prompts/dataconnect/schema.js +3 -3
- package/lib/mcp/prompts/index.js +8 -10
- package/lib/mcp/resource.js +3 -15
- package/lib/mcp/resources/guides/app_id.js +39 -0
- package/lib/mcp/resources/guides/crashlytics_connect.js +51 -0
- package/lib/mcp/resources/guides/crashlytics_investigations.js +51 -0
- package/lib/mcp/resources/guides/crashlytics_issues.js +42 -0
- package/lib/mcp/resources/guides/crashlytics_reports.js +112 -0
- package/lib/mcp/resources/index.js +11 -3
- package/lib/mcp/tool.js +3 -15
- package/lib/mcp/tools/apphosting/fetch_logs.js +3 -4
- package/lib/mcp/tools/apphosting/list_backends.js +1 -1
- package/lib/mcp/tools/auth/get_users.js +5 -16
- package/lib/mcp/tools/core/create_android_sha.js +4 -1
- package/lib/mcp/tools/core/get_environment.js +3 -3
- package/lib/mcp/tools/core/get_sdk_config.js +4 -5
- package/lib/mcp/tools/core/get_security_rules.js +1 -2
- package/lib/mcp/tools/core/init.js +2 -2
- package/lib/mcp/tools/core/logout.js +1 -1
- package/lib/mcp/tools/core/read_resources.js +2 -2
- package/lib/mcp/tools/core/validate_security_rules.js +1 -2
- package/lib/mcp/tools/crashlytics/events.js +43 -19
- package/lib/mcp/tools/crashlytics/index.js +1 -6
- package/lib/mcp/tools/crashlytics/issues.js +33 -12
- package/lib/mcp/tools/crashlytics/reports.js +66 -117
- package/lib/mcp/tools/dataconnect/list_services.js +2 -3
- package/lib/mcp/tools/firestore/converter.js +3 -5
- package/lib/mcp/tools/firestore/delete_document.js +1 -1
- package/lib/mcp/tools/functions/get_logs.js +14 -12
- package/lib/mcp/tools/functions/list_functions.js +1 -1
- package/lib/mcp/tools/index.js +17 -9
- package/lib/mcp/util/apptesting/availability.js +1 -2
- package/lib/mcp/util/availability.js +1 -2
- package/lib/mcp/util/crashlytics/availability.js +1 -2
- package/lib/mcp/util/dataconnect/compile.js +7 -6
- package/lib/mcp/util/dataconnect/converter.js +7 -10
- package/lib/mcp/util/dataconnect/emulator.js +1 -2
- package/lib/mcp/util.js +9 -11
- package/lib/messaging/sendMessage.js +1 -2
- package/lib/metaprogramming.js +1 -2
- package/lib/operation-poller.js +2 -2
- package/lib/profileReport.js +6 -6
- package/lib/profiler.js +1 -2
- package/lib/projectPath.js +1 -2
- package/lib/projectUtils.js +5 -6
- package/lib/prompt.js +22 -13
- package/lib/rc.js +5 -7
- package/lib/remoteconfig/deleteExperiment.js +1 -2
- package/lib/remoteconfig/deleteRollout.js +1 -2
- package/lib/remoteconfig/get.js +2 -3
- package/lib/remoteconfig/getExperiment.js +2 -2
- package/lib/remoteconfig/getRollout.js +2 -2
- package/lib/remoteconfig/interfaces.js +1 -1
- package/lib/remoteconfig/listExperiments.js +2 -2
- package/lib/remoteconfig/listRollouts.js +2 -2
- package/lib/remoteconfig/publish.js +1 -2
- package/lib/remoteconfig/rollback.js +1 -2
- package/lib/remoteconfig/versionslist.js +1 -2
- package/lib/requireAuth.js +4 -6
- package/lib/requireConfig.js +5 -8
- package/lib/requireDatabaseInstance.js +2 -2
- package/lib/requireHostingSite.js +1 -2
- package/lib/requireInteractive.js +1 -1
- package/lib/requirePermissions.js +1 -2
- package/lib/requireTosAcceptance.js +1 -2
- package/lib/responseToError.js +1 -2
- package/lib/rtdb.js +2 -3
- package/lib/rulesDeploy.js +3 -4
- package/lib/serve/functions.js +9 -1
- package/lib/serve/hosting.js +4 -5
- package/lib/serve/index.js +1 -2
- package/lib/shortenUrl.js +1 -2
- package/lib/templates.js +3 -4
- package/lib/throttler/throttler.js +3 -3
- package/lib/timeout.js +2 -3
- package/lib/track.js +23 -14
- package/lib/tsconfig.publish.tsbuildinfo +1 -0
- package/lib/unzip.js +2 -3
- package/lib/utils.js +62 -63
- package/lib/vsCodeUtils.js +2 -3
- package/package.json +6 -6
- package/templates/extensions/typescript/index.ts +1 -1
- package/templates/extensions/typescript/package.lint.json +1 -1
- package/templates/extensions/typescript/package.nolint.json +1 -1
- package/templates/extensions/typescript/tsconfig.json +2 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.execute = execute;
|
|
4
|
+
exports.executeSqlCmdsAsIamUser = executeSqlCmdsAsIamUser;
|
|
5
|
+
exports.executeSqlCmdsAsSuperUser = executeSqlCmdsAsSuperUser;
|
|
6
|
+
exports.getDataConnectP4SA = getDataConnectP4SA;
|
|
7
|
+
exports.getIAMUser = getIAMUser;
|
|
8
|
+
exports.setupIAMUsers = setupIAMUsers;
|
|
9
|
+
exports.toDatabaseUser = toDatabaseUser;
|
|
4
10
|
const pg = require("pg");
|
|
5
11
|
const cloud_sql_connector_1 = require("@google-cloud/cloud-sql-connector");
|
|
6
12
|
const requireAuth_1 = require("../../requireAuth");
|
|
@@ -52,7 +58,13 @@ async function execute(sqlStatements, opts) {
|
|
|
52
58
|
: cloud_sql_connector_1.IpAddressTypes.PRIVATE,
|
|
53
59
|
authType: authType,
|
|
54
60
|
};
|
|
55
|
-
const pool = new pg.Pool(
|
|
61
|
+
const pool = new pg.Pool({
|
|
62
|
+
...(await connector.getOptions(connectionOpts)),
|
|
63
|
+
connectionTimeoutMillis: 1000,
|
|
64
|
+
password: opts.password,
|
|
65
|
+
user: opts.username,
|
|
66
|
+
database: opts.databaseId,
|
|
67
|
+
});
|
|
56
68
|
const cleanUpFn = async () => {
|
|
57
69
|
conn.release();
|
|
58
70
|
await pool.end();
|
|
@@ -81,7 +93,6 @@ async function execute(sqlStatements, opts) {
|
|
|
81
93
|
logFn(``);
|
|
82
94
|
return results;
|
|
83
95
|
}
|
|
84
|
-
exports.execute = execute;
|
|
85
96
|
async function executeSqlCmdsAsIamUser(options, instanceId, databaseId, cmds, silent = false, transaction = false) {
|
|
86
97
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
87
98
|
const { user: iamUser } = await getIAMUser(options);
|
|
@@ -94,7 +105,6 @@ async function executeSqlCmdsAsIamUser(options, instanceId, databaseId, cmds, si
|
|
|
94
105
|
transaction: transaction,
|
|
95
106
|
});
|
|
96
107
|
}
|
|
97
|
-
exports.executeSqlCmdsAsIamUser = executeSqlCmdsAsIamUser;
|
|
98
108
|
async function executeSqlCmdsAsSuperUser(options, instanceId, databaseId, cmds, silent = false, transaction = false) {
|
|
99
109
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
100
110
|
const superuser = "firebasesuperuser";
|
|
@@ -110,11 +120,9 @@ async function executeSqlCmdsAsSuperUser(options, instanceId, databaseId, cmds,
|
|
|
110
120
|
transaction: transaction,
|
|
111
121
|
});
|
|
112
122
|
}
|
|
113
|
-
exports.executeSqlCmdsAsSuperUser = executeSqlCmdsAsSuperUser;
|
|
114
123
|
function getDataConnectP4SA(projectNumber) {
|
|
115
124
|
return `service-${projectNumber}@${(0, api_1.dataconnectP4SADomain)()}`;
|
|
116
125
|
}
|
|
117
|
-
exports.getDataConnectP4SA = getDataConnectP4SA;
|
|
118
126
|
async function getIAMUser(options) {
|
|
119
127
|
const account = await (0, requireAuth_1.requireAuth)(options);
|
|
120
128
|
if (!account) {
|
|
@@ -122,7 +130,6 @@ async function getIAMUser(options) {
|
|
|
122
130
|
}
|
|
123
131
|
return toDatabaseUser(account);
|
|
124
132
|
}
|
|
125
|
-
exports.getIAMUser = getIAMUser;
|
|
126
133
|
async function setupIAMUsers(instanceId, options) {
|
|
127
134
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
128
135
|
const { user, mode } = await getIAMUser(options);
|
|
@@ -132,7 +139,6 @@ async function setupIAMUsers(instanceId, options) {
|
|
|
132
139
|
await cloudSqlAdminClient.createUser(projectId, instanceId, fdcP4SAmode, fdcP4SAUser);
|
|
133
140
|
return user;
|
|
134
141
|
}
|
|
135
|
-
exports.setupIAMUsers = setupIAMUsers;
|
|
136
142
|
function toDatabaseUser(account) {
|
|
137
143
|
let mode = "CLOUD_IAM_USER";
|
|
138
144
|
let user = account;
|
|
@@ -142,4 +148,3 @@ function toDatabaseUser(account) {
|
|
|
142
148
|
}
|
|
143
149
|
return { user, mode };
|
|
144
150
|
}
|
|
145
|
-
exports.toDatabaseUser = toDatabaseUser;
|
|
@@ -6,7 +6,6 @@ const apiv2 = require("../../apiv2");
|
|
|
6
6
|
const error_1 = require("../../error");
|
|
7
7
|
class FBToolsAuthClient extends google_auth_library_1.AuthClient {
|
|
8
8
|
async request(opts) {
|
|
9
|
-
var _a;
|
|
10
9
|
if (!opts.url) {
|
|
11
10
|
throw new error_1.FirebaseError("opts.url was undefined");
|
|
12
11
|
}
|
|
@@ -16,7 +15,7 @@ class FBToolsAuthClient extends google_auth_library_1.AuthClient {
|
|
|
16
15
|
auth: true,
|
|
17
16
|
});
|
|
18
17
|
const res = await client.request({
|
|
19
|
-
method:
|
|
18
|
+
method: opts.method ?? "POST",
|
|
20
19
|
path: url.pathname,
|
|
21
20
|
queryParams: opts.params,
|
|
22
21
|
body: opts.data,
|
|
@@ -36,7 +35,10 @@ class FBToolsAuthClient extends google_auth_library_1.AuthClient {
|
|
|
36
35
|
}
|
|
37
36
|
async getRequestHeaders() {
|
|
38
37
|
const token = await this.getAccessToken();
|
|
39
|
-
return
|
|
38
|
+
return {
|
|
39
|
+
...apiv2.STANDARD_HEADERS,
|
|
40
|
+
Authorization: `Bearer ${token.token}`,
|
|
41
|
+
};
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
exports.FBToolsAuthClient = FBToolsAuthClient;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.confirmDangerousQuery = confirmDangerousQuery;
|
|
4
|
+
exports.interactiveExecuteQuery = interactiveExecuteQuery;
|
|
4
5
|
const ora = require("ora");
|
|
5
6
|
const clc = require("colorette");
|
|
6
7
|
const logger_1 = require("../../logger");
|
|
@@ -20,7 +21,6 @@ async function confirmDangerousQuery(query) {
|
|
|
20
21
|
}
|
|
21
22
|
return true;
|
|
22
23
|
}
|
|
23
|
-
exports.confirmDangerousQuery = confirmDangerousQuery;
|
|
24
24
|
async function interactiveExecuteQuery(query, conn) {
|
|
25
25
|
const spinner = ora("Executing query...").start();
|
|
26
26
|
try {
|
|
@@ -46,4 +46,3 @@ async function interactiveExecuteQuery(query, conn) {
|
|
|
46
46
|
spinner.fail(clc.red(`Failed executing query: ${err}`));
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
exports.interactiveExecuteQuery = interactiveExecuteQuery;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CLOUDSQL_SUPER_USER = exports.FIREBASE_SUPER_USER = exports.DEFAULT_SCHEMA = void 0;
|
|
4
|
+
exports.firebaseowner = firebaseowner;
|
|
5
|
+
exports.firebasereader = firebasereader;
|
|
6
|
+
exports.firebasewriter = firebasewriter;
|
|
7
|
+
exports.ownerRolePermissions = ownerRolePermissions;
|
|
8
|
+
exports.writerRolePermissions = writerRolePermissions;
|
|
9
|
+
exports.readerRolePermissions = readerRolePermissions;
|
|
10
|
+
exports.defaultPermissions = defaultPermissions;
|
|
4
11
|
exports.DEFAULT_SCHEMA = "public";
|
|
5
12
|
exports.FIREBASE_SUPER_USER = "firebasesuperuser";
|
|
6
13
|
exports.CLOUDSQL_SUPER_USER = "cloudsqlsuperuser";
|
|
7
14
|
function firebaseowner(databaseId, schema = exports.DEFAULT_SCHEMA) {
|
|
8
15
|
return `firebaseowner_${databaseId}_${schema}`;
|
|
9
16
|
}
|
|
10
|
-
exports.firebaseowner = firebaseowner;
|
|
11
17
|
function firebasereader(databaseId, schema = exports.DEFAULT_SCHEMA) {
|
|
12
18
|
return `firebasereader_${databaseId}_${schema}`;
|
|
13
19
|
}
|
|
14
|
-
exports.firebasereader = firebasereader;
|
|
15
20
|
function firebasewriter(databaseId, schema = exports.DEFAULT_SCHEMA) {
|
|
16
21
|
return `firebasewriter_${databaseId}_${schema}`;
|
|
17
22
|
}
|
|
18
|
-
exports.firebasewriter = firebasewriter;
|
|
19
23
|
function ownerRolePermissions(databaseId, superuser, schema) {
|
|
20
24
|
const firebaseOwnerRole = firebaseowner(databaseId, schema);
|
|
21
25
|
return [
|
|
@@ -36,7 +40,6 @@ function ownerRolePermissions(databaseId, superuser, schema) {
|
|
|
36
40
|
`GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA "${schema}" TO "${firebaseOwnerRole}"`,
|
|
37
41
|
];
|
|
38
42
|
}
|
|
39
|
-
exports.ownerRolePermissions = ownerRolePermissions;
|
|
40
43
|
function writerRolePermissions(databaseId, superuser, schema) {
|
|
41
44
|
const firebaseWriterRole = firebasewriter(databaseId, schema);
|
|
42
45
|
return [
|
|
@@ -57,7 +60,6 @@ function writerRolePermissions(databaseId, superuser, schema) {
|
|
|
57
60
|
`GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA "${schema}" TO "${firebaseWriterRole}"`,
|
|
58
61
|
];
|
|
59
62
|
}
|
|
60
|
-
exports.writerRolePermissions = writerRolePermissions;
|
|
61
63
|
function readerRolePermissions(databaseId, superuser, schema) {
|
|
62
64
|
const firebaseReaderRole = firebasereader(databaseId, schema);
|
|
63
65
|
return [
|
|
@@ -78,7 +80,6 @@ function readerRolePermissions(databaseId, superuser, schema) {
|
|
|
78
80
|
`GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA "${schema}" TO "${firebaseReaderRole}"`,
|
|
79
81
|
];
|
|
80
82
|
}
|
|
81
|
-
exports.readerRolePermissions = readerRolePermissions;
|
|
82
83
|
function defaultPermissions(databaseId, schema, ownerRole) {
|
|
83
84
|
const firebaseWriterRole = firebasewriter(databaseId, schema);
|
|
84
85
|
const firebaseReaderRole = firebasereader(databaseId, schema);
|
|
@@ -109,4 +110,3 @@ function defaultPermissions(databaseId, schema, ownerRole) {
|
|
|
109
110
|
GRANT EXECUTE ON FUNCTIONS TO "${firebaseReaderRole}";`,
|
|
110
111
|
];
|
|
111
112
|
}
|
|
112
|
-
exports.defaultPermissions = defaultPermissions;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fdcSqlRoleMap = exports.SchemaSetupStatus = void 0;
|
|
4
|
+
exports.checkSQLRoleIsGranted = checkSQLRoleIsGranted;
|
|
5
|
+
exports.setupSQLPermissions = setupSQLPermissions;
|
|
6
|
+
exports.greenFieldSchemaSetup = greenFieldSchemaSetup;
|
|
7
|
+
exports.getSchemaMetadata = getSchemaMetadata;
|
|
8
|
+
exports.setupBrownfieldAsGreenfield = setupBrownfieldAsGreenfield;
|
|
9
|
+
exports.brownfieldSqlSetup = brownfieldSqlSetup;
|
|
10
|
+
exports.grantRoleTo = grantRoleTo;
|
|
4
11
|
const clc = require("colorette");
|
|
5
12
|
const permissions_1 = require("./permissions");
|
|
6
13
|
const cloudsqladmin_1 = require("./cloudsqladmin");
|
|
@@ -19,7 +26,7 @@ var SchemaSetupStatus;
|
|
|
19
26
|
SchemaSetupStatus["GreenField"] = "greenfield";
|
|
20
27
|
SchemaSetupStatus["BrownField"] = "brownfield";
|
|
21
28
|
SchemaSetupStatus["NotFound"] = "not-found";
|
|
22
|
-
})(SchemaSetupStatus
|
|
29
|
+
})(SchemaSetupStatus || (exports.SchemaSetupStatus = SchemaSetupStatus = {}));
|
|
23
30
|
exports.fdcSqlRoleMap = {
|
|
24
31
|
owner: permissions_1.firebaseowner,
|
|
25
32
|
writer: permissions_1.firebasewriter,
|
|
@@ -64,7 +71,6 @@ async function checkSQLRoleIsGranted(options, instanceId, databaseId, grantedRol
|
|
|
64
71
|
throw e;
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
|
-
exports.checkSQLRoleIsGranted = checkSQLRoleIsGranted;
|
|
68
74
|
async function setupSQLPermissions(instanceId, databaseId, schemaInfo, options, silent = false) {
|
|
69
75
|
const logFn = silent
|
|
70
76
|
? logger_1.logger.debug
|
|
@@ -117,7 +123,6 @@ async function setupSQLPermissions(instanceId, databaseId, schemaInfo, options,
|
|
|
117
123
|
return SchemaSetupStatus.BrownField;
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
|
-
exports.setupSQLPermissions = setupSQLPermissions;
|
|
121
126
|
async function greenFieldSchemaSetup(instanceId, databaseId, schema, options) {
|
|
122
127
|
const revokes = [];
|
|
123
128
|
if (await checkSQLRoleIsGranted(options, instanceId, databaseId, "cloudsqlsuperuser", (0, permissions_1.firebaseowner)(databaseId))) {
|
|
@@ -130,7 +135,6 @@ async function greenFieldSchemaSetup(instanceId, databaseId, schema, options) {
|
|
|
130
135
|
const sqlRoleSetupCmds = (0, lodash_1.concat)(revokes, [`CREATE SCHEMA IF NOT EXISTS "${schema}"`], (0, permissions_1.ownerRolePermissions)(databaseId, permissions_1.FIREBASE_SUPER_USER, schema), (0, permissions_1.writerRolePermissions)(databaseId, permissions_1.FIREBASE_SUPER_USER, schema), (0, permissions_1.readerRolePermissions)(databaseId, permissions_1.FIREBASE_SUPER_USER, schema), `GRANT "${(0, permissions_1.firebaseowner)(databaseId, schema)}" TO "${user}"`, `GRANT "${(0, permissions_1.firebasewriter)(databaseId, schema)}" TO "${fdcP4SAUser}"`, (0, permissions_1.defaultPermissions)(databaseId, schema, (0, permissions_1.firebaseowner)(databaseId, schema)));
|
|
131
136
|
return sqlRoleSetupCmds;
|
|
132
137
|
}
|
|
133
|
-
exports.greenFieldSchemaSetup = greenFieldSchemaSetup;
|
|
134
138
|
async function getSchemaMetadata(instanceId, databaseId, schema, options) {
|
|
135
139
|
const checkSchemaExists = await (0, connect_1.executeSqlCmdsAsIamUser)(options, instanceId, databaseId, [
|
|
136
140
|
`SELECT pg_get_userbyid(nspowner)
|
|
@@ -177,7 +181,6 @@ async function getSchemaMetadata(instanceId, databaseId, schema, options) {
|
|
|
177
181
|
tables: tables,
|
|
178
182
|
};
|
|
179
183
|
}
|
|
180
|
-
exports.getSchemaMetadata = getSchemaMetadata;
|
|
181
184
|
function filterTableOwners(schemaInfo, databaseId) {
|
|
182
185
|
return [...new Set(schemaInfo.tables.map((t) => t.owner))].filter((owner) => owner !== permissions_1.CLOUDSQL_SUPER_USER && owner !== (0, permissions_1.firebaseowner)(databaseId, schemaInfo.name));
|
|
183
186
|
}
|
|
@@ -199,7 +202,6 @@ async function setupBrownfieldAsGreenfield(instanceId, databaseId, schemaInfo, o
|
|
|
199
202
|
];
|
|
200
203
|
await (0, connect_1.executeSqlCmdsAsSuperUser)(options, instanceId, databaseId, setupCmds, silent, true);
|
|
201
204
|
}
|
|
202
|
-
exports.setupBrownfieldAsGreenfield = setupBrownfieldAsGreenfield;
|
|
203
205
|
async function brownfieldSqlSetup(instanceId, databaseId, schemaInfo, options, silent = false) {
|
|
204
206
|
const schema = schemaInfo.name;
|
|
205
207
|
const uniqueTablesOwners = filterTableOwners(schemaInfo, databaseId);
|
|
@@ -220,7 +222,6 @@ async function brownfieldSqlSetup(instanceId, databaseId, schemaInfo, options, s
|
|
|
220
222
|
];
|
|
221
223
|
await (0, connect_1.executeSqlCmdsAsSuperUser)(options, instanceId, databaseId, brownfieldSetupCmds, silent, true);
|
|
222
224
|
}
|
|
223
|
-
exports.brownfieldSqlSetup = brownfieldSqlSetup;
|
|
224
225
|
async function grantRoleTo(options, instanceId, databaseId, role, email) {
|
|
225
226
|
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
226
227
|
const { user, mode } = (0, connect_2.toDatabaseUser)(email);
|
|
@@ -228,4 +229,3 @@ async function grantRoleTo(options, instanceId, databaseId, role, email) {
|
|
|
228
229
|
const fdcSqlRole = exports.fdcSqlRoleMap[role](databaseId);
|
|
229
230
|
await (0, connect_1.executeSqlCmdsAsSuperUser)(options, instanceId, databaseId, [`GRANT "${fdcSqlRole}" TO "${user}"`], false);
|
|
230
231
|
}
|
|
231
|
-
exports.grantRoleTo = grantRoleTo;
|
package/lib/gcp/cloudtasks.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULT_SETTINGS = void 0;
|
|
4
|
+
exports.createQueue = createQueue;
|
|
5
|
+
exports.getQueue = getQueue;
|
|
6
|
+
exports.updateQueue = updateQueue;
|
|
7
|
+
exports.upsertQueue = upsertQueue;
|
|
8
|
+
exports.purgeQueue = purgeQueue;
|
|
9
|
+
exports.deleteQueue = deleteQueue;
|
|
10
|
+
exports.setIamPolicy = setIamPolicy;
|
|
11
|
+
exports.getIamPolicy = getIamPolicy;
|
|
12
|
+
exports.setEnqueuer = setEnqueuer;
|
|
13
|
+
exports.queueNameForEndpoint = queueNameForEndpoint;
|
|
14
|
+
exports.queueFromEndpoint = queueFromEndpoint;
|
|
15
|
+
exports.triggerFromQueue = triggerFromQueue;
|
|
4
16
|
const proto = require("./proto");
|
|
5
17
|
const apiv2_1 = require("../apiv2");
|
|
6
18
|
const api_1 = require("../api");
|
|
@@ -29,21 +41,17 @@ async function createQueue(queue) {
|
|
|
29
41
|
const res = await client.post(path, queue);
|
|
30
42
|
return res.body;
|
|
31
43
|
}
|
|
32
|
-
exports.createQueue = createQueue;
|
|
33
44
|
async function getQueue(name) {
|
|
34
45
|
const res = await client.get(name);
|
|
35
46
|
return res.body;
|
|
36
47
|
}
|
|
37
|
-
exports.getQueue = getQueue;
|
|
38
48
|
async function updateQueue(queue) {
|
|
39
49
|
const res = await client.patch(queue.name, queue, {
|
|
40
50
|
queryParams: { updateMask: proto.fieldMasks(queue).join(",") },
|
|
41
51
|
});
|
|
42
52
|
return res.body;
|
|
43
53
|
}
|
|
44
|
-
exports.updateQueue = updateQueue;
|
|
45
54
|
async function upsertQueue(queue) {
|
|
46
|
-
var _a, _b;
|
|
47
55
|
try {
|
|
48
56
|
const existing = await module.exports.getQueue(queue.name);
|
|
49
57
|
if (JSON.stringify(queue) === JSON.stringify(existing)) {
|
|
@@ -56,37 +64,31 @@ async function upsertQueue(queue) {
|
|
|
56
64
|
return false;
|
|
57
65
|
}
|
|
58
66
|
catch (err) {
|
|
59
|
-
if (
|
|
67
|
+
if (err?.context?.response?.statusCode === 404) {
|
|
60
68
|
await module.exports.createQueue(queue);
|
|
61
69
|
return true;
|
|
62
70
|
}
|
|
63
71
|
throw err;
|
|
64
72
|
}
|
|
65
73
|
}
|
|
66
|
-
exports.upsertQueue = upsertQueue;
|
|
67
74
|
async function purgeQueue(name) {
|
|
68
75
|
await client.post(`${name}:purge`);
|
|
69
76
|
}
|
|
70
|
-
exports.purgeQueue = purgeQueue;
|
|
71
77
|
async function deleteQueue(name) {
|
|
72
78
|
await client.delete(name);
|
|
73
79
|
}
|
|
74
|
-
exports.deleteQueue = deleteQueue;
|
|
75
80
|
async function setIamPolicy(name, policy) {
|
|
76
81
|
const res = await client.post(`${name}:setIamPolicy`, {
|
|
77
82
|
policy,
|
|
78
83
|
});
|
|
79
84
|
return res.body;
|
|
80
85
|
}
|
|
81
|
-
exports.setIamPolicy = setIamPolicy;
|
|
82
86
|
async function getIamPolicy(name) {
|
|
83
87
|
const res = await client.post(`${name}:getIamPolicy`);
|
|
84
88
|
return res.body;
|
|
85
89
|
}
|
|
86
|
-
exports.getIamPolicy = getIamPolicy;
|
|
87
90
|
const ENQUEUER_ROLE = "roles/cloudtasks.enqueuer";
|
|
88
91
|
async function setEnqueuer(name, invoker, assumeEmpty = false) {
|
|
89
|
-
var _a, _b;
|
|
90
92
|
let existing;
|
|
91
93
|
if (assumeEmpty) {
|
|
92
94
|
existing = {
|
|
@@ -117,7 +119,7 @@ async function setEnqueuer(name, invoker, assumeEmpty = false) {
|
|
|
117
119
|
return;
|
|
118
120
|
}
|
|
119
121
|
catch (err) {
|
|
120
|
-
if (
|
|
122
|
+
if (err?.context?.response?.statusCode === 429) {
|
|
121
123
|
existing = await module.exports.getIamPolicy(name);
|
|
122
124
|
continue;
|
|
123
125
|
}
|
|
@@ -125,13 +127,14 @@ async function setEnqueuer(name, invoker, assumeEmpty = false) {
|
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
|
-
exports.setEnqueuer = setEnqueuer;
|
|
129
130
|
function queueNameForEndpoint(endpoint) {
|
|
130
131
|
return `projects/${endpoint.project}/locations/${endpoint.region}/queues/${endpoint.id}`;
|
|
131
132
|
}
|
|
132
|
-
exports.queueNameForEndpoint = queueNameForEndpoint;
|
|
133
133
|
function queueFromEndpoint(endpoint) {
|
|
134
|
-
const queue =
|
|
134
|
+
const queue = {
|
|
135
|
+
...JSON.parse(JSON.stringify(exports.DEFAULT_SETTINGS)),
|
|
136
|
+
name: queueNameForEndpoint(endpoint),
|
|
137
|
+
};
|
|
135
138
|
if (endpoint.taskQueueTrigger.rateLimits) {
|
|
136
139
|
proto.copyIfPresent(queue.rateLimits, endpoint.taskQueueTrigger.rateLimits, "maxConcurrentDispatches", "maxDispatchesPerSecond");
|
|
137
140
|
}
|
|
@@ -143,7 +146,6 @@ function queueFromEndpoint(endpoint) {
|
|
|
143
146
|
}
|
|
144
147
|
return queue;
|
|
145
148
|
}
|
|
146
|
-
exports.queueFromEndpoint = queueFromEndpoint;
|
|
147
149
|
function triggerFromQueue(queue) {
|
|
148
150
|
const taskQueueTrigger = {};
|
|
149
151
|
if (queue.rateLimits) {
|
|
@@ -159,4 +161,3 @@ function triggerFromQueue(queue) {
|
|
|
159
161
|
}
|
|
160
162
|
return taskQueueTrigger;
|
|
161
163
|
}
|
|
162
|
-
exports.triggerFromQueue = triggerFromQueue;
|
package/lib/gcp/computeEngine.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultServiceAccount =
|
|
3
|
+
exports.getDefaultServiceAccount = getDefaultServiceAccount;
|
|
4
4
|
const logger_1 = require("../logger");
|
|
5
5
|
const api_1 = require("../api");
|
|
6
6
|
const apiv2_1 = require("../apiv2");
|
|
@@ -21,4 +21,3 @@ async function getDefaultServiceAccount(projectNumber) {
|
|
|
21
21
|
return bestGuess;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
exports.getDefaultServiceAccount = getDefaultServiceAccount;
|
package/lib/gcp/devConnect.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.client = void 0;
|
|
4
|
+
exports.createConnection = createConnection;
|
|
5
|
+
exports.deleteConnection = deleteConnection;
|
|
6
|
+
exports.getConnection = getConnection;
|
|
7
|
+
exports.listAllConnections = listAllConnections;
|
|
8
|
+
exports.listAllLinkableGitRepositories = listAllLinkableGitRepositories;
|
|
9
|
+
exports.listAllBranches = listAllBranches;
|
|
10
|
+
exports.fetchGitHubInstallations = fetchGitHubInstallations;
|
|
11
|
+
exports.parseGitRepositoryLinkName = parseGitRepositoryLinkName;
|
|
12
|
+
exports.createGitRepositoryLink = createGitRepositoryLink;
|
|
13
|
+
exports.getGitRepositoryLink = getGitRepositoryLink;
|
|
14
|
+
exports.fetchGitRepositoryLinkReadToken = fetchGitRepositoryLinkReadToken;
|
|
15
|
+
exports.sortConnectionsByCreateTime = sortConnectionsByCreateTime;
|
|
16
|
+
exports.serviceAgentEmail = serviceAgentEmail;
|
|
17
|
+
exports.generateP4SA = generateP4SA;
|
|
18
|
+
exports.extractGitRepositoryLinkComponents = extractGitRepositoryLinkComponents;
|
|
19
|
+
exports.getRepoDetailsFromBackend = getRepoDetailsFromBackend;
|
|
4
20
|
const apiv2_1 = require("../apiv2");
|
|
5
21
|
const api_1 = require("../api");
|
|
6
22
|
const serviceusage_1 = require("./serviceusage");
|
|
@@ -14,29 +30,29 @@ exports.client = new apiv2_1.Client({
|
|
|
14
30
|
apiVersion: "v1",
|
|
15
31
|
});
|
|
16
32
|
async function createConnection(projectId, location, connectionId, githubConfig = {}) {
|
|
17
|
-
const config =
|
|
18
|
-
|
|
33
|
+
const config = {
|
|
34
|
+
...githubConfig,
|
|
35
|
+
githubApp: "FIREBASE",
|
|
36
|
+
};
|
|
37
|
+
const res = await exports.client.post(`projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections`, {
|
|
19
38
|
githubConfig: config,
|
|
20
39
|
}, { queryParams: { connectionId } });
|
|
21
40
|
return res.body;
|
|
22
41
|
}
|
|
23
|
-
exports.createConnection = createConnection;
|
|
24
42
|
async function deleteConnection(projectId, location, connectionId) {
|
|
25
|
-
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE
|
|
43
|
+
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections/${connectionId}`;
|
|
26
44
|
const res = await exports.client.delete(name, { queryParams: { force: "true" } });
|
|
27
45
|
return res.body;
|
|
28
46
|
}
|
|
29
|
-
exports.deleteConnection = deleteConnection;
|
|
30
47
|
async function getConnection(projectId, location, connectionId) {
|
|
31
|
-
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE
|
|
48
|
+
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections/${connectionId}`;
|
|
32
49
|
const res = await exports.client.get(name);
|
|
33
50
|
return res.body;
|
|
34
51
|
}
|
|
35
|
-
exports.getConnection = getConnection;
|
|
36
52
|
async function listAllConnections(projectId, location) {
|
|
37
53
|
const conns = [];
|
|
38
54
|
const getNextPage = async (pageToken = "") => {
|
|
39
|
-
const res = await exports.client.get(`/projects/${projectId}/locations/${LOCATION_OVERRIDE
|
|
55
|
+
const res = await exports.client.get(`/projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections`, {
|
|
40
56
|
queryParams: {
|
|
41
57
|
pageSize: PAGE_SIZE_MAX,
|
|
42
58
|
pageToken,
|
|
@@ -52,9 +68,8 @@ async function listAllConnections(projectId, location) {
|
|
|
52
68
|
await getNextPage();
|
|
53
69
|
return conns;
|
|
54
70
|
}
|
|
55
|
-
exports.listAllConnections = listAllConnections;
|
|
56
71
|
async function listAllLinkableGitRepositories(projectId, location, connectionId) {
|
|
57
|
-
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE
|
|
72
|
+
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections/${connectionId}:fetchLinkableGitRepositories`;
|
|
58
73
|
const repos = [];
|
|
59
74
|
const getNextPage = async (pageToken = "") => {
|
|
60
75
|
const res = await exports.client.get(name, {
|
|
@@ -73,7 +88,6 @@ async function listAllLinkableGitRepositories(projectId, location, connectionId)
|
|
|
73
88
|
await getNextPage();
|
|
74
89
|
return repos;
|
|
75
90
|
}
|
|
76
|
-
exports.listAllLinkableGitRepositories = listAllLinkableGitRepositories;
|
|
77
91
|
async function listAllBranches(repoLinkName) {
|
|
78
92
|
const branches = new Set();
|
|
79
93
|
const getNextPage = async (pageToken = "") => {
|
|
@@ -96,50 +110,41 @@ async function listAllBranches(repoLinkName) {
|
|
|
96
110
|
await getNextPage();
|
|
97
111
|
return branches;
|
|
98
112
|
}
|
|
99
|
-
exports.listAllBranches = listAllBranches;
|
|
100
113
|
async function fetchGitHubInstallations(projectId, location, connectionId) {
|
|
101
|
-
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE
|
|
114
|
+
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections/${connectionId}:fetchGitHubInstallations`;
|
|
102
115
|
const res = await exports.client.get(name);
|
|
103
116
|
return res.body.installations;
|
|
104
117
|
}
|
|
105
|
-
exports.fetchGitHubInstallations = fetchGitHubInstallations;
|
|
106
118
|
function parseGitRepositoryLinkName(gitRepositoryLinkName) {
|
|
107
119
|
const [, projectName, , location, , connectionName, , id] = gitRepositoryLinkName.split("/");
|
|
108
120
|
return { projectName, location, connectionName, id };
|
|
109
121
|
}
|
|
110
|
-
exports.parseGitRepositoryLinkName = parseGitRepositoryLinkName;
|
|
111
122
|
async function createGitRepositoryLink(projectId, location, connectionId, gitRepositoryLinkId, cloneUri) {
|
|
112
|
-
const res = await exports.client.post(`projects/${projectId}/locations/${LOCATION_OVERRIDE
|
|
123
|
+
const res = await exports.client.post(`projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections/${connectionId}/gitRepositoryLinks`, { cloneUri }, { queryParams: { gitRepositoryLinkId } });
|
|
113
124
|
return res.body;
|
|
114
125
|
}
|
|
115
|
-
exports.createGitRepositoryLink = createGitRepositoryLink;
|
|
116
126
|
async function getGitRepositoryLink(projectId, location, connectionId, gitRepositoryLinkId) {
|
|
117
|
-
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE
|
|
127
|
+
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections/${connectionId}/gitRepositoryLinks/${gitRepositoryLinkId}`;
|
|
118
128
|
const res = await exports.client.get(name);
|
|
119
129
|
return res.body;
|
|
120
130
|
}
|
|
121
|
-
exports.getGitRepositoryLink = getGitRepositoryLink;
|
|
122
131
|
async function fetchGitRepositoryLinkReadToken(projectId, location, connectionId, gitRepositoryLinkId) {
|
|
123
|
-
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE
|
|
132
|
+
const name = `projects/${projectId}/locations/${LOCATION_OVERRIDE ?? location}/connections/${connectionId}/gitRepositoryLinks/${gitRepositoryLinkId}:fetchReadToken`;
|
|
124
133
|
const res = await exports.client.post(name);
|
|
125
134
|
return res.body;
|
|
126
135
|
}
|
|
127
|
-
exports.fetchGitRepositoryLinkReadToken = fetchGitRepositoryLinkReadToken;
|
|
128
136
|
function sortConnectionsByCreateTime(connections) {
|
|
129
137
|
return connections.sort((a, b) => {
|
|
130
138
|
return Date.parse(a.createTime) - Date.parse(b.createTime);
|
|
131
139
|
});
|
|
132
140
|
}
|
|
133
|
-
exports.sortConnectionsByCreateTime = sortConnectionsByCreateTime;
|
|
134
141
|
function serviceAgentEmail(projectNumber) {
|
|
135
142
|
return `service-${projectNumber}@${(0, api_1.developerConnectP4SADomain)()}`;
|
|
136
143
|
}
|
|
137
|
-
exports.serviceAgentEmail = serviceAgentEmail;
|
|
138
144
|
async function generateP4SA(projectNumber) {
|
|
139
145
|
const devConnectOrigin = (0, api_1.developerConnectOrigin)();
|
|
140
146
|
await (0, serviceusage_1.generateServiceIdentityAndPoll)(projectNumber, new URL(devConnectOrigin).hostname, "apphosting");
|
|
141
147
|
}
|
|
142
|
-
exports.generateP4SA = generateP4SA;
|
|
143
148
|
function extractGitRepositoryLinkComponents(path) {
|
|
144
149
|
const connectionMatch = /connections\/([^\/]+)/.exec(path);
|
|
145
150
|
const repositoryMatch = /gitRepositoryLinks\/([^\/]+)/.exec(path);
|
|
@@ -147,7 +152,6 @@ function extractGitRepositoryLinkComponents(path) {
|
|
|
147
152
|
const gitRepoLink = repositoryMatch ? repositoryMatch[1] : null;
|
|
148
153
|
return { connection, gitRepoLink };
|
|
149
154
|
}
|
|
150
|
-
exports.extractGitRepositoryLinkComponents = extractGitRepositoryLinkComponents;
|
|
151
155
|
async function getRepoDetailsFromBackend(projectId, location, gitRepoLinkPath) {
|
|
152
156
|
const { connection, gitRepoLink } = extractGitRepositoryLinkComponents(gitRepoLinkPath);
|
|
153
157
|
if (!connection || !gitRepoLink) {
|
|
@@ -155,8 +159,8 @@ async function getRepoDetailsFromBackend(projectId, location, gitRepoLinkPath) {
|
|
|
155
159
|
}
|
|
156
160
|
const repoLink = await getGitRepositoryLink(projectId, location, connection, gitRepoLink);
|
|
157
161
|
const repoSlug = (0, githubConnections_1.extractRepoSlugFromUri)(repoLink.cloneUri);
|
|
158
|
-
const owner = repoSlug
|
|
159
|
-
const repo = repoSlug
|
|
162
|
+
const owner = repoSlug?.split("/")[0];
|
|
163
|
+
const repo = repoSlug?.split("/")[1];
|
|
160
164
|
if (!owner || !repo) {
|
|
161
165
|
throw new error_1.FirebaseError("Failed to parse owner and repo from git repository link");
|
|
162
166
|
}
|
|
@@ -168,4 +172,3 @@ async function getRepoDetailsFromBackend(projectId, location, gitRepoLinkPath) {
|
|
|
168
172
|
readToken,
|
|
169
173
|
};
|
|
170
174
|
}
|
|
171
|
-
exports.getRepoDetailsFromBackend = getRepoDetailsFromBackend;
|
package/lib/gcp/docker.js
CHANGED
|
@@ -53,24 +53,22 @@ class Client {
|
|
|
53
53
|
return response.body;
|
|
54
54
|
}
|
|
55
55
|
async deleteTag(path, tag) {
|
|
56
|
-
var _a;
|
|
57
56
|
const response = await this.client.delete(`${path}/manifests/${tag}`);
|
|
58
57
|
if (!response.body) {
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
61
|
-
if (
|
|
60
|
+
if (response.body.errors?.length !== 0) {
|
|
62
61
|
throw new error_1.FirebaseError(`Failed to delete tag ${tag} at path ${path}`, {
|
|
63
62
|
children: response.body.errors,
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
66
|
async deleteImage(path, digest) {
|
|
68
|
-
var _a;
|
|
69
67
|
const response = await this.client.delete(`${path}/manifests/${digest}`);
|
|
70
68
|
if (!response.body) {
|
|
71
69
|
return;
|
|
72
70
|
}
|
|
73
|
-
if (
|
|
71
|
+
if (response.body.errors?.length !== 0) {
|
|
74
72
|
throw new error_1.FirebaseError(`Failed to delete image ${digest} at path ${path}`, {
|
|
75
73
|
children: response.body.errors,
|
|
76
74
|
});
|
package/lib/gcp/eventarc.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.API_VERSION = void 0;
|
|
4
|
+
exports.getChannel = getChannel;
|
|
5
|
+
exports.createChannel = createChannel;
|
|
6
|
+
exports.updateChannel = updateChannel;
|
|
7
|
+
exports.deleteChannel = deleteChannel;
|
|
4
8
|
const apiv2_1 = require("../apiv2");
|
|
5
9
|
const api_1 = require("../api");
|
|
6
10
|
const lodash_1 = require("lodash");
|
|
@@ -18,7 +22,6 @@ async function getChannel(name) {
|
|
|
18
22
|
}
|
|
19
23
|
return res.body;
|
|
20
24
|
}
|
|
21
|
-
exports.getChannel = getChannel;
|
|
22
25
|
async function createChannel(channel) {
|
|
23
26
|
const pathParts = channel.name.split("/");
|
|
24
27
|
const res = await client.post(pathParts.slice(0, -1).join("/"), channel, {
|
|
@@ -26,7 +29,6 @@ async function createChannel(channel) {
|
|
|
26
29
|
});
|
|
27
30
|
return res.body;
|
|
28
31
|
}
|
|
29
|
-
exports.createChannel = createChannel;
|
|
30
32
|
async function updateChannel(channel) {
|
|
31
33
|
const res = await client.put(channel.name, channel, {
|
|
32
34
|
queryParams: {
|
|
@@ -35,8 +37,6 @@ async function updateChannel(channel) {
|
|
|
35
37
|
});
|
|
36
38
|
return res.body;
|
|
37
39
|
}
|
|
38
|
-
exports.updateChannel = updateChannel;
|
|
39
40
|
async function deleteChannel(name) {
|
|
40
41
|
await client.delete(name);
|
|
41
42
|
}
|
|
42
|
-
exports.deleteChannel = deleteChannel;
|
package/lib/gcp/firedata.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DATA_CONNECT_TOS_ID = exports.APP_CHECK_TOS_ID = exports.APPHOSTING_TOS_ID = void 0;
|
|
4
|
+
exports.getTosStatus = getTosStatus;
|
|
5
|
+
exports.getAcceptanceStatus = getAcceptanceStatus;
|
|
6
|
+
exports.isProductTosAccepted = isProductTosAccepted;
|
|
4
7
|
const apiv2_1 = require("../apiv2");
|
|
5
8
|
const api_1 = require("../api");
|
|
6
9
|
const error_1 = require("../error");
|
|
@@ -12,7 +15,6 @@ async function getTosStatus() {
|
|
|
12
15
|
const res = await client.get("accessmanagement/tos:getStatus");
|
|
13
16
|
return res.body;
|
|
14
17
|
}
|
|
15
|
-
exports.getTosStatus = getTosStatus;
|
|
16
18
|
function getAcceptanceStatus(response, tosId) {
|
|
17
19
|
const perServiceStatus = response.perServiceStatus.find((tosStatus) => tosStatus.tosId === tosId);
|
|
18
20
|
if (perServiceStatus === undefined) {
|
|
@@ -20,8 +22,6 @@ function getAcceptanceStatus(response, tosId) {
|
|
|
20
22
|
}
|
|
21
23
|
return perServiceStatus.serviceStatus.status;
|
|
22
24
|
}
|
|
23
|
-
exports.getAcceptanceStatus = getAcceptanceStatus;
|
|
24
25
|
function isProductTosAccepted(response, tosId) {
|
|
25
26
|
return getAcceptanceStatus(response, tosId) === "ACCEPTED";
|
|
26
27
|
}
|
|
27
|
-
exports.isProductTosAccepted = isProductTosAccepted;
|