firebase-tools-with-isolate 13.15.0-0 → 13.16.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/commands/deploy.js +3 -1
- package/lib/dataconnect/client.js +2 -1
- package/lib/dataconnect/fileUtils.js +52 -11
- package/lib/dataconnect/provisionCloudSql.js +5 -1
- package/lib/deploy/extensions/planner.js +52 -1
- package/lib/deploy/extensions/prepare.js +98 -23
- package/lib/deploy/extensions/release.js +6 -0
- 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 +8 -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/constants.js +7 -0
- package/lib/emulator/controller.js +11 -1
- package/lib/emulator/downloadableEmulators.js +12 -12
- package/lib/emulator/env.js +3 -0
- package/lib/emulator/functionsEmulator.js +30 -1
- package/lib/emulator/functionsEmulatorShared.js +16 -0
- package/lib/emulator/portUtils.js +1 -0
- package/lib/emulator/registry.js +1 -0
- package/lib/emulator/taskQueue.js +348 -0
- package/lib/emulator/tasksEmulator.js +237 -0
- package/lib/emulator/types.js +3 -0
- package/lib/extensions/askUserForEventsConfig.js +18 -8
- package/lib/extensions/askUserForParam.js +2 -1
- package/lib/extensions/displayExtensionInfo.js +5 -5
- package/lib/extensions/extensionsApi.js +1 -1
- package/lib/extensions/extensionsHelper.js +25 -3
- package/lib/extensions/localHelper.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/frameworks/constants.js +1 -1
- package/lib/frameworks/next/constants.js +1 -1
- package/lib/frameworks/next/index.js +35 -15
- package/lib/frameworks/next/utils.js +51 -1
- package/lib/init/features/dataconnect/index.js +14 -8
- package/lib/init/features/dataconnect/sdk.js +64 -48
- package/lib/prompt.js +22 -1
- package/package.json +3 -3
- package/schema/firebase-config.json +12 -0
- 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
|
@@ -1,35 +1,50 @@
|
|
|
1
|
-
# # Example mutations for a simple
|
|
1
|
+
# # Example mutations for a simple movie app
|
|
2
2
|
|
|
3
|
-
# #
|
|
4
|
-
# mutation
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
3
|
+
# # Create a movie based on user input
|
|
4
|
+
# mutation CreateMovie(
|
|
5
|
+
# $title: String!
|
|
6
|
+
# $genre: String!
|
|
7
|
+
# $imageUrl: String!
|
|
8
|
+
# ) @auth(level: USER_EMAIL_VERIFIED) {
|
|
9
|
+
# movie_insert(
|
|
10
|
+
# data: {
|
|
11
|
+
# title: $title
|
|
12
|
+
# genre: $genre
|
|
13
|
+
# imageUrl: $imageUrl
|
|
14
|
+
# }
|
|
15
|
+
# )
|
|
13
16
|
# }
|
|
14
17
|
|
|
15
|
-
# #
|
|
16
|
-
# mutation
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
#
|
|
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.
|
|
26
|
-
# sent_date: { today: true }
|
|
27
|
-
# })
|
|
18
|
+
# # Upsert (update or insert) a user's username based on their auth.uid
|
|
19
|
+
# mutation UpsertUser($username: String!) @auth(level: USER) {
|
|
20
|
+
# user_upsert(
|
|
21
|
+
# data: {
|
|
22
|
+
# id_expr: "auth.uid"
|
|
23
|
+
# username: $username
|
|
24
|
+
# }
|
|
25
|
+
# )
|
|
28
26
|
# }
|
|
29
27
|
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
28
|
+
# # Add a review for a movie
|
|
29
|
+
# mutation AddReview(
|
|
30
|
+
# $movieId: UUID!
|
|
31
|
+
# $rating: Int!
|
|
32
|
+
# $reviewText: String!
|
|
33
|
+
# ) @auth(level: USER) {
|
|
34
|
+
# review_upsert(
|
|
35
|
+
# data: {
|
|
36
|
+
# userId_expr: "auth.uid"
|
|
37
|
+
# movieId: $movieId
|
|
38
|
+
# rating: $rating
|
|
39
|
+
# reviewText: $reviewText
|
|
40
|
+
# # reviewDate defaults to today in the schema. No need to set it manually.
|
|
41
|
+
# }
|
|
42
|
+
# )
|
|
43
|
+
# }
|
|
44
|
+
|
|
45
|
+
# # Logged in user can delete their review for a movie
|
|
46
|
+
# mutation DeleteReview(
|
|
47
|
+
# $movieId: UUID!
|
|
48
|
+
# ) @auth(level: USER) {
|
|
49
|
+
# review_delete(key: { userId_expr: "auth.uid", movieId: $movieId })
|
|
35
50
|
# }
|
|
@@ -1,56 +1,84 @@
|
|
|
1
|
-
# # Example queries for a simple
|
|
1
|
+
# # Example queries for a simple movie app.
|
|
2
2
|
|
|
3
3
|
# # @auth() directives control who can call each operation.
|
|
4
|
-
# #
|
|
5
|
-
# query
|
|
6
|
-
#
|
|
7
|
-
# id
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
4
|
+
# # Anyone should be able to list all movies, so the auth level is set to PUBLIC
|
|
5
|
+
# query ListMovies @auth(level: PUBLIC) {
|
|
6
|
+
# movies {
|
|
7
|
+
# id
|
|
8
|
+
# title
|
|
9
|
+
# imageUrl
|
|
10
|
+
# genre
|
|
11
11
|
# }
|
|
12
12
|
# }
|
|
13
13
|
|
|
14
|
-
# #
|
|
14
|
+
# # List all users, only admins should be able to list all users, so we use NO_ACCESS
|
|
15
15
|
# query ListUsers @auth(level: NO_ACCESS) {
|
|
16
|
-
# users {
|
|
16
|
+
# users { id, username }
|
|
17
17
|
# }
|
|
18
|
-
|
|
19
|
-
# # Logged in
|
|
20
|
-
# query
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
# exist: { uid: { eq_expr: "auth.uid" }
|
|
26
|
-
# }}
|
|
27
|
-
# }) {
|
|
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 }
|
|
18
|
+
|
|
19
|
+
# # Logged in user can list all their reviews and movie titles associated with the review
|
|
20
|
+
# # Since the query requires the uid of the current authenticated user, the auth level is set to USER
|
|
21
|
+
# query ListUserReviews @auth(level: USER) {
|
|
22
|
+
# user(key: {id_expr: "auth.uid"}) {
|
|
23
|
+
# id
|
|
24
|
+
# username
|
|
31
25
|
# # <field>_on_<foreign_key_field> makes it easy to grab info from another table
|
|
32
|
-
# # Here, we use it to grab all the
|
|
33
|
-
#
|
|
34
|
-
#
|
|
26
|
+
# # Here, we use it to grab all the reviews written by the user.
|
|
27
|
+
# reviews: reviews_on_user {
|
|
28
|
+
# id
|
|
29
|
+
# rating
|
|
30
|
+
# reviewDate
|
|
31
|
+
# reviewText
|
|
32
|
+
# movie {
|
|
33
|
+
# id
|
|
34
|
+
# title
|
|
35
|
+
# }
|
|
35
36
|
# }
|
|
36
37
|
# }
|
|
37
38
|
# }
|
|
38
39
|
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
40
|
+
# # Get movie by id
|
|
41
|
+
# query GetMovieById($id: UUID!) @auth(level: PUBLIC) {
|
|
42
|
+
# movie(id: $id) {
|
|
43
|
+
# id
|
|
44
|
+
# title
|
|
45
|
+
# imageUrl
|
|
46
|
+
# genre
|
|
47
|
+
# metadata: movieMetadatas_on_movie {
|
|
48
|
+
# director
|
|
49
|
+
# rating
|
|
50
|
+
# releaseYear
|
|
51
|
+
# description
|
|
52
|
+
# }
|
|
53
|
+
# reviews: reviews_on_movie {
|
|
54
|
+
# id
|
|
55
|
+
# reviewText
|
|
56
|
+
# reviewDate
|
|
57
|
+
# rating
|
|
58
|
+
# user {
|
|
59
|
+
# id
|
|
60
|
+
# username
|
|
61
|
+
# }
|
|
62
|
+
# }
|
|
42
63
|
# }
|
|
43
64
|
# }
|
|
44
65
|
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
66
|
+
# # Search for movies, actors, and reviews
|
|
67
|
+
# query SearchMovie(
|
|
68
|
+
# $titleInput: String
|
|
69
|
+
# $genre: String
|
|
70
|
+
# ) @auth(level: PUBLIC) {
|
|
71
|
+
# movies(
|
|
72
|
+
# where: {
|
|
73
|
+
# _and: [
|
|
74
|
+
# { genre: { eq: $genre } }
|
|
75
|
+
# { title: { contains: $titleInput } }
|
|
76
|
+
# ]
|
|
54
77
|
# }
|
|
78
|
+
# ) {
|
|
79
|
+
# id
|
|
80
|
+
# title
|
|
81
|
+
# genre
|
|
82
|
+
# imageUrl
|
|
55
83
|
# }
|
|
56
84
|
# }
|
|
@@ -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
|
# }
|