firebase-tools-with-isolate 13.6.4 → 13.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/lib/api.js +18 -8
- package/lib/apiv2.js +19 -13
- package/lib/apphosting/app.js +69 -0
- package/lib/apphosting/config.js +97 -0
- package/lib/{init/features/apphosting → apphosting}/constants.js +2 -2
- package/lib/apphosting/githubConnections.js +263 -0
- package/lib/apphosting/index.js +319 -0
- package/lib/{init/features/apphosting → apphosting}/repo.js +12 -12
- package/lib/apphosting/secrets/dialogs.js +170 -0
- package/lib/apphosting/secrets/index.js +103 -0
- package/lib/checkValidTargetFilters.js +8 -1
- package/lib/commands/apphosting-backends-create.js +9 -4
- package/lib/commands/apphosting-backends-delete.js +27 -30
- package/lib/commands/apphosting-backends-get.js +8 -8
- package/lib/commands/apphosting-backends-list.js +6 -7
- package/lib/commands/apphosting-secrets-access.js +24 -0
- package/lib/commands/apphosting-secrets-describe.js +29 -0
- package/lib/commands/apphosting-secrets-grantaccess.js +49 -0
- package/lib/commands/apphosting-secrets-set.js +56 -0
- package/lib/commands/dataconnect-sdk-generate.js +37 -0
- package/lib/commands/dataconnect-services-list.js +80 -0
- package/lib/commands/dataconnect-sql-diff.js +25 -0
- package/lib/commands/dataconnect-sql-migrate.js +45 -0
- package/lib/commands/deploy.js +27 -1
- package/lib/commands/firestore-databases-create.js +1 -0
- package/lib/commands/firestore-databases-restore.js +1 -0
- package/lib/commands/functions-secrets-access.js +2 -2
- package/lib/commands/functions-secrets-describe.js +14 -0
- package/lib/commands/functions-secrets-destroy.js +2 -2
- package/lib/commands/functions-secrets-get.js +3 -17
- package/lib/commands/functions-secrets-prune.js +2 -1
- package/lib/commands/functions-secrets-set.js +3 -19
- package/lib/commands/index.js +25 -6
- package/lib/commands/init.js +10 -3
- package/lib/commands/setup-emulators-dataconnect.js +12 -0
- package/lib/config.js +1 -0
- package/lib/dataconnect/build.js +22 -0
- package/lib/dataconnect/checkIam.js +30 -0
- package/lib/dataconnect/client.js +112 -0
- package/lib/dataconnect/dataplaneClient.js +16 -0
- package/lib/dataconnect/ensureApis.js +12 -0
- package/lib/dataconnect/errors.js +29 -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 +12 -0
- package/lib/dataconnect/load.js +40 -0
- package/lib/dataconnect/names.js +46 -0
- package/lib/dataconnect/prompts.js +20 -0
- package/lib/dataconnect/provisionCloudSql.js +74 -0
- package/lib/dataconnect/schemaMigration.js +246 -0
- package/lib/dataconnect/types.js +22 -0
- package/lib/deploy/dataconnect/deploy.js +75 -0
- package/lib/deploy/dataconnect/index.js +9 -0
- package/lib/deploy/dataconnect/prepare.js +33 -0
- package/lib/deploy/dataconnect/release.js +65 -0
- package/lib/deploy/firestore/prepare.js +4 -2
- package/lib/deploy/functions/checkIam.js +6 -39
- package/lib/deploy/functions/containerCleaner.js +1 -15
- package/lib/deploy/functions/deploy.js +2 -2
- package/lib/deploy/functions/params.js +2 -2
- package/lib/deploy/functions/prepare.js +13 -3
- package/lib/deploy/functions/pricing.js +2 -2
- package/lib/deploy/functions/prompts.js +39 -7
- package/lib/deploy/functions/release/fabricator.js +12 -7
- package/lib/deploy/functions/release/index.js +17 -2
- package/lib/deploy/functions/release/planner.js +11 -3
- package/lib/deploy/functions/runtimes/discovery/index.js +3 -3
- package/lib/deploy/functions/runtimes/index.js +6 -43
- package/lib/deploy/functions/runtimes/node/index.js +3 -2
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +15 -34
- package/lib/deploy/functions/runtimes/python/index.js +10 -7
- package/lib/deploy/functions/runtimes/supported/index.js +80 -0
- package/lib/deploy/functions/runtimes/supported/types.js +74 -0
- package/lib/deploy/functions/services/index.js +4 -0
- package/lib/deploy/index.js +2 -0
- package/lib/downloadUtils.js +3 -2
- package/lib/emulator/constants.js +3 -0
- package/lib/emulator/controller.js +44 -13
- package/lib/emulator/dataconnectEmulator.js +95 -0
- package/lib/emulator/download.js +1 -1
- package/lib/emulator/downloadableEmulators.js +57 -8
- package/lib/emulator/functionsEmulator.js +2 -2
- package/lib/emulator/hub.js +5 -0
- package/lib/emulator/portUtils.js +3 -3
- package/lib/emulator/registry.js +6 -1
- package/lib/emulator/types.js +3 -0
- package/lib/experiments.js +31 -6
- package/lib/extensions/emulator/specHelper.js +9 -42
- package/lib/extensions/extensionsApi.js +2 -2
- package/lib/extensions/localHelper.js +3 -3
- package/lib/firestore/pretty-print.js +5 -0
- package/lib/frameworks/astro/index.js +1 -1
- package/lib/frameworks/flutter/index.js +2 -2
- package/lib/frameworks/next/constants.js +2 -1
- package/lib/frameworks/next/index.js +27 -15
- package/lib/frameworks/next/utils.js +33 -3
- package/lib/functional.js +2 -2
- package/lib/functions/events/v2.js +7 -1
- package/lib/functions/python.js +4 -3
- package/lib/functions/secrets.js +40 -22
- package/lib/gcp/apphosting.js +25 -3
- package/lib/gcp/cloudbuild.js +7 -3
- package/lib/gcp/cloudfunctions.js +5 -5
- package/lib/gcp/cloudfunctionsv2.js +3 -3
- package/lib/gcp/cloudscheduler.js +2 -2
- package/lib/gcp/cloudsql/cloudsqladmin.js +174 -0
- package/lib/gcp/cloudsql/connect.js +144 -0
- package/lib/gcp/cloudsql/fbToolsAuthClient.js +44 -0
- package/lib/gcp/computeEngine.js +7 -0
- package/lib/gcp/devConnect.js +25 -12
- package/lib/gcp/firedata.js +27 -0
- package/lib/gcp/iam.js +41 -1
- package/lib/gcp/secretManager.js +55 -7
- package/lib/gcp/serviceusage.js +24 -5
- package/lib/hosting/interactive.js +4 -0
- package/lib/init/features/dataconnect/index.js +166 -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/functions/python.js +4 -3
- package/lib/init/features/genkit.js +53 -0
- package/lib/init/features/hosting/github.js +4 -5
- package/lib/init/features/index.js +6 -2
- 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 +9 -1
- package/lib/requireAuth.js +1 -8
- package/lib/requireTosAcceptance.js +22 -0
- package/lib/utils.js +76 -8
- package/package.json +11 -5
- package/schema/connector-yaml.json +54 -0
- package/schema/dataconnect-yaml.json +72 -0
- package/schema/firebase-config.json +115 -2
- 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/_eslintrc +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/init/features/apphosting/index.js +0 -229
- package/lib/monospace/index.js +0 -82
- /package/lib/{monospace/interfaces.js → gcp/cloudsql/types.js} +0 -0
package/lib/utils.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
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
|
+
const tty = require("tty");
|
|
5
7
|
const path = require("node:path");
|
|
8
|
+
const yaml = require("yaml");
|
|
6
9
|
const _ = require("lodash");
|
|
7
10
|
const url = require("url");
|
|
8
11
|
const http = require("http");
|
|
@@ -19,12 +22,14 @@ const portfinder_1 = require("portfinder");
|
|
|
19
22
|
const configstore_1 = require("./configstore");
|
|
20
23
|
const error_1 = require("./error");
|
|
21
24
|
const logger_1 = require("./logger");
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
25
|
+
const prompt_1 = require("./prompt");
|
|
26
|
+
exports.IS_WINDOWS = process.platform === "win32";
|
|
27
|
+
const SUCCESS_CHAR = exports.IS_WINDOWS ? "+" : "✔";
|
|
28
|
+
const WARNING_CHAR = exports.IS_WINDOWS ? "!" : "⚠";
|
|
29
|
+
const ERROR_CHAR = exports.IS_WINDOWS ? "!!" : "⬢";
|
|
26
30
|
const THIRTY_DAYS_IN_MILLISECONDS = 30 * 24 * 60 * 60 * 1000;
|
|
27
31
|
exports.envOverrides = [];
|
|
32
|
+
exports.vscodeEnvVars = {};
|
|
28
33
|
function consoleUrl(project, path) {
|
|
29
34
|
const api = require("./api");
|
|
30
35
|
return `${api.consoleOrigin()}/project/${project}${path}`;
|
|
@@ -40,8 +45,12 @@ function getInheritedOption(options, key) {
|
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
exports.getInheritedOption = getInheritedOption;
|
|
48
|
+
function setVSCodeEnvVars(envVar, value) {
|
|
49
|
+
exports.vscodeEnvVars[envVar] = value;
|
|
50
|
+
}
|
|
51
|
+
exports.setVSCodeEnvVars = setVSCodeEnvVars;
|
|
43
52
|
function envOverride(envname, value, coerce) {
|
|
44
|
-
const currentEnvValue = process.env[envname];
|
|
53
|
+
const currentEnvValue = isVSCodeExtension() && exports.vscodeEnvVars[envname] ? exports.vscodeEnvVars[envname] : process.env[envname];
|
|
45
54
|
if (currentEnvValue && currentEnvValue.length) {
|
|
46
55
|
exports.envOverrides.push(envname);
|
|
47
56
|
if (coerce) {
|
|
@@ -148,7 +157,7 @@ function allSettled(promises) {
|
|
|
148
157
|
}
|
|
149
158
|
exports.allSettled = allSettled;
|
|
150
159
|
function explainStdin() {
|
|
151
|
-
if (IS_WINDOWS) {
|
|
160
|
+
if (exports.IS_WINDOWS) {
|
|
152
161
|
throw new error_1.FirebaseError("STDIN input is not available on Windows.", {
|
|
153
162
|
exit: 1,
|
|
154
163
|
});
|
|
@@ -333,6 +342,10 @@ async function promiseWithSpinner(action, message) {
|
|
|
333
342
|
return data;
|
|
334
343
|
}
|
|
335
344
|
exports.promiseWithSpinner = promiseWithSpinner;
|
|
345
|
+
function sleep(ms) {
|
|
346
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
347
|
+
}
|
|
348
|
+
exports.sleep = sleep;
|
|
336
349
|
function createDestroyer(server) {
|
|
337
350
|
const connections = new Set();
|
|
338
351
|
server.on("connection", (conn) => {
|
|
@@ -524,3 +537,58 @@ function getHostnameFromUrl(url) {
|
|
|
524
537
|
}
|
|
525
538
|
}
|
|
526
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;
|
|
581
|
+
function readSecretValue(prompt, dataFile) {
|
|
582
|
+
if ((!dataFile || dataFile === "-") && tty.isatty(0)) {
|
|
583
|
+
return (0, prompt_1.promptOnce)({
|
|
584
|
+
type: "password",
|
|
585
|
+
message: prompt,
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
let input = 0;
|
|
589
|
+
if (dataFile && dataFile !== "-") {
|
|
590
|
+
input = dataFile;
|
|
591
|
+
}
|
|
592
|
+
return Promise.resolve(fs.readFileSync(input, "utf-8"));
|
|
593
|
+
}
|
|
594
|
+
exports.readSecretValue = readSecretValue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firebase-tools-with-isolate",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.9.0",
|
|
4
4
|
"description": "Command-Line Interface for Firebase with monorepo support",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -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,6 +94,7 @@
|
|
|
93
94
|
]
|
|
94
95
|
},
|
|
95
96
|
"dependencies": {
|
|
97
|
+
"@google-cloud/cloud-sql-connector": "^1.2.3",
|
|
96
98
|
"@google-cloud/pubsub": "^3.0.1",
|
|
97
99
|
"abort-controller": "^3.0.0",
|
|
98
100
|
"ajv": "^6.12.6",
|
|
@@ -117,12 +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.
|
|
125
|
-
"js-yaml": "^3.13.1",
|
|
127
|
+
"isolate-package": "^1.16.0",
|
|
126
128
|
"jsonwebtoken": "^9.0.0",
|
|
127
129
|
"leven": "^3.1.0",
|
|
128
130
|
"libsodium-wrappers": "^0.7.10",
|
|
@@ -136,12 +138,14 @@
|
|
|
136
138
|
"open": "^6.3.0",
|
|
137
139
|
"ora": "^5.4.1",
|
|
138
140
|
"p-limit": "^3.0.1",
|
|
141
|
+
"pg": "^8.11.3",
|
|
139
142
|
"portfinder": "^1.0.32",
|
|
140
143
|
"progress": "^2.0.3",
|
|
141
144
|
"proxy-agent": "^6.3.0",
|
|
142
145
|
"retry": "^0.13.1",
|
|
143
146
|
"rimraf": "^3.0.0",
|
|
144
147
|
"semver": "^7.5.2",
|
|
148
|
+
"sql-formatter": "^15.3.0",
|
|
145
149
|
"stream-chain": "^2.2.4",
|
|
146
150
|
"stream-json": "^1.7.3",
|
|
147
151
|
"strip-ansi": "^6.0.1",
|
|
@@ -155,7 +159,8 @@
|
|
|
155
159
|
"uuid": "^8.3.2",
|
|
156
160
|
"winston": "^3.0.0",
|
|
157
161
|
"winston-transport": "^4.4.0",
|
|
158
|
-
"ws": "^7.2.3"
|
|
162
|
+
"ws": "^7.2.3",
|
|
163
|
+
"yaml": "^2.4.1"
|
|
159
164
|
},
|
|
160
165
|
"devDependencies": {
|
|
161
166
|
"@angular-devkit/architect": "^0.1402.2",
|
|
@@ -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": {
|
|
@@ -622,7 +725,12 @@
|
|
|
622
725
|
"nodejs14",
|
|
623
726
|
"nodejs16",
|
|
624
727
|
"nodejs18",
|
|
625
|
-
"nodejs20"
|
|
728
|
+
"nodejs20",
|
|
729
|
+
"nodejs6",
|
|
730
|
+
"nodejs8",
|
|
731
|
+
"python310",
|
|
732
|
+
"python311",
|
|
733
|
+
"python312"
|
|
626
734
|
],
|
|
627
735
|
"type": "string"
|
|
628
736
|
},
|
|
@@ -678,7 +786,12 @@
|
|
|
678
786
|
"nodejs14",
|
|
679
787
|
"nodejs16",
|
|
680
788
|
"nodejs18",
|
|
681
|
-
"nodejs20"
|
|
789
|
+
"nodejs20",
|
|
790
|
+
"nodejs6",
|
|
791
|
+
"nodejs8",
|
|
792
|
+
"python310",
|
|
793
|
+
"python311",
|
|
794
|
+
"python312"
|
|
682
795
|
],
|
|
683
796
|
"type": "string"
|
|
684
797
|
},
|
|
@@ -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,
|
|
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
|
|
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
|