firebase-tools 13.7.5 → 13.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/lib/api.js +9 -1
  2. package/lib/apiv2.js +19 -13
  3. package/lib/apphosting/app.js +38 -58
  4. package/lib/apphosting/githubConnections.js +1 -1
  5. package/lib/apphosting/index.js +72 -20
  6. package/lib/checkValidTargetFilters.js +8 -1
  7. package/lib/commands/apphosting-backends-create.js +4 -3
  8. package/lib/commands/apphosting-backends-delete.js +24 -17
  9. package/lib/commands/apphosting-backends-list.js +3 -3
  10. package/lib/commands/apphosting-secrets-grantaccess.js +9 -5
  11. package/lib/commands/dataconnect-list.js +64 -0
  12. package/lib/commands/dataconnect-sdk-generate.js +37 -0
  13. package/lib/commands/dataconnect-sql-diff.js +25 -0
  14. package/lib/commands/dataconnect-sql-migrate.js +46 -0
  15. package/lib/commands/deploy.js +27 -1
  16. package/lib/commands/index.js +10 -0
  17. package/lib/commands/init.js +7 -0
  18. package/lib/commands/setup-emulators-dataconnect.js +12 -0
  19. package/lib/config.js +1 -0
  20. package/lib/dataconnect/build.js +23 -0
  21. package/lib/dataconnect/checkIam.js +30 -0
  22. package/lib/dataconnect/client.js +115 -0
  23. package/lib/dataconnect/dataplaneClient.js +16 -0
  24. package/lib/dataconnect/ensureApis.js +12 -0
  25. package/lib/dataconnect/fileUtils.js +89 -0
  26. package/lib/dataconnect/filters.js +45 -0
  27. package/lib/dataconnect/freeTrial.js +23 -0
  28. package/lib/dataconnect/graphqlError.js +13 -0
  29. package/lib/dataconnect/load.js +40 -0
  30. package/lib/dataconnect/names.js +48 -0
  31. package/lib/dataconnect/prompts.js +20 -0
  32. package/lib/dataconnect/provisionCloudSql.js +74 -0
  33. package/lib/dataconnect/schemaMigration.js +171 -0
  34. package/lib/dataconnect/types.js +23 -0
  35. package/lib/deploy/dataconnect/deploy.js +84 -0
  36. package/lib/deploy/dataconnect/index.js +9 -0
  37. package/lib/deploy/dataconnect/prepare.js +30 -0
  38. package/lib/deploy/dataconnect/release.js +65 -0
  39. package/lib/deploy/functions/checkIam.js +4 -34
  40. package/lib/deploy/functions/release/fabricator.js +7 -2
  41. package/lib/deploy/index.js +2 -0
  42. package/lib/downloadUtils.js +2 -2
  43. package/lib/emulator/constants.js +3 -0
  44. package/lib/emulator/controller.js +39 -12
  45. package/lib/emulator/dataconnectEmulator.js +88 -0
  46. package/lib/emulator/download.js +1 -1
  47. package/lib/emulator/downloadableEmulators.js +42 -3
  48. package/lib/emulator/portUtils.js +3 -3
  49. package/lib/emulator/registry.js +6 -1
  50. package/lib/emulator/types.js +3 -0
  51. package/lib/experiments.js +12 -5
  52. package/lib/extensions/emulator/specHelper.js +5 -39
  53. package/lib/frameworks/next/index.js +3 -1
  54. package/lib/frameworks/next/utils.js +1 -1
  55. package/lib/gcp/apphosting.js +6 -1
  56. package/lib/gcp/cloudsql/cloudsqladmin.js +155 -0
  57. package/lib/gcp/cloudsql/connect.js +128 -0
  58. package/lib/gcp/cloudsql/fbToolsAuthClient.js +42 -0
  59. package/lib/gcp/cloudsql/types.js +2 -0
  60. package/lib/gcp/firedata.js +26 -0
  61. package/lib/gcp/iam.js +33 -1
  62. package/lib/gcp/secretManager.js +1 -1
  63. package/lib/hosting/interactive.js +4 -0
  64. package/lib/init/features/dataconnect/index.js +160 -0
  65. package/lib/init/features/emulators.js +13 -0
  66. package/lib/init/features/functions/index.js +15 -3
  67. package/lib/init/features/index.js +3 -1
  68. package/lib/init/index.js +1 -0
  69. package/lib/logger.js +22 -2
  70. package/lib/operation-poller.js +8 -2
  71. package/lib/rc.js +10 -1
  72. package/lib/requireAuth.js +1 -0
  73. package/lib/requireTosAcceptance.js +21 -0
  74. package/lib/utils.js +55 -4
  75. package/package.json +6 -2
  76. package/schema/connector-yaml.json +54 -0
  77. package/schema/dataconnect-yaml.json +72 -0
  78. package/schema/firebase-config.json +103 -0
  79. package/templates/extensions/javascript/package.lint.json +2 -2
  80. package/templates/extensions/javascript/package.nolint.json +2 -2
  81. package/templates/extensions/typescript/package.lint.json +2 -2
  82. package/templates/extensions/typescript/package.nolint.json +2 -2
  83. package/templates/init/dataconnect/connector.yaml +2 -0
  84. package/templates/init/dataconnect/dataconnect.yaml +10 -0
  85. package/templates/init/dataconnect/mutations.gql +4 -0
  86. package/templates/init/dataconnect/queries.gql +6 -0
  87. package/templates/init/dataconnect/schema.gql +15 -0
  88. package/templates/init/functions/javascript/_gitignore +2 -1
  89. package/templates/init/functions/javascript/package.lint.json +2 -2
  90. package/templates/init/functions/javascript/package.nolint.json +2 -2
  91. package/templates/init/functions/python/_gitignore +1 -0
  92. package/templates/init/functions/typescript/_gitignore +1 -0
  93. package/templates/init/functions/typescript/package.lint.json +2 -2
  94. package/templates/init/functions/typescript/package.nolint.json +2 -2
package/lib/init/index.js CHANGED
@@ -10,6 +10,7 @@ const featureFns = new Map([
10
10
  ["account", features.account],
11
11
  ["database", features.database],
12
12
  ["firestore", features.firestore],
13
+ ["dataconnect", features.dataconnect],
13
14
  ["functions", features.functions],
14
15
  ["hosting", features.hosting],
15
16
  ["storage", features.storage],
package/lib/logger.js CHANGED
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.logger = void 0;
3
+ exports.logger = exports.vsceLogEmitter = void 0;
4
4
  const winston = require("winston");
5
+ const utils_1 = require("./utils");
6
+ const events_1 = require("events");
7
+ exports.vsceLogEmitter = new events_1.EventEmitter();
5
8
  function expandErrors(logger) {
6
9
  const oldLogFunc = logger.log.bind(logger);
7
10
  const newLogFunc = function (levelOrEntry, message, ...meta) {
@@ -25,7 +28,24 @@ function annotateDebugLines(logger) {
25
28
  logger.debug = newDebug;
26
29
  return logger;
27
30
  }
31
+ function maybeUseVSCodeLogger(logger) {
32
+ if (!(0, utils_1.isVSCodeExtension)()) {
33
+ return logger;
34
+ }
35
+ const oldLogFunc = logger.log.bind(logger);
36
+ const vsceLogger = function (levelOrEntry, message, ...meta) {
37
+ if (message) {
38
+ exports.vsceLogEmitter.emit("log", { level: levelOrEntry, message });
39
+ }
40
+ else {
41
+ exports.vsceLogEmitter.emit("log", levelOrEntry);
42
+ }
43
+ return oldLogFunc(levelOrEntry, message, ...meta);
44
+ };
45
+ logger.log = vsceLogger;
46
+ return logger;
47
+ }
28
48
  const rawLogger = winston.createLogger();
29
49
  rawLogger.add(new winston.transports.Console({ silent: true }));
30
50
  rawLogger.exitOnError = false;
31
- exports.logger = annotateDebugLines(expandErrors(rawLogger));
51
+ exports.logger = maybeUseVSCodeLogger(annotateDebugLines(expandErrors(rawLogger)));
@@ -21,7 +21,7 @@ class OperationPoller {
21
21
  if (error) {
22
22
  throw error instanceof error_1.FirebaseError
23
23
  ? error
24
- : new error_1.FirebaseError(error.message, { status: error.code });
24
+ : new error_1.FirebaseError(error.message, { status: error.code, original: error });
25
25
  }
26
26
  return response;
27
27
  }
@@ -45,7 +45,13 @@ class OperationPoller {
45
45
  if (options.onPoll) {
46
46
  options.onPoll(res.body);
47
47
  }
48
- if (!res.body.done) {
48
+ if (options.doneFn) {
49
+ const done = options.doneFn(res.body);
50
+ if (!done) {
51
+ throw new Error("Polling incomplete, should trigger retry with backoff");
52
+ }
53
+ }
54
+ else if (!res.body.done) {
49
55
  throw new Error("Polling incomplete, should trigger retry with backoff");
50
56
  }
51
57
  return res.body;
package/lib/rc.js CHANGED
@@ -37,7 +37,7 @@ class RC {
37
37
  }
38
38
  constructor(rcpath, data) {
39
39
  this.path = rcpath;
40
- this.data = Object.assign({ projects: {}, targets: {}, etags: {} }, data);
40
+ this.data = Object.assign({ projects: {}, targets: {}, etags: {}, dataconnectEmulatorConfig: {} }, data);
41
41
  }
42
42
  set(key, value) {
43
43
  _.set(this.data, key, value);
@@ -152,6 +152,15 @@ class RC {
152
152
  this.data.etags[projectId][resourceType] = etagData;
153
153
  this.save();
154
154
  }
155
+ getDataconnect() {
156
+ var _a;
157
+ return (_a = this.data.dataconnectEmulatorConfig) !== null && _a !== void 0 ? _a : {};
158
+ }
159
+ setDataconnect(localConnectionString) {
160
+ if (!this.data.dataconnectEmulatorConfig) {
161
+ this.data.dataconnectEmulatorConfig = { postgres: { localConnectionString } };
162
+ }
163
+ }
155
164
  save() {
156
165
  if (this.path) {
157
166
  fs.writeFileSync(this.path, JSON.stringify(this.data, null, 2), {
@@ -77,5 +77,6 @@ async function requireAuth(options) {
77
77
  throw new error_1.FirebaseError(AUTH_ERROR_MESSAGE);
78
78
  }
79
79
  (0, auth_1.setActiveAccount)(options, { user, tokens });
80
+ return user.email;
80
81
  }
81
82
  exports.requireAuth = requireAuth;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requireTosAcceptance = void 0;
4
+ const error_1 = require("./error");
5
+ const firedata_1 = require("./gcp/firedata");
6
+ const api_1 = require("./api");
7
+ const consoleLandingPage = new Map([
8
+ [firedata_1.APPHOSTING_TOS_ID, `${(0, api_1.consoleOrigin)()}/project/_/apphosting`],
9
+ ]);
10
+ function requireTosAcceptance(tosId) {
11
+ return () => requireTos(tosId);
12
+ }
13
+ exports.requireTosAcceptance = requireTosAcceptance;
14
+ async function requireTos(tosId) {
15
+ const res = await (0, firedata_1.getTosStatus)();
16
+ if ((0, firedata_1.isProductTosAccepted)(res, tosId)) {
17
+ return;
18
+ }
19
+ const console = consoleLandingPage.get(tosId) || (0, api_1.consoleOrigin)();
20
+ throw new error_1.FirebaseError(`Your account has not accepted the required Terms of Service for this action. Please accept the Terms of Service and try again. ${console}`);
21
+ }
package/lib/utils.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHostnameFromUrl = exports.openInBrowserPopup = exports.openInBrowser = exports.connectableHostname = exports.randomInt = exports.debounce = exports.last = exports.cloneDeep = exports.groupBy = exports.assertIsStringOrUndefined = exports.assertIsNumber = exports.assertIsString = exports.thirtyDaysFromNow = exports.isRunningInWSL = exports.isVSCodeExtension = exports.isCloudEnvironment = exports.datetimeString = exports.createDestroyer = exports.promiseWithSpinner = exports.setupLoggers = exports.tryParse = exports.tryStringify = exports.promiseProps = exports.withTimeout = exports.promiseWhile = exports.promiseAllSettled = exports.getFunctionsEventProvider = exports.endpoint = exports.makeActiveProject = exports.streamToString = exports.stringToStream = exports.explainStdin = exports.allSettled = exports.reject = exports.logLabeledError = exports.logLabeledWarning = exports.logWarning = exports.logLabeledBullet = exports.logBullet = exports.logLabeledSuccess = exports.logSuccess = exports.addSubdomain = exports.addDatabaseNamespace = exports.getDatabaseViewDataUrl = exports.getDatabaseUrl = exports.envOverride = exports.getInheritedOption = exports.consoleUrl = exports.envOverrides = exports.IS_WINDOWS = void 0;
4
- exports.readSecretValue = void 0;
5
- const fs = require("node:fs");
3
+ exports.connectableHostname = exports.randomInt = exports.debounce = exports.last = exports.cloneDeep = exports.groupBy = exports.assertIsStringOrUndefined = exports.assertIsNumber = exports.assertIsString = exports.thirtyDaysFromNow = exports.isRunningInWSL = exports.isVSCodeExtension = exports.isCloudEnvironment = exports.datetimeString = exports.createDestroyer = exports.sleep = exports.promiseWithSpinner = exports.setupLoggers = exports.tryParse = exports.tryStringify = exports.promiseProps = exports.withTimeout = exports.promiseWhile = exports.promiseAllSettled = exports.getFunctionsEventProvider = exports.endpoint = exports.makeActiveProject = exports.streamToString = exports.stringToStream = exports.explainStdin = exports.allSettled = exports.reject = exports.logLabeledError = exports.logLabeledWarning = exports.logWarning = exports.logLabeledBullet = exports.logBullet = exports.logLabeledSuccess = exports.logSuccess = exports.addSubdomain = exports.addDatabaseNamespace = exports.getDatabaseViewDataUrl = exports.getDatabaseUrl = exports.envOverride = exports.setVSCodeEnvVars = exports.getInheritedOption = exports.consoleUrl = exports.vscodeEnvVars = exports.envOverrides = exports.IS_WINDOWS = void 0;
4
+ exports.readSecretValue = exports.generateId = exports.wrappedSafeLoad = exports.readFileFromDirectory = exports.getHostnameFromUrl = exports.openInBrowserPopup = exports.openInBrowser = void 0;
5
+ const fs = require("fs-extra");
6
6
  const tty = require("tty");
7
7
  const path = require("node:path");
8
+ const yaml = require("yaml");
8
9
  const _ = require("lodash");
9
10
  const url = require("url");
10
11
  const http = require("http");
@@ -28,6 +29,7 @@ const WARNING_CHAR = exports.IS_WINDOWS ? "!" : "⚠";
28
29
  const ERROR_CHAR = exports.IS_WINDOWS ? "!!" : "⬢";
29
30
  const THIRTY_DAYS_IN_MILLISECONDS = 30 * 24 * 60 * 60 * 1000;
30
31
  exports.envOverrides = [];
32
+ exports.vscodeEnvVars = {};
31
33
  function consoleUrl(project, path) {
32
34
  const api = require("./api");
33
35
  return `${api.consoleOrigin()}/project/${project}${path}`;
@@ -43,8 +45,12 @@ function getInheritedOption(options, key) {
43
45
  }
44
46
  }
45
47
  exports.getInheritedOption = getInheritedOption;
48
+ function setVSCodeEnvVars(envVar, value) {
49
+ exports.vscodeEnvVars[envVar] = value;
50
+ }
51
+ exports.setVSCodeEnvVars = setVSCodeEnvVars;
46
52
  function envOverride(envname, value, coerce) {
47
- const currentEnvValue = process.env[envname];
53
+ const currentEnvValue = isVSCodeExtension() && exports.vscodeEnvVars[envname] ? exports.vscodeEnvVars[envname] : process.env[envname];
48
54
  if (currentEnvValue && currentEnvValue.length) {
49
55
  exports.envOverrides.push(envname);
50
56
  if (coerce) {
@@ -336,6 +342,10 @@ async function promiseWithSpinner(action, message) {
336
342
  return data;
337
343
  }
338
344
  exports.promiseWithSpinner = promiseWithSpinner;
345
+ function sleep(ms) {
346
+ return new Promise((resolve) => setTimeout(resolve, ms));
347
+ }
348
+ exports.sleep = sleep;
339
349
  function createDestroyer(server) {
340
350
  const connections = new Set();
341
351
  server.on("connection", (conn) => {
@@ -527,6 +537,47 @@ function getHostnameFromUrl(url) {
527
537
  }
528
538
  }
529
539
  exports.getHostnameFromUrl = getHostnameFromUrl;
540
+ function readFileFromDirectory(directory, file) {
541
+ return new Promise((resolve, reject) => {
542
+ fs.readFile(path.resolve(directory, file), "utf8", (err, data) => {
543
+ if (err) {
544
+ if (err.code === "ENOENT") {
545
+ return reject(new error_1.FirebaseError(`Could not find "${file}" in "${directory}"`, { original: err }));
546
+ }
547
+ reject(new error_1.FirebaseError(`Failed to read file "${file}" in "${directory}"`, { original: err }));
548
+ }
549
+ else {
550
+ resolve(data);
551
+ }
552
+ });
553
+ }).then((source) => {
554
+ return {
555
+ source,
556
+ sourceDirectory: directory,
557
+ };
558
+ });
559
+ }
560
+ exports.readFileFromDirectory = readFileFromDirectory;
561
+ function wrappedSafeLoad(source) {
562
+ try {
563
+ return yaml.parse(source);
564
+ }
565
+ catch (err) {
566
+ throw new error_1.FirebaseError(`YAML Error: ${err.message}`, { original: err });
567
+ }
568
+ }
569
+ exports.wrappedSafeLoad = wrappedSafeLoad;
570
+ function generateId(n = 6) {
571
+ const letters = "abcdefghijklmnopqrstuvwxyz";
572
+ const allChars = "01234567890-abcdefghijklmnopqrstuvwxyz";
573
+ let id = letters[Math.floor(Math.random() * letters.length)];
574
+ for (let i = 1; i < n; i++) {
575
+ const idx = Math.floor(Math.random() * allChars.length);
576
+ id += allChars[idx];
577
+ }
578
+ return id;
579
+ }
580
+ exports.generateId = generateId;
530
581
  function readSecretValue(prompt, dataFile) {
531
582
  if ((!dataFile || dataFile === "-") && tty.isatty(0)) {
532
583
  return (0, prompt_1.promptOnce)({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-tools",
3
- "version": "13.7.5",
3
+ "version": "13.8.1",
4
4
  "description": "Command-Line Interface for Firebase",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -58,6 +58,7 @@
58
58
  ]
59
59
  },
60
60
  "dependencies": {
61
+ "@google-cloud/cloud-sql-connector": "^1.2.3",
61
62
  "@google-cloud/pubsub": "^3.0.1",
62
63
  "abort-controller": "^3.0.0",
63
64
  "ajv": "^6.12.6",
@@ -82,8 +83,9 @@
82
83
  "form-data": "^4.0.0",
83
84
  "fs-extra": "^10.1.0",
84
85
  "fuzzy": "^0.1.3",
86
+ "gaxios": "^6.1.1",
85
87
  "glob": "^7.1.2",
86
- "google-auth-library": "^7.11.0",
88
+ "google-auth-library": "^9.7.0",
87
89
  "inquirer": "^8.2.6",
88
90
  "inquirer-autocomplete-prompt": "^2.0.1",
89
91
  "jsonwebtoken": "^9.0.0",
@@ -99,12 +101,14 @@
99
101
  "open": "^6.3.0",
100
102
  "ora": "^5.4.1",
101
103
  "p-limit": "^3.0.1",
104
+ "pg": "^8.11.3",
102
105
  "portfinder": "^1.0.32",
103
106
  "progress": "^2.0.3",
104
107
  "proxy-agent": "^6.3.0",
105
108
  "retry": "^0.13.1",
106
109
  "rimraf": "^3.0.0",
107
110
  "semver": "^7.5.2",
111
+ "sql-formatter": "^15.3.0",
108
112
  "stream-chain": "^2.2.4",
109
113
  "stream-json": "^1.7.3",
110
114
  "strip-ansi": "^6.0.1",
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "additionalProperties": false,
4
+ "definitions": {
5
+ "generatable": {
6
+ "additionalProperties": true,
7
+ "type": "object",
8
+ "properties": {
9
+ "outputDir": {
10
+ "type": "string",
11
+ "description": "Path to the directory where generated files should be written to."
12
+ }
13
+ }
14
+ }
15
+ },
16
+ "properties": {
17
+ "connectorId": {
18
+ "type": "string",
19
+ "description": "The ID of the Firebase Data Connect connector."
20
+ },
21
+ "authMode": {
22
+ "type": "string",
23
+ "description": "The authentication strategy to use for this connector"
24
+
25
+ },
26
+ "generate": {
27
+ "type": "object",
28
+ "additionalProperties": false,
29
+ "properties": {
30
+ "javascriptSdk": {
31
+ "type": "array",
32
+ "items": {
33
+ "$ref": "#/definitions/generatable"
34
+ },
35
+ "description": "Configuration for a generated Javascript SDK"
36
+ },
37
+ "kotlinSdk": {
38
+ "type": "array",
39
+ "items": {
40
+ "$ref": "#/definitions/generatable"
41
+ },
42
+ "description": "Configuration for a generated Kotlin SDK"
43
+ },
44
+ "swiftSdk": {
45
+ "type": "array",
46
+ "items": {
47
+ "$ref": "#/definitions/generatable"
48
+ },
49
+ "description": "Configuration for a generated Swift SDK"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "additionalProperties": false,
4
+ "definitions": {
5
+ "postgresql": {
6
+ "additionalProperties": false,
7
+ "type": "object",
8
+ "properties": {
9
+ "database": {
10
+ "type": "string",
11
+ "description": "The name of the PostgreSQL database."
12
+ },
13
+ "cloudSql": {
14
+ "additionalProperties": false,
15
+ "type": "object",
16
+ "properties": {
17
+ "instanceId": {
18
+ "type": "string",
19
+ "description": "The ID of the CloudSQL instance for this database"
20
+ }
21
+ }
22
+ }
23
+ }
24
+ },
25
+ "dataSource": {
26
+ "oneOf": [
27
+ {
28
+ "additionalProperties": false,
29
+ "type": "object",
30
+ "properties": {
31
+ "postgresql": {
32
+ "$ref": "#/definitions/postgresql"
33
+ }
34
+ }
35
+ }
36
+ ]
37
+ },
38
+ "schema": {
39
+ "additionalProperties": false,
40
+ "type": "object",
41
+ "properties": {
42
+ "source": {
43
+ "type": "string",
44
+ "description": "Relative path to directory containing GQL files defining the schema. If omitted, defaults to ./schema."
45
+ },
46
+ "datasource": {
47
+ "$ref": "#/definitions/dataSource"
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "properties": {
53
+ "specVersion": {
54
+ "type": "string",
55
+ "description": "The Firebase Data Connect API version to target. If omitted, defaults to the latest version"
56
+ },
57
+ "serviceId": {
58
+ "type": "string",
59
+ "description": "The ID of the Firebase Data Connect service."
60
+ },
61
+ "connectorDirs": {
62
+ "type": "array",
63
+ "items": {
64
+ "type": "string"
65
+ },
66
+ "description": "A list of directories containing conector.yaml files describing a connector to deploy."
67
+ },
68
+ "schema": {
69
+ "$ref": "#/definitions/schema"
70
+ }
71
+ }
72
+ }
@@ -271,6 +271,97 @@
271
271
  }
272
272
  ]
273
273
  },
274
+ "dataconnect": {
275
+ "anyOf": [
276
+ {
277
+ "additionalProperties": false,
278
+ "properties": {
279
+ "location": {
280
+ "type": "string"
281
+ },
282
+ "postdeploy": {
283
+ "anyOf": [
284
+ {
285
+ "items": {
286
+ "type": "string"
287
+ },
288
+ "type": "array"
289
+ },
290
+ {
291
+ "type": "string"
292
+ }
293
+ ]
294
+ },
295
+ "predeploy": {
296
+ "anyOf": [
297
+ {
298
+ "items": {
299
+ "type": "string"
300
+ },
301
+ "type": "array"
302
+ },
303
+ {
304
+ "type": "string"
305
+ }
306
+ ]
307
+ },
308
+ "source": {
309
+ "type": "string"
310
+ }
311
+ },
312
+ "required": [
313
+ "location",
314
+ "source"
315
+ ],
316
+ "type": "object"
317
+ },
318
+ {
319
+ "items": {
320
+ "additionalProperties": false,
321
+ "properties": {
322
+ "location": {
323
+ "type": "string"
324
+ },
325
+ "postdeploy": {
326
+ "anyOf": [
327
+ {
328
+ "items": {
329
+ "type": "string"
330
+ },
331
+ "type": "array"
332
+ },
333
+ {
334
+ "type": "string"
335
+ }
336
+ ]
337
+ },
338
+ "predeploy": {
339
+ "anyOf": [
340
+ {
341
+ "items": {
342
+ "type": "string"
343
+ },
344
+ "type": "array"
345
+ },
346
+ {
347
+ "type": "string"
348
+ }
349
+ ]
350
+ },
351
+ "source": {
352
+ "type": "string"
353
+ }
354
+ },
355
+ "required": [
356
+ "location",
357
+ "source"
358
+ ],
359
+ "type": "object"
360
+ },
361
+ "type": "array"
362
+ }
363
+ ]
364
+ },
274
365
  "emulators": {
275
366
  "additionalProperties": false,
276
367
  "properties": {
@@ -298,6 +389,18 @@
298
389
  },
299
390
  "type": "object"
300
391
  },
392
+ "dataconnect": {
393
+ "additionalProperties": false,
394
+ "properties": {
395
+ "host": {
396
+ "type": "string"
397
+ },
398
+ "port": {
399
+ "type": "number"
400
+ }
401
+ },
402
+ "type": "object"
403
+ },
301
404
  "eventarc": {
302
405
  "additionalProperties": false,
303
406
  "properties": {
@@ -3,8 +3,8 @@
3
3
  "description": "Greet the world",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
- "firebase-admin": "^11.5.0",
7
- "firebase-functions": "^4.2.0"
6
+ "firebase-admin": "^12.1.0",
7
+ "firebase-functions": "^5.0.0"
8
8
  },
9
9
  "devDependencies": {
10
10
  "eslint": "^8.15.1",
@@ -3,8 +3,8 @@
3
3
  "description": "Greet the world",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
- "firebase-admin": "^11.5.0",
7
- "firebase-functions": "^4.2.0"
6
+ "firebase-admin": "^12.1.0",
7
+ "firebase-functions": "^5.0.0"
8
8
  },
9
9
  "devDependencies": {
10
10
  "axios": "^1.3.2",
@@ -10,8 +10,8 @@
10
10
  },
11
11
  "main": "lib/index.js",
12
12
  "dependencies": {
13
- "firebase-admin": "^11.5.0",
14
- "firebase-functions": "^4.2.0"
13
+ "firebase-admin": "^12.1.0",
14
+ "firebase-functions": "^5.0.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/chai": "^4.3.4",
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "main": "lib/index.js",
10
10
  "dependencies": {
11
- "firebase-admin": "^11.5.0",
12
- "firebase-functions": "^4.2.0"
11
+ "firebase-admin": "^12.1.0",
12
+ "firebase-functions": "^5.0.0"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/chai": "^4.3.4",
@@ -0,0 +1,2 @@
1
+ connectorId: "__connectorId__"
2
+ authMode: "PUBLIC"
@@ -0,0 +1,10 @@
1
+ specVersion: "v1alpha"
2
+ serviceId: "__serviceId__"
3
+ schema:
4
+ source: "./schema"
5
+ datasource:
6
+ postgresql:
7
+ database: "__cloudSqlDatabase__"
8
+ cloudSql:
9
+ instanceId: "__cloudSqlInstanceId__"
10
+ connectorDirs: ["./connector"]
@@ -0,0 +1,4 @@
1
+ # # Example mutations
2
+ # mutation createOrder($name: String!) {
3
+ # order_insert(data : {name: $name})
4
+ # }
@@ -0,0 +1,6 @@
1
+ # # Example query
2
+ # query listOrders {
3
+ # orders {
4
+ # name
5
+ # }
6
+ # }
@@ -0,0 +1,15 @@
1
+ # # Example schema
2
+ # type Product @table {
3
+ # name: String!
4
+ # price: Int!
5
+ # }
6
+
7
+ # type Order @table {
8
+ # name: String!
9
+ # }
10
+
11
+ # type OrderItem @table(key: ["order", "product"]) {
12
+ # order: Order!
13
+ # product: Product!
14
+ # quantity: Int!
15
+ # }
@@ -1 +1,2 @@
1
- node_modules/
1
+ node_modules/
2
+ *.local
@@ -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",