Skip to content

Commit b89db13

Browse files
committed
_
1 parent 62a99e6 commit b89db13

File tree

7 files changed

+617
-88
lines changed

7 files changed

+617
-88
lines changed

dataconnect-sdk/js/default-connector/README.md

+531
Large diffs are not rendered by default.

dataconnect-sdk/js/default-connector/esm/index.esm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getDataConnect, queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect';
1+
import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect';
22

33
export const connectorConfig = {
44
connector: 'default',

dataconnect-sdk/js/default-connector/index.cjs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { getDataConnect, queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect');
1+
const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect');
22

33
const connectorConfig = {
44
connector: 'default',

dataconnect-sdk/js/default-connector/index.d.ts

+12-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export type Int64String = string;
1010
export type DateString = string;
1111

1212

13-
1413
export interface CreateMovieData {
1514
movie_insert: Movie_Key;
1615
}
@@ -72,48 +71,47 @@ export interface UpsertMovieVariables {
7271
}
7372

7473

75-
7674
/* Allow users to create refs without passing in DataConnect */
7775
export function createMovieRef(vars: CreateMovieVariables): MutationRef<CreateMovieData, CreateMovieVariables>;
7876
/* Allow users to pass in custom DataConnect instances */
79-
export function createMovieRef(dc: DataConnect, vars: CreateMovieVariables): MutationRef<CreateMovieData,CreateMovieVariables>;
77+
export function createMovieRef(dc: DataConnect, vars: CreateMovieVariables): MutationRef<CreateMovieData, CreateMovieVariables>;
8078

8179
export function createMovie(vars: CreateMovieVariables): MutationPromise<CreateMovieData, CreateMovieVariables>;
82-
export function createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise<CreateMovieData,CreateMovieVariables>;
80+
export function createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise<CreateMovieData, CreateMovieVariables>;
8381

8482

8583
/* Allow users to create refs without passing in DataConnect */
8684
export function upsertMovieRef(vars: UpsertMovieVariables): MutationRef<UpsertMovieData, UpsertMovieVariables>;
8785
/* Allow users to pass in custom DataConnect instances */
88-
export function upsertMovieRef(dc: DataConnect, vars: UpsertMovieVariables): MutationRef<UpsertMovieData,UpsertMovieVariables>;
86+
export function upsertMovieRef(dc: DataConnect, vars: UpsertMovieVariables): MutationRef<UpsertMovieData, UpsertMovieVariables>;
8987

9088
export function upsertMovie(vars: UpsertMovieVariables): MutationPromise<UpsertMovieData, UpsertMovieVariables>;
91-
export function upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise<UpsertMovieData,UpsertMovieVariables>;
89+
export function upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise<UpsertMovieData, UpsertMovieVariables>;
9290

9391

9492
/* Allow users to create refs without passing in DataConnect */
9593
export function deleteMovieRef(vars: DeleteMovieVariables): MutationRef<DeleteMovieData, DeleteMovieVariables>;
9694
/* Allow users to pass in custom DataConnect instances */
97-
export function deleteMovieRef(dc: DataConnect, vars: DeleteMovieVariables): MutationRef<DeleteMovieData,DeleteMovieVariables>;
95+
export function deleteMovieRef(dc: DataConnect, vars: DeleteMovieVariables): MutationRef<DeleteMovieData, DeleteMovieVariables>;
9896

9997
export function deleteMovie(vars: DeleteMovieVariables): MutationPromise<DeleteMovieData, DeleteMovieVariables>;
100-
export function deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise<DeleteMovieData,DeleteMovieVariables>;
98+
export function deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise<DeleteMovieData, DeleteMovieVariables>;
10199

102100

103101
/* Allow users to create refs without passing in DataConnect */
104-
export function listMoviesRef(): QueryRef<ListMoviesData, undefined>;/* Allow users to pass in custom DataConnect instances */
105-
export function listMoviesRef(dc: DataConnect): QueryRef<ListMoviesData,undefined>;
102+
export function listMoviesRef(): QueryRef<ListMoviesData, undefined>;
103+
/* Allow users to pass in custom DataConnect instances */
104+
export function listMoviesRef(dc: DataConnect): QueryRef<ListMoviesData, undefined>;
106105

107106
export function listMovies(): QueryPromise<ListMoviesData, undefined>;
108-
export function listMovies(dc: DataConnect): QueryPromise<ListMoviesData,undefined>;
107+
export function listMovies(dc: DataConnect): QueryPromise<ListMoviesData, undefined>;
109108

110109

111110
/* Allow users to create refs without passing in DataConnect */
112111
export function getMovieByIdRef(vars: GetMovieByIdVariables): QueryRef<GetMovieByIdData, GetMovieByIdVariables>;
113112
/* Allow users to pass in custom DataConnect instances */
114-
export function getMovieByIdRef(dc: DataConnect, vars: GetMovieByIdVariables): QueryRef<GetMovieByIdData,GetMovieByIdVariables>;
113+
export function getMovieByIdRef(dc: DataConnect, vars: GetMovieByIdVariables): QueryRef<GetMovieByIdData, GetMovieByIdVariables>;
115114

116115
export function getMovieById(vars: GetMovieByIdVariables): QueryPromise<GetMovieByIdData, GetMovieByIdVariables>;
117-
export function getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise<GetMovieByIdData,GetMovieByIdVariables>;
118-
116+
export function getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise<GetMovieByIdData, GetMovieByIdVariables>;
119117

dataconnect-sdk/js/default-connector/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"./package.json": "./package.json"
2121
},
2222
"peerDependencies": {
23-
"firebase": "^11.3.0"
23+
"firebase": "^10.14.0 || ^11.0.0"
2424
}
2525
}

dataconnect/.dataconnect/schema/prelude.gql

+70-70
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1+
"""
2+
Redact a part of the response from the client.
3+
4+
Redacted fields are still evaluated for side effects (including data changes and
5+
`@check`) and the results are still available to later steps in CEL expressions
6+
(via `response.fieldName`).
7+
"""
8+
directive @redact on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
9+
10+
"""
11+
Ensure this field is present and is not null or `[]`, or abort the request / transaction.
12+
13+
A CEL expression, `expr` is used to test the field value. It defaults to
14+
rejecting null and `[]` but a custom expression can be provided instead.
15+
16+
If the field occurs multiple times (i.e. directly or indirectly nested under a
17+
list), `expr` will be executed once for each occurrence and `@check` succeeds if
18+
all values succeed. `@check` fails when the field is not present at all (i.e.
19+
all ancestor paths contain `null` or `[]`), unless `optional` is true.
20+
21+
If a `@check` fails in a mutation, the top-level field containing it will be
22+
replaced with a partial error, whose message can be customzied via the `message`
23+
argument. Each subsequent top-level fields will return an aborted error (i.e.
24+
not executed). To rollback previous steps, see `@transaction`.
25+
"""
26+
directive @check(
27+
"""
28+
The CEL expression to test the field value (or values if nested under a list).
29+
30+
Within the CEL expression, a special value `this` evaluates to the field that
31+
this directive is attached to. If this field occurs multiple times because
32+
any ancestor is a list, each occurrence is tested with `this` bound to each
33+
value. When the field itself is a list or object, `this` follows the same
34+
structure (including all decendants selected in case of objects).
35+
36+
For any given path, if an ancestor is `null` or `[]`, the field will not be
37+
reached and the CEL evaluation will be skipped for that path. In other words,
38+
evaluation only takes place when `this` is `null` or non-null, but never
39+
undefined. (See also the `optional` argument.)
40+
"""
41+
expr: Boolean_Expr! = "!(this in [null, []])"
42+
"""
43+
The error message to return to the client if the check fails.
44+
45+
Defaults to "permission denied" if not specified.
46+
"""
47+
message: String! = "permission denied"
48+
"""
49+
Whether the check should pass or fail (default) when the field is not present.
50+
51+
A field will not be reached at a given path if its parent or any ancestor is
52+
`[]` or `null`. When this happens to all paths, the field will not be present
53+
anywhere in the response tree. In other words, `expr` is evaluated 0 times.
54+
By default, @check will automatically fail in this case. Set this argument to
55+
`true` to make it pass even if no tests are run (a.k.a. "vacuously true").
56+
"""
57+
optional: Boolean = false
58+
) repeatable on QUERY | MUTATION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT
59+
160
"AccessLevel specifies coarse access policies for common situations."
261
enum AccessLevel {
362
"""
@@ -445,6 +504,17 @@ directive @fdc_oneOf(
445504
required: Boolean! = false
446505
) repeatable on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
447506

507+
type Mutation {
508+
"""
509+
Run a query during the mutation and add fields into the response.
510+
511+
Example: foo: query { users { id } } will add a field foo: {users: [{id: "..."}, …]} into the response JSON.
512+
513+
Note: Data fetched this way can be handy for permission checks. See @check.
514+
"""
515+
query: Query
516+
}
517+
448518
"""
449519
`UUID` is a string of hexadecimal digits representing an RFC4122-compliant UUID.
450520
@@ -1934,73 +2004,3 @@ scalar Vector_Embed_Model
19342004
@fdc_example(value: "textembedding-gecko@001", description: "An older version of the textembedding-gecko model")
19352005
@fdc_example(value: "text-embedding-004", description: "Another text embedding model")
19362006

1937-
"""
1938-
Redact a part of the response from the client.
1939-
1940-
Redacted fields are still evaluated for side effects (including data changes and
1941-
`@check`) and the results are still available to later steps in CEL expressions
1942-
(via `response.fieldName`).
1943-
"""
1944-
directive @redact on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
1945-
1946-
"""
1947-
Ensure this field is present and is not null or `[]`, or abort the request / transaction.
1948-
1949-
A CEL expression, `expr` is used to test the field value. It defaults to
1950-
rejecting null and `[]` but a custom expression can be provided instead.
1951-
1952-
If the field occurs multiple times (i.e. directly or indirectly nested under a
1953-
list), `expr` will be executed once for each occurrence and `@check` succeeds if
1954-
all values succeed. `@check` fails when the field is not present at all (i.e.
1955-
all ancestor paths contain `null` or `[]`), unless `optional` is true.
1956-
1957-
If a `@check` fails in a mutation, the top-level field containing it will be
1958-
replaced with a partial error, whose message can be customzied via the `message`
1959-
argument. Each subsequent top-level fields will return an aborted error (i.e.
1960-
not executed). To rollback previous steps, see `@transaction`.
1961-
"""
1962-
directive @check(
1963-
"""
1964-
The CEL expression to test the field value (or values if nested under a list).
1965-
1966-
Within the CEL expression, a special value `this` evaluates to the field that
1967-
this directive is attached to. If this field occurs multiple times because
1968-
any ancestor is a list, each occurrence is tested with `this` bound to each
1969-
value. When the field itself is a list or object, `this` follows the same
1970-
structure (including all decendants selected in case of objects).
1971-
1972-
For any given path, if an ancestor is `null` or `[]`, the field will not be
1973-
reached and the CEL evaluation will be skipped for that path. In other words,
1974-
evaluation only takes place when `this` is `null` or non-null, but never
1975-
undefined. (See also the `optional` argument.)
1976-
"""
1977-
expr: Boolean_Expr! = "!(this in [null, []])"
1978-
"""
1979-
The error message to return to the client if the check fails.
1980-
1981-
Defaults to "permission denied" if not specified.
1982-
"""
1983-
message: String! = "permission denied"
1984-
"""
1985-
Whether the check should pass or fail (default) when the field is not present.
1986-
1987-
A field will not be reached at a given path if its parent or any ancestor is
1988-
`[]` or `null`. When this happens to all paths, the field will not be present
1989-
anywhere in the response tree. In other words, `expr` is evaluated 0 times.
1990-
By default, @check will automatically fail in this case. Set this argument to
1991-
`true` to make it pass even if no tests are run (a.k.a. "vacuously true").
1992-
"""
1993-
optional: Boolean = false
1994-
) repeatable on QUERY | MUTATION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT
1995-
1996-
type Mutation {
1997-
"""
1998-
Run a query during the mutation and add fields into the response.
1999-
2000-
Example: foo: query { users { id } } will add a field foo: {users: [{id: "..."}, …]} into the response JSON.
2001-
2002-
Note: Data fetched this way can be handy for permission checks. See @check.
2003-
"""
2004-
query: Query
2005-
}
2006-

packages/react/src/auth/useFetchSignInMethodsForEmailQuery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ export function useFetchSignInMethodsForEmailQuery(
1818
) {
1919
return useQuery<string[], AuthError, void>({
2020
...options,
21-
queryFn: async () => fetchSignInMethodsForEmail(auth, email),
21+
queryFn: () => fetchSignInMethodsForEmail(auth, email),
2222
});
2323
}

0 commit comments

Comments
 (0)