firebase-tools-with-isolate 13.7.3 → 13.11.2

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.
Files changed (113) hide show
  1. package/lib/api.js +18 -8
  2. package/lib/apiv2.js +19 -13
  3. package/lib/apphosting/app.js +40 -59
  4. package/lib/apphosting/constants.js +2 -2
  5. package/lib/apphosting/githubConnections.js +7 -9
  6. package/lib/apphosting/index.js +122 -58
  7. package/lib/apphosting/repo.js +3 -3
  8. package/lib/apphosting/secrets/index.js +7 -1
  9. package/lib/checkValidTargetFilters.js +8 -1
  10. package/lib/commands/apphosting-backends-create.js +7 -6
  11. package/lib/commands/apphosting-backends-delete.js +24 -28
  12. package/lib/commands/apphosting-backends-list.js +4 -5
  13. package/lib/commands/apphosting-secrets-access.js +1 -1
  14. package/lib/commands/apphosting-secrets-grantaccess.js +11 -7
  15. package/lib/commands/apphosting-secrets-set.js +1 -1
  16. package/lib/commands/dataconnect-sdk-generate.js +43 -0
  17. package/lib/commands/dataconnect-services-list.js +74 -0
  18. package/lib/commands/dataconnect-sql-diff.js +25 -0
  19. package/lib/commands/dataconnect-sql-migrate.js +44 -0
  20. package/lib/commands/deploy.js +27 -1
  21. package/lib/commands/index.js +11 -0
  22. package/lib/commands/init.js +10 -3
  23. package/lib/commands/setup-emulators-dataconnect.js +12 -0
  24. package/lib/config.js +1 -0
  25. package/lib/crashlytics/buildToolsJarHelper.js +2 -1
  26. package/lib/dataconnect/build.js +14 -0
  27. package/lib/dataconnect/checkIam.js +30 -0
  28. package/lib/dataconnect/client.js +104 -0
  29. package/lib/dataconnect/dataplaneClient.js +16 -0
  30. package/lib/dataconnect/ensureApis.js +12 -0
  31. package/lib/dataconnect/errors.js +37 -0
  32. package/lib/dataconnect/fileUtils.js +92 -0
  33. package/lib/dataconnect/filters.js +45 -0
  34. package/lib/dataconnect/freeTrial.js +22 -0
  35. package/lib/dataconnect/graphqlError.js +15 -0
  36. package/lib/dataconnect/load.js +40 -0
  37. package/lib/dataconnect/names.js +66 -0
  38. package/lib/dataconnect/prompts.js +20 -0
  39. package/lib/dataconnect/provisionCloudSql.js +91 -0
  40. package/lib/dataconnect/schemaMigration.js +278 -0
  41. package/lib/dataconnect/types.js +22 -0
  42. package/lib/deploy/dataconnect/deploy.js +76 -0
  43. package/lib/deploy/dataconnect/index.js +9 -0
  44. package/lib/deploy/dataconnect/prepare.js +33 -0
  45. package/lib/deploy/dataconnect/release.js +64 -0
  46. package/lib/deploy/functions/checkIam.js +4 -34
  47. package/lib/deploy/functions/prepare.js +1 -1
  48. package/lib/deploy/functions/release/fabricator.js +7 -2
  49. package/lib/deploy/functions/runtimes/discovery/index.js +2 -1
  50. package/lib/deploy/functions/runtimes/supported/types.js +6 -0
  51. package/lib/deploy/index.js +2 -0
  52. package/lib/downloadUtils.js +2 -2
  53. package/lib/emulator/constants.js +3 -0
  54. package/lib/emulator/controller.js +40 -12
  55. package/lib/emulator/dataconnectEmulator.js +137 -0
  56. package/lib/emulator/download.js +5 -1
  57. package/lib/emulator/downloadableEmulators.js +92 -16
  58. package/lib/emulator/portUtils.js +13 -4
  59. package/lib/emulator/registry.js +6 -1
  60. package/lib/emulator/storage/rules/runtime.js +1 -1
  61. package/lib/emulator/types.js +3 -0
  62. package/lib/experiments.js +19 -6
  63. package/lib/extensions/emulator/specHelper.js +5 -39
  64. package/lib/frameworks/angular/utils.js +8 -3
  65. package/lib/frameworks/next/index.js +6 -4
  66. package/lib/frameworks/next/utils.js +1 -1
  67. package/lib/functions/python.js +4 -3
  68. package/lib/gcp/apphosting.js +11 -1
  69. package/lib/gcp/cloudsql/cloudsqladmin.js +187 -0
  70. package/lib/gcp/cloudsql/connect.js +144 -0
  71. package/lib/gcp/cloudsql/fbToolsAuthClient.js +44 -0
  72. package/lib/gcp/devConnect.js +1 -1
  73. package/lib/gcp/firedata.js +27 -0
  74. package/lib/gcp/iam.js +33 -1
  75. package/lib/gcp/secretManager.js +1 -1
  76. package/lib/hosting/interactive.js +4 -0
  77. package/lib/init/features/dataconnect/index.js +228 -0
  78. package/lib/init/features/emulators.js +13 -1
  79. package/lib/init/features/functions/index.js +19 -3
  80. package/lib/init/features/functions/npm-dependencies.js +12 -23
  81. package/lib/init/features/genkit.js +53 -0
  82. package/lib/init/features/index.js +5 -1
  83. package/lib/init/index.js +2 -0
  84. package/lib/init/spawn.js +23 -0
  85. package/lib/logger.js +22 -2
  86. package/lib/operation-poller.js +8 -2
  87. package/lib/rc.js +7 -1
  88. package/lib/requireAuth.js +4 -8
  89. package/lib/requireTosAcceptance.js +22 -0
  90. package/lib/track.js +29 -2
  91. package/lib/utils.js +55 -4
  92. package/package.json +10 -4
  93. package/schema/connector-yaml.json +54 -0
  94. package/schema/dataconnect-yaml.json +72 -0
  95. package/schema/firebase-config.json +105 -0
  96. package/templates/extensions/javascript/package.lint.json +2 -2
  97. package/templates/extensions/javascript/package.nolint.json +2 -2
  98. package/templates/extensions/typescript/package.lint.json +2 -2
  99. package/templates/extensions/typescript/package.nolint.json +2 -2
  100. package/templates/init/dataconnect/connector.yaml +2 -0
  101. package/templates/init/dataconnect/dataconnect.yaml +10 -0
  102. package/templates/init/dataconnect/mutations.gql +30 -0
  103. package/templates/init/dataconnect/queries.gql +51 -0
  104. package/templates/init/dataconnect/schema.gql +28 -0
  105. package/templates/init/functions/javascript/_gitignore +2 -1
  106. package/templates/init/functions/javascript/package.lint.json +2 -2
  107. package/templates/init/functions/javascript/package.nolint.json +2 -2
  108. package/templates/init/functions/python/_gitignore +1 -0
  109. package/templates/init/functions/typescript/_gitignore +1 -0
  110. package/templates/init/functions/typescript/package.lint.json +2 -2
  111. package/templates/init/functions/typescript/package.nolint.json +2 -2
  112. package/lib/monospace/index.js +0 -82
  113. /package/lib/{monospace/interfaces.js → gcp/cloudsql/types.js} +0 -0
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "main": "index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^11.8.0",
18
- "firebase-functions": "^4.3.1"
17
+ "firebase-admin": "^12.1.0",
18
+ "firebase-functions": "^5.0.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "eslint": "^8.15.0",
@@ -13,8 +13,8 @@
13
13
  },
14
14
  "main": "index.js",
15
15
  "dependencies": {
16
- "firebase-admin": "^11.8.0",
17
- "firebase-functions": "^4.3.1"
16
+ "firebase-admin": "^12.1.0",
17
+ "firebase-functions": "^5.0.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "firebase-functions-test": "^3.1.0"
@@ -0,0 +1 @@
1
+ *.local
@@ -7,3 +7,4 @@ typings/
7
7
 
8
8
  # Node.js dependency directory
9
9
  node_modules/
10
+ *.local
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "main": "lib/index.js",
17
17
  "dependencies": {
18
- "firebase-admin": "^11.8.0",
19
- "firebase-functions": "^4.3.1"
18
+ "firebase-admin": "^12.1.0",
19
+ "firebase-functions": "^5.0.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@typescript-eslint/eslint-plugin": "^5.12.0",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "main": "lib/index.js",
16
16
  "dependencies": {
17
- "firebase-admin": "^11.8.0",
18
- "firebase-functions": "^4.3.1"
17
+ "firebase-admin": "^12.1.0",
18
+ "firebase-functions": "^5.0.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "typescript": "^4.9.0",
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMonospaceEnv = exports.selectProjectInMonospace = void 0;
4
- const node_fetch_1 = require("node-fetch");
5
- const error_1 = require("../error");
6
- const logger_1 = require("../logger");
7
- const rc_1 = require("../rc");
8
- const POLL_USER_RESPONSE_MILLIS = 2000;
9
- async function selectProjectInMonospace({ projectRoot, project, isVSCE, }) {
10
- const initFirebaseResponse = await initFirebase(project);
11
- if (initFirebaseResponse.success === false) {
12
- throw new Error(String(initFirebaseResponse.error));
13
- }
14
- const { rid } = initFirebaseResponse;
15
- const authorizedProject = await pollAuthorizedProject(rid);
16
- if (!authorizedProject)
17
- return null;
18
- if (isVSCE)
19
- return authorizedProject;
20
- if (projectRoot)
21
- createFirebaseRc(projectRoot, authorizedProject);
22
- }
23
- exports.selectProjectInMonospace = selectProjectInMonospace;
24
- async function pollAuthorizedProject(rid) {
25
- const getInitFirebaseRes = await getInitFirebaseResponse(rid);
26
- if ("userResponse" in getInitFirebaseRes) {
27
- if (getInitFirebaseRes.userResponse.success) {
28
- return getInitFirebaseRes.userResponse.projectId;
29
- }
30
- return null;
31
- }
32
- const { error } = getInitFirebaseRes;
33
- if (error === "WAITING_FOR_RESPONSE") {
34
- await new Promise((res) => setTimeout(res, POLL_USER_RESPONSE_MILLIS));
35
- return pollAuthorizedProject(rid);
36
- }
37
- if (error === "USER_CANCELED") {
38
- throw new error_1.FirebaseError("User canceled without authorizing any project");
39
- }
40
- throw new error_1.FirebaseError(`Unhandled /get-init-firebase-response error`, {
41
- original: new Error(error),
42
- });
43
- }
44
- async function initFirebase(project) {
45
- const port = getMonospaceDaemonPort();
46
- if (!port)
47
- throw new error_1.FirebaseError("Undefined MONOSPACE_DAEMON_PORT");
48
- const initFirebaseURL = new URL(`http://localhost:${port}/init-firebase`);
49
- if (project) {
50
- initFirebaseURL.searchParams.set("known_project", project);
51
- }
52
- const initFirebaseRes = await (0, node_fetch_1.default)(initFirebaseURL.toString(), {
53
- method: "POST",
54
- headers: {
55
- "Content-Type": "application/json",
56
- },
57
- });
58
- const initFirebaseResponse = (await initFirebaseRes.json());
59
- return initFirebaseResponse;
60
- }
61
- async function getInitFirebaseResponse(rid) {
62
- const port = getMonospaceDaemonPort();
63
- if (!port)
64
- throw new error_1.FirebaseError("Undefined MONOSPACE_DAEMON_PORT");
65
- const getInitFirebaseRes = await (0, node_fetch_1.default)(`http://localhost:${port}/get-init-firebase-response?rid=${rid}`);
66
- const getInitFirebaseJson = (await getInitFirebaseRes.json());
67
- logger_1.logger.debug(`/get-init-firebase-response?rid=${rid} response:`);
68
- logger_1.logger.debug(getInitFirebaseJson);
69
- return getInitFirebaseJson;
70
- }
71
- function createFirebaseRc(projectDir, authorizedProject) {
72
- const firebaseRc = (0, rc_1.loadRC)({ cwd: projectDir });
73
- firebaseRc.addProjectAlias("default", authorizedProject);
74
- return firebaseRc.save();
75
- }
76
- function isMonospaceEnv() {
77
- return getMonospaceDaemonPort() !== undefined;
78
- }
79
- exports.isMonospaceEnv = isMonospaceEnv;
80
- function getMonospaceDaemonPort() {
81
- return process.env.MONOSPACE_DAEMON_PORT;
82
- }