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.
- package/lib/api.js +18 -8
- package/lib/apiv2.js +19 -13
- package/lib/apphosting/app.js +40 -59
- package/lib/apphosting/constants.js +2 -2
- package/lib/apphosting/githubConnections.js +7 -9
- package/lib/apphosting/index.js +122 -58
- package/lib/apphosting/repo.js +3 -3
- package/lib/apphosting/secrets/index.js +7 -1
- package/lib/checkValidTargetFilters.js +8 -1
- package/lib/commands/apphosting-backends-create.js +7 -6
- package/lib/commands/apphosting-backends-delete.js +24 -28
- package/lib/commands/apphosting-backends-list.js +4 -5
- package/lib/commands/apphosting-secrets-access.js +1 -1
- package/lib/commands/apphosting-secrets-grantaccess.js +11 -7
- package/lib/commands/apphosting-secrets-set.js +1 -1
- package/lib/commands/dataconnect-sdk-generate.js +43 -0
- package/lib/commands/dataconnect-services-list.js +74 -0
- package/lib/commands/dataconnect-sql-diff.js +25 -0
- package/lib/commands/dataconnect-sql-migrate.js +44 -0
- package/lib/commands/deploy.js +27 -1
- package/lib/commands/index.js +11 -0
- package/lib/commands/init.js +10 -3
- package/lib/commands/setup-emulators-dataconnect.js +12 -0
- package/lib/config.js +1 -0
- package/lib/crashlytics/buildToolsJarHelper.js +2 -1
- package/lib/dataconnect/build.js +14 -0
- package/lib/dataconnect/checkIam.js +30 -0
- package/lib/dataconnect/client.js +104 -0
- package/lib/dataconnect/dataplaneClient.js +16 -0
- package/lib/dataconnect/ensureApis.js +12 -0
- package/lib/dataconnect/errors.js +37 -0
- package/lib/dataconnect/fileUtils.js +92 -0
- package/lib/dataconnect/filters.js +45 -0
- package/lib/dataconnect/freeTrial.js +22 -0
- package/lib/dataconnect/graphqlError.js +15 -0
- package/lib/dataconnect/load.js +40 -0
- package/lib/dataconnect/names.js +66 -0
- package/lib/dataconnect/prompts.js +20 -0
- package/lib/dataconnect/provisionCloudSql.js +91 -0
- package/lib/dataconnect/schemaMigration.js +278 -0
- package/lib/dataconnect/types.js +22 -0
- package/lib/deploy/dataconnect/deploy.js +76 -0
- package/lib/deploy/dataconnect/index.js +9 -0
- package/lib/deploy/dataconnect/prepare.js +33 -0
- package/lib/deploy/dataconnect/release.js +64 -0
- package/lib/deploy/functions/checkIam.js +4 -34
- package/lib/deploy/functions/prepare.js +1 -1
- package/lib/deploy/functions/release/fabricator.js +7 -2
- package/lib/deploy/functions/runtimes/discovery/index.js +2 -1
- package/lib/deploy/functions/runtimes/supported/types.js +6 -0
- package/lib/deploy/index.js +2 -0
- package/lib/downloadUtils.js +2 -2
- package/lib/emulator/constants.js +3 -0
- package/lib/emulator/controller.js +40 -12
- package/lib/emulator/dataconnectEmulator.js +137 -0
- package/lib/emulator/download.js +5 -1
- package/lib/emulator/downloadableEmulators.js +92 -16
- package/lib/emulator/portUtils.js +13 -4
- package/lib/emulator/registry.js +6 -1
- package/lib/emulator/storage/rules/runtime.js +1 -1
- package/lib/emulator/types.js +3 -0
- package/lib/experiments.js +19 -6
- package/lib/extensions/emulator/specHelper.js +5 -39
- package/lib/frameworks/angular/utils.js +8 -3
- package/lib/frameworks/next/index.js +6 -4
- package/lib/frameworks/next/utils.js +1 -1
- package/lib/functions/python.js +4 -3
- package/lib/gcp/apphosting.js +11 -1
- package/lib/gcp/cloudsql/cloudsqladmin.js +187 -0
- package/lib/gcp/cloudsql/connect.js +144 -0
- package/lib/gcp/cloudsql/fbToolsAuthClient.js +44 -0
- package/lib/gcp/devConnect.js +1 -1
- package/lib/gcp/firedata.js +27 -0
- package/lib/gcp/iam.js +33 -1
- package/lib/gcp/secretManager.js +1 -1
- package/lib/hosting/interactive.js +4 -0
- package/lib/init/features/dataconnect/index.js +228 -0
- package/lib/init/features/emulators.js +13 -1
- package/lib/init/features/functions/index.js +19 -3
- package/lib/init/features/functions/npm-dependencies.js +12 -23
- package/lib/init/features/genkit.js +53 -0
- package/lib/init/features/index.js +5 -1
- package/lib/init/index.js +2 -0
- package/lib/init/spawn.js +23 -0
- package/lib/logger.js +22 -2
- package/lib/operation-poller.js +8 -2
- package/lib/rc.js +7 -1
- package/lib/requireAuth.js +4 -8
- package/lib/requireTosAcceptance.js +22 -0
- package/lib/track.js +29 -2
- package/lib/utils.js +55 -4
- package/package.json +10 -4
- package/schema/connector-yaml.json +54 -0
- package/schema/dataconnect-yaml.json +72 -0
- package/schema/firebase-config.json +105 -0
- package/templates/extensions/javascript/package.lint.json +2 -2
- package/templates/extensions/javascript/package.nolint.json +2 -2
- package/templates/extensions/typescript/package.lint.json +2 -2
- package/templates/extensions/typescript/package.nolint.json +2 -2
- package/templates/init/dataconnect/connector.yaml +2 -0
- package/templates/init/dataconnect/dataconnect.yaml +10 -0
- package/templates/init/dataconnect/mutations.gql +30 -0
- package/templates/init/dataconnect/queries.gql +51 -0
- package/templates/init/dataconnect/schema.gql +28 -0
- package/templates/init/functions/javascript/_gitignore +2 -1
- package/templates/init/functions/javascript/package.lint.json +2 -2
- package/templates/init/functions/javascript/package.nolint.json +2 -2
- package/templates/init/functions/python/_gitignore +1 -0
- package/templates/init/functions/typescript/_gitignore +1 -0
- package/templates/init/functions/typescript/package.lint.json +2 -2
- package/templates/init/functions/typescript/package.nolint.json +2 -2
- package/lib/monospace/index.js +0 -82
- /package/lib/{monospace/interfaces.js → gcp/cloudsql/types.js} +0 -0
package/lib/track.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.track = exports.cliSession = exports.emulatorSession = exports.trackEmulator = exports.trackGA4 = exports.usageEnabled = exports.GA4_PROPERTIES = void 0;
|
|
3
|
+
exports.track = exports.cliSession = exports.vscodeSession = exports.emulatorSession = exports.trackVSCode = exports.trackEmulator = exports.trackGA4 = exports.usageEnabled = exports.GA4_PROPERTIES = void 0;
|
|
4
4
|
const node_fetch_1 = require("node-fetch");
|
|
5
5
|
const ua = require("universal-analytics");
|
|
6
6
|
const uuid_1 = require("uuid");
|
|
@@ -19,6 +19,11 @@ exports.GA4_PROPERTIES = {
|
|
|
19
19
|
apiSecret: process.env.FIREBASE_EMULATOR_GA4_API_SECRET || "2V_zBYc4TdeoppzDaIu0zw",
|
|
20
20
|
clientIdKey: "emulator-analytics-clientId",
|
|
21
21
|
},
|
|
22
|
+
vscode: {
|
|
23
|
+
measurementId: process.env.FIREBASE_VSCODE_GA4_MEASUREMENT_ID || "G-FYJ489XM2T",
|
|
24
|
+
apiSecret: process.env.FIREBASE_VSCODE_GA4_API_SECRET || "XAEWKHe7RM-ygCK44N52Ww",
|
|
25
|
+
clientIdKey: "vscode-analytics-clientId",
|
|
26
|
+
},
|
|
22
27
|
};
|
|
23
28
|
function usageEnabled() {
|
|
24
29
|
return !!process.env.IS_FIREBASE_CLI && !!configstore_1.configstore.get("usage");
|
|
@@ -69,6 +74,24 @@ async function trackEmulator(eventName, params) {
|
|
|
69
74
|
});
|
|
70
75
|
}
|
|
71
76
|
exports.trackEmulator = trackEmulator;
|
|
77
|
+
async function trackVSCode(eventName, params) {
|
|
78
|
+
const session = vscodeSession();
|
|
79
|
+
if (!session) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
session.debugMode = process.env.VSCODE_DEBUG_MODE === "true";
|
|
83
|
+
const oldTotalEngagementSeconds = session.totalEngagementSeconds;
|
|
84
|
+
session.totalEngagementSeconds = process.uptime();
|
|
85
|
+
const duration = session.totalEngagementSeconds - oldTotalEngagementSeconds;
|
|
86
|
+
return _ga4Track({
|
|
87
|
+
session,
|
|
88
|
+
apiSecret: exports.GA4_PROPERTIES.vscode.apiSecret,
|
|
89
|
+
eventName,
|
|
90
|
+
params,
|
|
91
|
+
duration,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
exports.trackVSCode = trackVSCode;
|
|
72
95
|
async function _ga4Track(args) {
|
|
73
96
|
const { session, apiSecret, eventName, params, duration } = args;
|
|
74
97
|
session.commandName = params?.command_name || session.commandName;
|
|
@@ -128,13 +151,17 @@ function emulatorSession() {
|
|
|
128
151
|
return session("emulator");
|
|
129
152
|
}
|
|
130
153
|
exports.emulatorSession = emulatorSession;
|
|
154
|
+
function vscodeSession() {
|
|
155
|
+
return session("vscode");
|
|
156
|
+
}
|
|
157
|
+
exports.vscodeSession = vscodeSession;
|
|
131
158
|
function cliSession() {
|
|
132
159
|
return session("cli");
|
|
133
160
|
}
|
|
134
161
|
exports.cliSession = cliSession;
|
|
135
162
|
function session(propertyName) {
|
|
136
163
|
const validateOnly = !!process.env.FIREBASE_CLI_MP_VALIDATE;
|
|
137
|
-
if (!usageEnabled()) {
|
|
164
|
+
if (!usageEnabled() && propertyName !== "vscode") {
|
|
138
165
|
if (validateOnly) {
|
|
139
166
|
logger_1.logger.warn("Google Analytics is DISABLED. To enable, (re)login and opt in to collection.");
|
|
140
167
|
}
|
package/lib/utils.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.readSecretValue = void 0;
|
|
5
|
-
const fs = require("
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools-with-isolate",
|
|
3
|
-
"version": "13.7.3",
|
|
4
3
|
"description": "Command-Line Interface for Firebase with monorepo support",
|
|
4
|
+
"version": "13.11.2",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"firebase": "lib/bin/firebase.js"
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"test": "npm run lint:quiet && npm run test:compile && npm run mocha",
|
|
28
28
|
"test:client-integration": "bash ./scripts/client-integration-tests/run.sh",
|
|
29
29
|
"test:compile": "tsc --project tsconfig.compile.json",
|
|
30
|
+
"test:dataconnect-deploy": "bash ./scripts/dataconnect-test/run.sh",
|
|
30
31
|
"test:all-emulators": "npm run test:emulator && npm run test:extensions-emulator && npm run test:import-export && npm run test:storage-emulator-integration",
|
|
31
32
|
"test:emulator": "bash ./scripts/emulator-tests/run.sh",
|
|
32
33
|
"test:extensions-deploy": "bash ./scripts/extensions-deploy-tests/run.sh",
|
|
@@ -93,7 +94,8 @@
|
|
|
93
94
|
]
|
|
94
95
|
},
|
|
95
96
|
"dependencies": {
|
|
96
|
-
"@google-cloud/
|
|
97
|
+
"@google-cloud/cloud-sql-connector": "^1.2.3",
|
|
98
|
+
"@google-cloud/pubsub": "^4.4.0",
|
|
97
99
|
"abort-controller": "^3.0.0",
|
|
98
100
|
"ajv": "^6.12.6",
|
|
99
101
|
"archiver": "^5.0.0",
|
|
@@ -117,11 +119,12 @@
|
|
|
117
119
|
"form-data": "^4.0.0",
|
|
118
120
|
"fs-extra": "^10.1.0",
|
|
119
121
|
"fuzzy": "^0.1.3",
|
|
122
|
+
"gaxios": "^6.1.1",
|
|
120
123
|
"glob": "^7.1.2",
|
|
121
|
-
"google-auth-library": "^7.
|
|
124
|
+
"google-auth-library": "^9.7.0",
|
|
122
125
|
"inquirer": "^8.2.6",
|
|
123
126
|
"inquirer-autocomplete-prompt": "^2.0.1",
|
|
124
|
-
"isolate-package": "^1.
|
|
127
|
+
"isolate-package": "^1.18.0",
|
|
125
128
|
"jsonwebtoken": "^9.0.0",
|
|
126
129
|
"leven": "^3.1.0",
|
|
127
130
|
"libsodium-wrappers": "^0.7.10",
|
|
@@ -135,12 +138,14 @@
|
|
|
135
138
|
"open": "^6.3.0",
|
|
136
139
|
"ora": "^5.4.1",
|
|
137
140
|
"p-limit": "^3.0.1",
|
|
141
|
+
"pg": "^8.11.3",
|
|
138
142
|
"portfinder": "^1.0.32",
|
|
139
143
|
"progress": "^2.0.3",
|
|
140
144
|
"proxy-agent": "^6.3.0",
|
|
141
145
|
"retry": "^0.13.1",
|
|
142
146
|
"rimraf": "^3.0.0",
|
|
143
147
|
"semver": "^7.5.2",
|
|
148
|
+
"sql-formatter": "^15.3.0",
|
|
144
149
|
"stream-chain": "^2.2.4",
|
|
145
150
|
"stream-json": "^1.7.3",
|
|
146
151
|
"strip-ansi": "^6.0.1",
|
|
@@ -189,6 +194,7 @@
|
|
|
189
194
|
"@types/multer": "^1.4.3",
|
|
190
195
|
"@types/node": "^18.19.1",
|
|
191
196
|
"@types/node-fetch": "^2.5.12",
|
|
197
|
+
"@types/pg": "^8.11.2",
|
|
192
198
|
"@types/progress": "^2.0.3",
|
|
193
199
|
"@types/puppeteer": "^5.4.2",
|
|
194
200
|
"@types/react": "^18.2.58",
|
|
@@ -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": {
|
|
@@ -623,6 +726,7 @@
|
|
|
623
726
|
"nodejs16",
|
|
624
727
|
"nodejs18",
|
|
625
728
|
"nodejs20",
|
|
729
|
+
"nodejs22",
|
|
626
730
|
"nodejs6",
|
|
627
731
|
"nodejs8",
|
|
628
732
|
"python310",
|
|
@@ -684,6 +788,7 @@
|
|
|
684
788
|
"nodejs16",
|
|
685
789
|
"nodejs18",
|
|
686
790
|
"nodejs20",
|
|
791
|
+
"nodejs22",
|
|
687
792
|
"nodejs6",
|
|
688
793
|
"nodejs8",
|
|
689
794
|
"python310",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# # Example mutations for a simple email app
|
|
2
|
+
|
|
3
|
+
# mutation CreateUser($uid: String, $name: String, $address: String) @auth(level: NO_ACCESS) {
|
|
4
|
+
## <type>_insert lets you create a new row in your table.
|
|
5
|
+
# user_insert(data: {
|
|
6
|
+
# uid: $uid,
|
|
7
|
+
# name: $name,
|
|
8
|
+
# address: $address
|
|
9
|
+
# })
|
|
10
|
+
# }
|
|
11
|
+
# mutation CreateEmail($content: String, $subject: String, $fromUid: String) @auth(level: PUBLIC) {
|
|
12
|
+
# email_insert(data: {
|
|
13
|
+
# text: $content, # The request variable name doesn't have to match the field name.
|
|
14
|
+
# subject: $subject,
|
|
15
|
+
# fromUid: $fromUid,
|
|
16
|
+
## Server values let your service populate data for you
|
|
17
|
+
## Here, we use sent_date: { today: true } to set 'sent' to today's date.
|
|
18
|
+
# sent_date: { today: true }
|
|
19
|
+
# })
|
|
20
|
+
# }
|
|
21
|
+
# mutation CreateRecipient($emailId: UUID, $uid: String) @auth(level: PUBLIC) {
|
|
22
|
+
# recipient_insert(data: {
|
|
23
|
+
# emailId: $emailId,
|
|
24
|
+
# userUid: $uid
|
|
25
|
+
# })
|
|
26
|
+
# }
|
|
27
|
+
# mutation DeleteEmail($emailId: UUID, $uid: String) @auth(level: PUBLIC) {
|
|
28
|
+
## <type>_ delete lets you delete rows from your table.
|
|
29
|
+
# recipient_delete(key: {emailId: $emailId, userUid: $uid})
|
|
30
|
+
# }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# # Example queries for a simple email app.
|
|
2
|
+
|
|
3
|
+
## @auth() directives control who can call each operation.
|
|
4
|
+
## Only admins should be able to list all users, so we use NO_ACCESS
|
|
5
|
+
# query ListUsers @auth(level: NO_ACCESS) {
|
|
6
|
+
# users { uid, name, email: address }
|
|
7
|
+
# }
|
|
8
|
+
|
|
9
|
+
## Everyone should be able to see their inbox though, so we use PUBLIC
|
|
10
|
+
# query ListInbox(
|
|
11
|
+
# $uid: String
|
|
12
|
+
# ) @auth(level: PUBLIC) {
|
|
13
|
+
## where allows you to filter lists
|
|
14
|
+
## Here, we use it to filter to only emails where this user is one of the recipients.
|
|
15
|
+
# emails(where: {
|
|
16
|
+
# users_via_Recipient: {
|
|
17
|
+
# exist: { uid: { eq: $uid }
|
|
18
|
+
# }}
|
|
19
|
+
# }) {
|
|
20
|
+
# id subject sent
|
|
21
|
+
# content: text # Select the `text` field but alias it as `content` in the response.
|
|
22
|
+
# sender: from { name email: address uid }
|
|
23
|
+
|
|
24
|
+
## <field>_on_<foreign_key_field> makes it easy to grab info from another table
|
|
25
|
+
## Here, we use it to grab all the recipients of the email.
|
|
26
|
+
# to: recipients_on_email {
|
|
27
|
+
# user { name email: address uid }
|
|
28
|
+
# }
|
|
29
|
+
# }
|
|
30
|
+
# }
|
|
31
|
+
|
|
32
|
+
# query GetUidByEmail($emails: [String!]) @auth(level: PUBLIC) {
|
|
33
|
+
# users(where: { address: { in: $emails } }) {
|
|
34
|
+
# uid email: address
|
|
35
|
+
# }
|
|
36
|
+
# }
|
|
37
|
+
|
|
38
|
+
# query ListSent(
|
|
39
|
+
# $uid: String
|
|
40
|
+
# ) @auth(level: PUBLIC) {
|
|
41
|
+
# emails(where: {
|
|
42
|
+
# fromUid: { eq: $uid }
|
|
43
|
+
# }) {
|
|
44
|
+
# id subject sent
|
|
45
|
+
# content: text
|
|
46
|
+
# sender: from { name email: address uid }
|
|
47
|
+
# to: recipients_on_email {
|
|
48
|
+
# user { name email: address uid }
|
|
49
|
+
# }
|
|
50
|
+
# }
|
|
51
|
+
# }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## Example schema for simple email app
|
|
2
|
+
# type User @table(key: "uid") {
|
|
3
|
+
# uid: String!
|
|
4
|
+
# name: String!
|
|
5
|
+
# address: String!
|
|
6
|
+
# }
|
|
7
|
+
|
|
8
|
+
# type Email @table {
|
|
9
|
+
# subject: String!
|
|
10
|
+
# sent: Date!
|
|
11
|
+
# text: String!
|
|
12
|
+
# from: User!
|
|
13
|
+
# }
|
|
14
|
+
|
|
15
|
+
# type Recipient @table(key: ["email", "user"]) {
|
|
16
|
+
# email: Email!
|
|
17
|
+
# user: User!
|
|
18
|
+
# }
|
|
19
|
+
|
|
20
|
+
# type EmailMeta @table(key: ["user", "email"]) {
|
|
21
|
+
# user: User!
|
|
22
|
+
# email: Email!
|
|
23
|
+
# labels: [String]
|
|
24
|
+
# read: Boolean!
|
|
25
|
+
# starred: Boolean!
|
|
26
|
+
# muted: Boolean!
|
|
27
|
+
# snoozed: Date
|
|
28
|
+
# }
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
node_modules/
|
|
1
|
+
node_modules/
|
|
2
|
+
*.local
|