firebase-tools 13.14.2 → 13.15.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.
- package/lib/bin/firebase.js +2 -4
- package/lib/commands/deploy.js +10 -2
- package/lib/commands/ext-configure.js +1 -6
- package/lib/commands/ext-dev-init.js +2 -4
- 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-databases-create.js +19 -1
- package/lib/commands/functions-secrets-set.js +9 -6
- 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/dataconnect/fileUtils.js +63 -1
- package/lib/dataconnect/provisionCloudSql.js +5 -1
- package/lib/dataconnect/types.js +8 -1
- package/lib/deploy/extensions/planner.js +46 -1
- package/lib/deploy/extensions/prepare.js +99 -23
- package/lib/deploy/functions/build.js +5 -5
- package/lib/deploy/functions/deploy.js +12 -12
- package/lib/deploy/functions/params.js +5 -3
- package/lib/deploy/functions/prepare.js +16 -1
- package/lib/deploy/functions/release/index.js +4 -0
- package/lib/deploy/functions/runtimes/discovery/parsing.js +1 -1
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +46 -0
- package/lib/emulator/dataconnectEmulator.js +2 -0
- package/lib/emulator/downloadableEmulators.js +11 -12
- package/lib/emulator/functionsEmulator.js +8 -1
- package/lib/extensions/askUserForEventsConfig.js +18 -8
- package/lib/extensions/askUserForParam.js +3 -2
- package/lib/extensions/change-log.js +2 -4
- package/lib/extensions/displayExtensionInfo.js +5 -10
- package/lib/extensions/extensionsApi.js +1 -1
- package/lib/extensions/extensionsHelper.js +47 -10
- package/lib/extensions/localHelper.js +1 -1
- package/lib/extensions/provisioningHelper.js +1 -1
- package/lib/extensions/refs.js +26 -11
- package/lib/extensions/runtimes/common.js +75 -0
- package/lib/extensions/types.js +56 -1
- package/lib/extensions/updateHelper.js +1 -2
- package/lib/extensions/warnings.js +2 -7
- package/lib/firestore/api.js +8 -7
- package/lib/firestore/pretty-print.js +21 -1
- package/lib/firestore/pretty-print.test.js +8 -0
- package/lib/frameworks/constants.js +1 -1
- package/lib/frameworks/next/constants.js +1 -1
- package/lib/frameworks/next/index.js +26 -14
- package/lib/frameworks/next/utils.js +45 -1
- package/lib/init/features/dataconnect/index.js +29 -15
- package/lib/init/features/dataconnect/sdk.js +72 -56
- package/lib/prompt.js +22 -1
- package/lib/rulesDeploy.js +14 -12
- package/package.json +3 -3
- package/templates/init/dataconnect/connector.yaml +5 -3
- package/templates/init/dataconnect/dataconnect.yaml +5 -5
- package/templates/init/dataconnect/mutations.gql +44 -29
- package/templates/init/dataconnect/queries.gql +66 -38
- package/templates/init/dataconnect/schema.gql +38 -21
- package/lib/extensions/billingMigrationHelper.js +0 -61
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
# # Example schema for simple
|
|
2
|
-
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
1
|
+
# # Example schema for simple movie review app
|
|
2
|
+
|
|
3
|
+
# # Users
|
|
4
|
+
# # Suppose a user can leave reviews for movies
|
|
5
|
+
# # user -> reviews is a one to many relationship,
|
|
6
|
+
# # movie -> reviews is a one to many relationship
|
|
7
|
+
# # movie <-> user is a many to many relationship
|
|
8
|
+
# type User @table {
|
|
9
|
+
# id: String! @col(name: "user_auth")
|
|
10
|
+
# username: String! @col(name: "username", dataType: "varchar(50)")
|
|
11
|
+
# # The following are generated by the user: User! field in the Review table
|
|
12
|
+
# # reviews_on_user
|
|
13
|
+
# # movies_via_Review
|
|
6
14
|
# }
|
|
7
15
|
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
16
|
+
# # Movies
|
|
17
|
+
# type Movie @table {
|
|
18
|
+
# # The below parameter values are generated by default with @table, and can be edited manually.
|
|
19
|
+
# # implies directive `@col(name: "movie_id")`, generating a column name
|
|
20
|
+
# id: UUID! @default(expr: "uuidV4()")
|
|
21
|
+
# title: String!
|
|
22
|
+
# imageUrl: String!
|
|
23
|
+
# genre: String
|
|
13
24
|
# }
|
|
14
25
|
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
26
|
+
# # Movie Metadata
|
|
27
|
+
# # Movie - MovieMetadata is a one-to-one relationship
|
|
28
|
+
# type MovieMetadata @table {
|
|
29
|
+
# # @unique indicates a 1-1 relationship
|
|
30
|
+
# movie: Movie! @unique
|
|
31
|
+
# # movieId: UUID <- this is created by the above reference
|
|
32
|
+
# rating: Float
|
|
33
|
+
# releaseYear: Int
|
|
34
|
+
# description: String
|
|
18
35
|
# }
|
|
19
36
|
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
37
|
+
# # Reviews
|
|
38
|
+
# type Review @table(name: "Reviews", key: ["movie", "user"]) {
|
|
39
|
+
# id: UUID! @default(expr: "uuidV4()")
|
|
40
|
+
# user: User!
|
|
41
|
+
# movie: Movie!
|
|
42
|
+
# rating: Int
|
|
43
|
+
# reviewText: String
|
|
44
|
+
# reviewDate: Date! @default(expr: "request.time")
|
|
28
45
|
# }
|
|
@@ -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;
|