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.
Files changed (48) hide show
  1. package/lib/commands/deploy.js +3 -1
  2. package/lib/dataconnect/client.js +2 -1
  3. package/lib/dataconnect/fileUtils.js +52 -11
  4. package/lib/dataconnect/provisionCloudSql.js +5 -1
  5. package/lib/deploy/extensions/planner.js +52 -1
  6. package/lib/deploy/extensions/prepare.js +98 -23
  7. package/lib/deploy/extensions/release.js +6 -0
  8. package/lib/deploy/functions/build.js +5 -5
  9. package/lib/deploy/functions/deploy.js +12 -12
  10. package/lib/deploy/functions/params.js +5 -3
  11. package/lib/deploy/functions/prepare.js +8 -1
  12. package/lib/deploy/functions/release/index.js +4 -0
  13. package/lib/deploy/functions/runtimes/discovery/parsing.js +1 -1
  14. package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +46 -0
  15. package/lib/emulator/constants.js +7 -0
  16. package/lib/emulator/controller.js +11 -1
  17. package/lib/emulator/downloadableEmulators.js +12 -12
  18. package/lib/emulator/env.js +3 -0
  19. package/lib/emulator/functionsEmulator.js +30 -1
  20. package/lib/emulator/functionsEmulatorShared.js +16 -0
  21. package/lib/emulator/portUtils.js +1 -0
  22. package/lib/emulator/registry.js +1 -0
  23. package/lib/emulator/taskQueue.js +348 -0
  24. package/lib/emulator/tasksEmulator.js +237 -0
  25. package/lib/emulator/types.js +3 -0
  26. package/lib/extensions/askUserForEventsConfig.js +18 -8
  27. package/lib/extensions/askUserForParam.js +2 -1
  28. package/lib/extensions/displayExtensionInfo.js +5 -5
  29. package/lib/extensions/extensionsApi.js +1 -1
  30. package/lib/extensions/extensionsHelper.js +25 -3
  31. package/lib/extensions/localHelper.js +1 -1
  32. package/lib/extensions/refs.js +26 -11
  33. package/lib/extensions/runtimes/common.js +75 -0
  34. package/lib/extensions/types.js +56 -1
  35. package/lib/frameworks/constants.js +1 -1
  36. package/lib/frameworks/next/constants.js +1 -1
  37. package/lib/frameworks/next/index.js +35 -15
  38. package/lib/frameworks/next/utils.js +51 -1
  39. package/lib/init/features/dataconnect/index.js +14 -8
  40. package/lib/init/features/dataconnect/sdk.js +64 -48
  41. package/lib/prompt.js +22 -1
  42. package/package.json +3 -3
  43. package/schema/firebase-config.json +12 -0
  44. package/templates/init/dataconnect/connector.yaml +5 -3
  45. package/templates/init/dataconnect/dataconnect.yaml +5 -5
  46. package/templates/init/dataconnect/mutations.gql +44 -29
  47. package/templates/init/dataconnect/queries.gql +66 -38
  48. package/templates/init/dataconnect/schema.gql +38 -21
@@ -1,35 +1,50 @@
1
- # # Example mutations for a simple email app
1
+ # # Example mutations for a simple movie app
2
2
 
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.
6
- # user_insert(data: {
7
- # # Server values let your service populate sensitive data.
8
- # # Users can only setup their own account.
9
- # uid_expr: "auth.uid",
10
- # name: $name,
11
- # address: $address
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
- # # Logged in user can send emails from their account.
16
- # mutation CreateEmail($content: String, $subject: String) @auth(level: USER) {
17
- # email_insert(data: {
18
- # # The request variable name doesn't have to match the field name.
19
- # text: $content,
20
- # subject: $subject,
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.
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
- # mutation CreateRecipient($emailId: UUID) @auth(level: USER) {
31
- # recipient_insert(data: {
32
- # emailId: $emailId,
33
- # userUid_expr: "auth.uid"
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 email app.
1
+ # # Example queries for a simple movie app.
2
2
 
3
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
- # }
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
- # # Only admins should be able to list all users, so we use NO_ACCESS
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 { uid, name, address }
16
+ # users { id, username }
17
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.
23
- # emails(where: {
24
- # users_via_Recipient: {
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 recipients of the email.
33
- # to: recipients_on_email {
34
- # user { name address uid }
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
- # query GetUidByEmail($emails: [String!]) @auth(level: PUBLIC) {
40
- # users(where: { address: { in: $emails } }) {
41
- # uid address
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
- # query ListSent($uid: String) @auth(level: PUBLIC) {
46
- # emails(where: {
47
- # from: {uid: {eq: $uid }}
48
- # }) {
49
- # id subject sent
50
- # content: text
51
- # sender: from { name address uid }
52
- # to: recipients_on_email {
53
- # user { name address uid }
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 email app
2
- # type User @table(key: "uid") {
3
- # uid: String!
4
- # name: String!
5
- # address: String!
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
- # type Email @table {
9
- # subject: String!
10
- # sent: Date!
11
- # text: String!
12
- # from: User!
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
- # type Recipient @table(key: ["email", "user"]) {
16
- # email: Email!
17
- # user: User!
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
- # 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
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
  # }