firebase-tools-with-isolate 13.11.2 → 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 +5 -9
- package/lib/commands/dataconnect-services-list.js +1 -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 +1 -1
- package/lib/dataconnect/client.js +55 -8
- package/lib/dataconnect/fileUtils.js +30 -7
- package/lib/dataconnect/filters.js +12 -1
- package/lib/dataconnect/load.js +9 -7
- package/lib/dataconnect/schemaMigration.js +21 -0
- package/lib/dataconnect/types.js +8 -1
- package/lib/deploy/dataconnect/prepare.js +16 -2
- package/lib/deploy/functions/build.js +10 -1
- package/lib/emulator/adminSdkConfig.test.js +16 -0
- package/lib/emulator/constants.js +1 -0
- package/lib/emulator/controller.js +3 -9
- package/lib/emulator/dataconnectEmulator.js +122 -18
- package/lib/emulator/downloadableEmulators.js +21 -22
- 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 +9 -0
- 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/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 +13 -5
- package/lib/frameworks/compose/discover/mockFileSystem.js +36 -0
- package/lib/frameworks/index.js +2 -6
- package/lib/frameworks/next/utils.js +2 -8
- package/lib/frameworks/nuxt/index.js +3 -3
- package/lib/functions/events/v2.js +2 -1
- package/lib/gcp/cloudsql/cloudsqladmin.js +6 -1
- package/lib/gcp/devConnect.js +36 -1
- package/lib/hosting/implicitInit.js +2 -2
- package/lib/init/features/dataconnect/index.js +97 -31
- 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 +1 -0
- package/lib/requireAuth.js +8 -3
- package/lib/rulesDeploy.js +14 -12
- package/lib/templates.js +23 -0
- 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 +0 -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 +19 -14
- package/templates/init/dataconnect/queries.gql +28 -23
- package/templates/init/dataconnect/schema.gql +1 -1
- package/lib/extensions/billingMigrationHelper.js +0 -61
|
@@ -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: {
|
|
13
|
-
#
|
|
18
|
+
# # The request variable name doesn't have to match the field name.
|
|
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
24
|
# users_via_Recipient: {
|
|
17
|
-
# exist: { uid: {
|
|
25
|
+
# exist: { uid: { eq_expr: "auth.uid" }
|
|
18
26
|
# }}
|
|
19
27
|
# }) {
|
|
20
28
|
# id subject sent
|
|
21
29
|
# content: text # Select the `text` field but alias it as `content` in the response.
|
|
22
|
-
# sender: from { name
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## Here, we use it to grab all the recipients of the email.
|
|
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
|
-
# $uid: String
|
|
40
|
-
# ) @auth(level: PUBLIC) {
|
|
45
|
+
# query ListSent($uid: String) @auth(level: PUBLIC) {
|
|
41
46
|
# emails(where: {
|
|
42
|
-
#
|
|
47
|
+
# from: {uid: {eq: $uid }}
|
|
43
48
|
# }) {
|
|
44
49
|
# id subject sent
|
|
45
50
|
# content: text
|
|
46
|
-
# sender: from { name
|
|
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;
|