firebase-tools-with-isolate 13.9.0 → 13.15.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api.js +4 -2
- package/lib/apphosting/githubConnections.js +125 -37
- package/lib/apphosting/index.js +3 -8
- package/lib/auth.js +14 -15
- package/lib/bin/firebase.js +7 -5
- package/lib/commands/dataconnect-sdk-generate.js +17 -15
- package/lib/commands/dataconnect-services-list.js +2 -8
- package/lib/commands/dataconnect-sql-migrate.js +0 -1
- package/lib/commands/deploy.js +7 -1
- package/lib/commands/ext-configure.js +1 -6
- package/lib/commands/ext-dev-init.js +27 -30
- package/lib/commands/ext-dev-upload.js +4 -6
- package/lib/commands/ext-info.js +3 -5
- package/lib/commands/ext-install.js +0 -5
- package/lib/commands/ext-uninstall.js +0 -5
- package/lib/commands/ext-update.js +0 -5
- package/lib/commands/firestore-backups-schedules-create.js +11 -14
- package/lib/commands/firestore-backups-schedules-list.js +1 -1
- package/lib/commands/firestore-backups-schedules-update.js +4 -3
- package/lib/commands/firestore-databases-create.js +24 -7
- package/lib/commands/firestore-databases-restore.js +4 -4
- package/lib/commands/firestore-databases-update.js +5 -6
- package/lib/commands/functions-secrets-set.js +9 -6
- package/lib/commands/help.js +2 -0
- package/lib/commands/hosting-channel-create.js +1 -1
- package/lib/commands/hosting-channel-delete.js +1 -1
- package/lib/commands/hosting-channel-deploy.js +1 -1
- package/lib/commands/hosting-clone.js +1 -2
- package/lib/commands/index.js +9 -11
- package/lib/commands/init.js +16 -12
- package/lib/commands/login.js +1 -2
- package/lib/commands/setup-emulators-dataconnect.js +22 -3
- package/lib/config.js +5 -0
- package/lib/crashlytics/buildToolsJarHelper.js +2 -1
- package/lib/dataconnect/build.js +1 -9
- package/lib/dataconnect/client.js +67 -28
- package/lib/dataconnect/errors.js +17 -9
- package/lib/dataconnect/fileUtils.js +30 -7
- package/lib/dataconnect/filters.js +12 -1
- package/lib/dataconnect/graphqlError.js +6 -3
- package/lib/dataconnect/load.js +9 -7
- package/lib/dataconnect/names.js +21 -1
- package/lib/dataconnect/provisionCloudSql.js +37 -20
- package/lib/dataconnect/schemaMigration.js +119 -66
- package/lib/dataconnect/types.js +8 -1
- package/lib/deploy/dataconnect/deploy.js +1 -0
- package/lib/deploy/dataconnect/prepare.js +16 -2
- package/lib/deploy/dataconnect/release.js +0 -1
- package/lib/deploy/functions/build.js +10 -1
- package/lib/deploy/functions/prepare.js +1 -1
- package/lib/deploy/functions/runtimes/discovery/index.js +2 -1
- package/lib/deploy/functions/runtimes/supported/types.js +6 -0
- package/lib/emulator/adminSdkConfig.test.js +16 -0
- package/lib/emulator/constants.js +1 -0
- package/lib/emulator/controller.js +4 -9
- package/lib/emulator/dataconnectEmulator.js +181 -35
- package/lib/emulator/download.js +4 -0
- package/lib/emulator/downloadableEmulators.js +54 -28
- package/lib/emulator/eventarcEmulator.js +68 -18
- package/lib/emulator/functionsEmulator.js +89 -0
- package/lib/emulator/functionsEmulatorShared.js +4 -0
- package/lib/emulator/hub.js +1 -1
- package/lib/emulator/portUtils.js +20 -2
- package/lib/emulator/pubsubEmulator.js +1 -1
- package/lib/emulator/registry.js +1 -1
- package/lib/emulator/storage/apis/shared.js +2 -1
- package/lib/emulator/storage/persistence.js +5 -13
- package/lib/emulator/storage/rfc.js +9 -0
- package/lib/emulator/storage/rules/config.js +4 -2
- package/lib/emulator/storage/rules/runtime.js +1 -1
- package/lib/experiments.js +8 -3
- package/lib/extensions/askUserForParam.js +1 -1
- package/lib/extensions/change-log.js +2 -4
- package/lib/extensions/displayExtensionInfo.js +0 -5
- package/lib/extensions/extensionsHelper.js +5 -7
- package/lib/extensions/provisioningHelper.js +1 -1
- package/lib/extensions/updateHelper.js +1 -2
- package/lib/extensions/warnings.js +2 -7
- package/lib/firestore/api-sort.test.js +74 -0
- package/lib/firestore/api.js +8 -7
- package/lib/firestore/backupUtils.test.js +18 -0
- package/lib/firestore/pretty-print.js +21 -1
- package/lib/firestore/pretty-print.test.js +61 -0
- package/lib/firestore/util.test.js +42 -0
- package/lib/frameworks/angular/utils.js +21 -8
- package/lib/frameworks/compose/discover/mockFileSystem.js +36 -0
- package/lib/frameworks/index.js +2 -6
- package/lib/frameworks/next/utils.js +2 -9
- package/lib/frameworks/nuxt/index.js +3 -3
- package/lib/functions/events/v2.js +2 -1
- package/lib/gcp/cloudsql/cloudsqladmin.js +20 -2
- package/lib/gcp/cloudsql/connect.js +6 -6
- package/lib/gcp/devConnect.js +36 -1
- package/lib/hosting/implicitInit.js +2 -2
- package/lib/init/features/dataconnect/index.js +252 -124
- package/lib/init/features/dataconnect/sdk.js +131 -0
- package/lib/init/features/firestore/indexes.js +2 -2
- package/lib/init/features/firestore/rules.js +2 -2
- package/lib/init/features/functions/javascript.js +6 -8
- package/lib/init/features/functions/python.js +4 -6
- package/lib/init/features/functions/typescript.js +8 -10
- package/lib/init/features/hosting/github.js +43 -21
- package/lib/init/features/hosting/index.js +3 -3
- package/lib/init/features/index.js +3 -1
- package/lib/init/features/storage.js +2 -2
- package/lib/init/index.js +1 -0
- package/lib/listFiles.js +1 -1
- package/lib/management/apps.js +2 -2
- package/lib/rc.js +2 -3
- package/lib/requireAuth.js +8 -0
- package/lib/rulesDeploy.js +14 -12
- package/lib/templates.js +23 -0
- package/lib/track.js +29 -2
- package/lib/utils.js +2 -2
- package/package.json +25 -24
- package/schema/connector-yaml.json +36 -4
- package/schema/dataconnect-yaml.json +4 -0
- package/schema/firebase-config.json +2 -8
- package/templates/_gitignore +3 -0
- package/templates/init/dataconnect/connector.yaml +11 -0
- package/templates/init/dataconnect/dataconnect.yaml +2 -1
- package/templates/init/dataconnect/mutations.gql +18 -13
- package/templates/init/dataconnect/queries.gql +34 -29
- package/templates/init/dataconnect/schema.gql +1 -1
- package/lib/extensions/billingMigrationHelper.js +0 -61
|
@@ -276,9 +276,6 @@
|
|
|
276
276
|
{
|
|
277
277
|
"additionalProperties": false,
|
|
278
278
|
"properties": {
|
|
279
|
-
"location": {
|
|
280
|
-
"type": "string"
|
|
281
|
-
},
|
|
282
279
|
"postdeploy": {
|
|
283
280
|
"anyOf": [
|
|
284
281
|
{
|
|
@@ -310,7 +307,6 @@
|
|
|
310
307
|
}
|
|
311
308
|
},
|
|
312
309
|
"required": [
|
|
313
|
-
"location",
|
|
314
310
|
"source"
|
|
315
311
|
],
|
|
316
312
|
"type": "object"
|
|
@@ -319,9 +315,6 @@
|
|
|
319
315
|
"items": {
|
|
320
316
|
"additionalProperties": false,
|
|
321
317
|
"properties": {
|
|
322
|
-
"location": {
|
|
323
|
-
"type": "string"
|
|
324
|
-
},
|
|
325
318
|
"postdeploy": {
|
|
326
319
|
"anyOf": [
|
|
327
320
|
{
|
|
@@ -353,7 +346,6 @@
|
|
|
353
346
|
}
|
|
354
347
|
},
|
|
355
348
|
"required": [
|
|
356
|
-
"location",
|
|
357
349
|
"source"
|
|
358
350
|
],
|
|
359
351
|
"type": "object"
|
|
@@ -726,6 +718,7 @@
|
|
|
726
718
|
"nodejs16",
|
|
727
719
|
"nodejs18",
|
|
728
720
|
"nodejs20",
|
|
721
|
+
"nodejs22",
|
|
729
722
|
"nodejs6",
|
|
730
723
|
"nodejs8",
|
|
731
724
|
"python310",
|
|
@@ -787,6 +780,7 @@
|
|
|
787
780
|
"nodejs16",
|
|
788
781
|
"nodejs18",
|
|
789
782
|
"nodejs20",
|
|
783
|
+
"nodejs22",
|
|
790
784
|
"nodejs6",
|
|
791
785
|
"nodejs8",
|
|
792
786
|
"python310",
|
package/templates/_gitignore
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
connectorId: "__connectorId__"
|
|
2
2
|
authMode: "PUBLIC"
|
|
3
|
+
## ## Here's an example of how to add generated SDKs.
|
|
4
|
+
## ## You'll need to replace the outputDirs with ones pointing to where you want the generated code in your app.
|
|
5
|
+
# generate:
|
|
6
|
+
# javascriptSdk:
|
|
7
|
+
# outputDir: <Path where you want the generated SDK to be written to, relative to this file>
|
|
8
|
+
# package: "@firebasegen/my-connector"
|
|
9
|
+
# packageJSONDir: < Optional. Path to your Javascript app's package.json>
|
|
10
|
+
# swiftSdk:
|
|
11
|
+
# outputDir: <Path where you want the generated SDK to be written to, relative to this file>
|
|
12
|
+
# kotlinSdk:
|
|
13
|
+
# outputDir: <Path where you want the generated SDK to be written to, relative to this file>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
specVersion: "v1alpha"
|
|
2
2
|
serviceId: "__serviceId__"
|
|
3
|
+
location: "__location__"
|
|
3
4
|
schema:
|
|
4
5
|
source: "./schema"
|
|
5
6
|
datasource:
|
|
@@ -7,4 +8,4 @@ schema:
|
|
|
7
8
|
database: "__cloudSqlDatabase__"
|
|
8
9
|
cloudSql:
|
|
9
10
|
instanceId: "__cloudSqlInstanceId__"
|
|
10
|
-
connectorDirs: [
|
|
11
|
+
connectorDirs: [__connectorIds__]
|
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
# # Example mutations for a simple email app
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
|
|
3
|
+
# # Logged in user can create their own account.
|
|
4
|
+
# mutation CreateUser($name: String!, $address: String!) @auth(level: USER) {
|
|
5
|
+
# # <type>_insert lets you create a new row in your table.
|
|
5
6
|
# user_insert(data: {
|
|
6
|
-
#
|
|
7
|
+
# # Server values let your service populate sensitive data.
|
|
8
|
+
# # Users can only setup their own account.
|
|
9
|
+
# uid_expr: "auth.uid",
|
|
7
10
|
# name: $name,
|
|
8
11
|
# address: $address
|
|
9
12
|
# })
|
|
10
13
|
# }
|
|
11
|
-
|
|
14
|
+
|
|
15
|
+
# # Logged in user can send emails from their account.
|
|
16
|
+
# mutation CreateEmail($content: String, $subject: String) @auth(level: USER) {
|
|
12
17
|
# email_insert(data: {
|
|
18
|
+
# # The request variable name doesn't have to match the field name.
|
|
13
19
|
# text: $content,
|
|
14
20
|
# subject: $subject,
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
# # Server values let your service populate sensitive data.
|
|
22
|
+
# # Users are only allowed to create emails sent from their account.
|
|
23
|
+
# fromUid_expr: "auth.uid",
|
|
24
|
+
# # Server values let your service populate data for you
|
|
25
|
+
# # Here, we use sent_date: { today: true } to set 'sent' to today's date.
|
|
18
26
|
# sent_date: { today: true }
|
|
19
27
|
# })
|
|
20
28
|
# }
|
|
21
|
-
|
|
29
|
+
|
|
30
|
+
# mutation CreateRecipient($emailId: UUID) @auth(level: USER) {
|
|
22
31
|
# recipient_insert(data: {
|
|
23
32
|
# emailId: $emailId,
|
|
24
|
-
#
|
|
33
|
+
# userUid_expr: "auth.uid"
|
|
25
34
|
# })
|
|
26
35
|
# }
|
|
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
|
-
# }
|
|
@@ -1,51 +1,56 @@
|
|
|
1
1
|
# # Example queries for a simple email app.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
# query
|
|
6
|
-
#
|
|
3
|
+
# # @auth() directives control who can call each operation.
|
|
4
|
+
# # Only admins should be able to list all emails, so we use NO_ACCESS
|
|
5
|
+
# query ListEmails @auth(level: NO_ACCESS) {
|
|
6
|
+
# emails {
|
|
7
|
+
# id, subject, text, sent
|
|
8
|
+
# from {
|
|
9
|
+
# name
|
|
10
|
+
# }
|
|
11
|
+
# }
|
|
7
12
|
# }
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
# query
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
# # Only admins should be able to list all users, so we use NO_ACCESS
|
|
15
|
+
# query ListUsers @auth(level: NO_ACCESS) {
|
|
16
|
+
# users { uid, name, address }
|
|
17
|
+
# }
|
|
18
|
+
|
|
19
|
+
# # Logged in users should be able to see their inbox though, so we use USER
|
|
20
|
+
# query ListInbox @auth(level: USER) {
|
|
21
|
+
# # where allows you to filter lists
|
|
22
|
+
# # Here, we use it to filter to only emails that are sent to the logged in user.
|
|
15
23
|
# emails(where: {
|
|
16
|
-
# users_via_Recipient: {
|
|
17
|
-
# exist: { uid: {
|
|
24
|
+
# users_via_Recipient: {
|
|
25
|
+
# exist: { uid: { eq_expr: "auth.uid" }
|
|
18
26
|
# }}
|
|
19
27
|
# }) {
|
|
20
|
-
# id subject sent
|
|
21
|
-
# content: text
|
|
22
|
-
# sender: from { name
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## Here, we use it to grab all the recipients of the email.
|
|
28
|
+
# id subject sent
|
|
29
|
+
# content: text # Select the `text` field but alias it as `content` in the response.
|
|
30
|
+
# sender: from { name address uid }
|
|
31
|
+
# # <field>_on_<foreign_key_field> makes it easy to grab info from another table
|
|
32
|
+
# # Here, we use it to grab all the recipients of the email.
|
|
26
33
|
# to: recipients_on_email {
|
|
27
|
-
# user { name
|
|
34
|
+
# user { name address uid }
|
|
28
35
|
# }
|
|
29
36
|
# }
|
|
30
37
|
# }
|
|
31
38
|
|
|
32
39
|
# query GetUidByEmail($emails: [String!]) @auth(level: PUBLIC) {
|
|
33
40
|
# users(where: { address: { in: $emails } }) {
|
|
34
|
-
# uid
|
|
41
|
+
# uid address
|
|
35
42
|
# }
|
|
36
43
|
# }
|
|
37
44
|
|
|
38
|
-
# query ListSent(
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
# emails(where: {
|
|
42
|
-
# fromUid: { eq: $uid }
|
|
45
|
+
# query ListSent($uid: String) @auth(level: PUBLIC) {
|
|
46
|
+
# emails(where: {
|
|
47
|
+
# from: {uid: {eq: $uid }}
|
|
43
48
|
# }) {
|
|
44
|
-
# id subject sent
|
|
45
|
-
# content: text
|
|
46
|
-
# sender: from { name
|
|
49
|
+
# id subject sent
|
|
50
|
+
# content: text
|
|
51
|
+
# sender: from { name address uid }
|
|
47
52
|
# to: recipients_on_email {
|
|
48
|
-
# user { name
|
|
53
|
+
# user { name address uid }
|
|
49
54
|
# }
|
|
50
55
|
# }
|
|
51
56
|
# }
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.displayNode10CreateBillingNotice = exports.displayNode10UpdateBillingNotice = void 0;
|
|
4
|
-
const marked_1 = require("marked");
|
|
5
|
-
const TerminalRenderer = require("marked-terminal");
|
|
6
|
-
const error_1 = require("../error");
|
|
7
|
-
const extensionsHelper_1 = require("./extensionsHelper");
|
|
8
|
-
const prompt_1 = require("../prompt");
|
|
9
|
-
const utils = require("../utils");
|
|
10
|
-
const utils_1 = require("./utils");
|
|
11
|
-
marked_1.marked.setOptions({
|
|
12
|
-
renderer: new TerminalRenderer(),
|
|
13
|
-
});
|
|
14
|
-
const urlPricingExamples = "https://cloud.google.com/functions/pricing#pricing_examples";
|
|
15
|
-
const urlFAQ = "https://firebase.google.com/support/faq/#extensions-pricing";
|
|
16
|
-
const billingMsgUpdate = "This update includes an upgrade to Node.js 10 from Node.js 8, which is no" +
|
|
17
|
-
" longer maintained. Starting with this update, you will be charged a" +
|
|
18
|
-
" small amount (typically around $0.01/month) for the Firebase resources" +
|
|
19
|
-
" required by this extension (even if it is not used), in addition to any" +
|
|
20
|
-
" charges associated with its usage.\n\n" +
|
|
21
|
-
`See pricing examples: **[${urlPricingExamples}](${urlPricingExamples})**\n` +
|
|
22
|
-
`See the FAQ: **[${urlFAQ}](${urlFAQ})**\n`;
|
|
23
|
-
const billingMsgCreate = "You will be charged around $0.01/month for the Firebase resources" +
|
|
24
|
-
" required by this extension (even if it is not used). Additionally," +
|
|
25
|
-
" using this extension will contribute to your project's overall usage" +
|
|
26
|
-
" level of Firebase services. However, you'll only be charged for usage" +
|
|
27
|
-
" that exceeds Firebase's free tier for those services.\n\n" +
|
|
28
|
-
`See pricing examples: **[${urlPricingExamples}](${urlPricingExamples})**\n` +
|
|
29
|
-
`See the FAQ: **[${urlFAQ}](${urlFAQ})**\n`;
|
|
30
|
-
const defaultSpecVersion = "v1beta";
|
|
31
|
-
const defaultRuntimes = {
|
|
32
|
-
v1beta: "nodejs8",
|
|
33
|
-
};
|
|
34
|
-
function hasRuntime(spec, runtime) {
|
|
35
|
-
const specVersion = spec.specVersion || defaultSpecVersion;
|
|
36
|
-
const defaultRuntime = defaultRuntimes[specVersion];
|
|
37
|
-
const resources = spec.resources || [];
|
|
38
|
-
return resources.some((r) => runtime === ((0, utils_1.getResourceRuntime)(r) || defaultRuntime));
|
|
39
|
-
}
|
|
40
|
-
function displayNode10UpdateBillingNotice(curSpec, newSpec) {
|
|
41
|
-
if (hasRuntime(curSpec, "nodejs8") && hasRuntime(newSpec, "nodejs10")) {
|
|
42
|
-
utils.logLabeledWarning(extensionsHelper_1.logPrefix, (0, marked_1.marked)(billingMsgUpdate));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.displayNode10UpdateBillingNotice = displayNode10UpdateBillingNotice;
|
|
46
|
-
async function displayNode10CreateBillingNotice(spec, prompt) {
|
|
47
|
-
if (hasRuntime(spec, "nodejs10")) {
|
|
48
|
-
utils.logLabeledWarning(extensionsHelper_1.logPrefix, (0, marked_1.marked)(billingMsgCreate));
|
|
49
|
-
if (prompt) {
|
|
50
|
-
const continueUpdate = await (0, prompt_1.promptOnce)({
|
|
51
|
-
type: "confirm",
|
|
52
|
-
message: "Do you wish to continue?",
|
|
53
|
-
default: true,
|
|
54
|
-
});
|
|
55
|
-
if (!continueUpdate) {
|
|
56
|
-
throw new error_1.FirebaseError(`Cancelled.`, { exit: 2 });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.displayNode10CreateBillingNotice = displayNode10CreateBillingNotice;
|