@firebase/data-connect 0.1.1 → 0.1.2
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/dist/index.cjs.js +1108 -1108
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +1108 -1108
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +1123 -1123
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +1123 -1123
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api/DataConnect.d.ts +108 -108
- package/dist/node-esm/src/api/Mutation.d.ts +61 -61
- package/dist/node-esm/src/api/Reference.d.ts +51 -51
- package/dist/node-esm/src/api/index.d.ts +23 -23
- package/dist/node-esm/src/api/query.d.ts +96 -96
- package/dist/node-esm/src/api.browser.d.ts +34 -34
- package/dist/node-esm/src/api.node.d.ts +17 -17
- package/dist/node-esm/src/core/AppCheckTokenProvider.d.ts +30 -30
- package/dist/node-esm/src/core/FirebaseAuthProvider.d.ts +34 -34
- package/dist/node-esm/src/core/QueryManager.d.ts +36 -36
- package/dist/node-esm/src/core/error.d.ts +51 -51
- package/dist/node-esm/src/core/version.d.ts +23 -23
- package/dist/node-esm/src/index.d.ts +29 -29
- package/dist/node-esm/src/index.node.d.ts +18 -18
- package/dist/node-esm/src/logger.d.ts +20 -20
- package/dist/node-esm/src/network/fetch.d.ts +21 -21
- package/dist/node-esm/src/network/index.d.ts +17 -17
- package/dist/node-esm/src/network/transport/index.d.ts +43 -43
- package/dist/node-esm/src/network/transport/rest.d.ts +58 -58
- package/dist/node-esm/src/register.d.ts +1 -1
- package/dist/node-esm/src/util/encoder.d.ts +19 -19
- package/dist/node-esm/src/util/map.d.ts +17 -17
- package/dist/node-esm/src/util/url.d.ts +19 -19
- package/dist/node-esm/src/util/validateArgs.d.ts +33 -33
- package/dist/src/api/DataConnect.d.ts +108 -108
- package/dist/src/api/Mutation.d.ts +61 -61
- package/dist/src/api/Reference.d.ts +51 -51
- package/dist/src/api/index.d.ts +23 -23
- package/dist/src/api/query.d.ts +96 -96
- package/dist/src/api.browser.d.ts +34 -34
- package/dist/src/api.node.d.ts +17 -17
- package/dist/src/core/AppCheckTokenProvider.d.ts +30 -30
- package/dist/src/core/FirebaseAuthProvider.d.ts +34 -34
- package/dist/src/core/QueryManager.d.ts +36 -36
- package/dist/src/core/error.d.ts +51 -51
- package/dist/src/core/version.d.ts +23 -23
- package/dist/src/index.d.ts +29 -29
- package/dist/src/index.node.d.ts +18 -18
- package/dist/src/logger.d.ts +20 -20
- package/dist/src/network/fetch.d.ts +21 -21
- package/dist/src/network/index.d.ts +17 -17
- package/dist/src/network/transport/index.d.ts +43 -43
- package/dist/src/network/transport/rest.d.ts +58 -58
- package/dist/src/register.d.ts +1 -1
- package/dist/src/util/encoder.d.ts +19 -19
- package/dist/src/util/map.d.ts +17 -17
- package/dist/src/util/url.d.ts +19 -19
- package/dist/src/util/validateArgs.d.ts +33 -33
- package/package.json +7 -7
package/dist/src/api/query.d.ts
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { DataConnectError } from '../core/error';
|
|
18
|
-
import { DataConnect } from './DataConnect';
|
|
19
|
-
import { OperationRef, QUERY_STR, DataConnectResult, SerializedRef } from './Reference';
|
|
20
|
-
/**
|
|
21
|
-
* Signature for `OnResultSubscription` for `subscribe`
|
|
22
|
-
*/
|
|
23
|
-
export
|
|
24
|
-
/**
|
|
25
|
-
* Signature for `OnErrorSubscription` for `subscribe`
|
|
26
|
-
*/
|
|
27
|
-
export
|
|
28
|
-
/**
|
|
29
|
-
* Signature for unsubscribe from `subscribe`
|
|
30
|
-
*/
|
|
31
|
-
export
|
|
32
|
-
/**
|
|
33
|
-
* Representation of user provided subscription options.
|
|
34
|
-
*/
|
|
35
|
-
export interface DataConnectSubscription<Data, Variables> {
|
|
36
|
-
userCallback: OnResultSubscription<Data, Variables>;
|
|
37
|
-
errCallback?: (e?: DataConnectError) => void;
|
|
38
|
-
unsubscribe: () => void;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* QueryRef object
|
|
42
|
-
*/
|
|
43
|
-
export interface QueryRef<Data, Variables> extends OperationRef<Data, Variables> {
|
|
44
|
-
refType: typeof QUERY_STR;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Result of `executeQuery`
|
|
48
|
-
*/
|
|
49
|
-
export interface QueryResult<Data, Variables> extends DataConnectResult<Data, Variables> {
|
|
50
|
-
ref: QueryRef<Data, Variables>;
|
|
51
|
-
toJSON: () => SerializedRef<Data, Variables>;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Promise returned from `executeQuery`
|
|
55
|
-
*/
|
|
56
|
-
export interface QueryPromise<Data, Variables> extends PromiseLike<QueryResult<Data, Variables>> {
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Execute Query
|
|
60
|
-
* @param queryRef query to execute.
|
|
61
|
-
* @returns `QueryPromise`
|
|
62
|
-
*/
|
|
63
|
-
export declare function executeQuery<Data, Variables>(queryRef: QueryRef<Data, Variables>): QueryPromise<Data, Variables>;
|
|
64
|
-
/**
|
|
65
|
-
* Execute Query
|
|
66
|
-
* @param dcInstance Data Connect instance to use.
|
|
67
|
-
* @param queryName Query to execute
|
|
68
|
-
* @returns `QueryRef`
|
|
69
|
-
*/
|
|
70
|
-
export declare function queryRef<Data>(dcInstance: DataConnect, queryName: string): QueryRef<Data, undefined>;
|
|
71
|
-
/**
|
|
72
|
-
* Execute Query
|
|
73
|
-
* @param dcInstance Data Connect instance to use.
|
|
74
|
-
* @param queryName Query to execute
|
|
75
|
-
* @param variables Variables to execute with
|
|
76
|
-
* @returns `QueryRef`
|
|
77
|
-
*/
|
|
78
|
-
export declare function queryRef<Data, Variables>(dcInstance: DataConnect, queryName: string, variables: Variables): QueryRef<Data, Variables>;
|
|
79
|
-
/**
|
|
80
|
-
* Converts serialized ref to query ref
|
|
81
|
-
* @param serializedRef ref to convert to `QueryRef`
|
|
82
|
-
* @returns `QueryRef`
|
|
83
|
-
*/
|
|
84
|
-
export declare function toQueryRef<Data, Variables>(serializedRef: SerializedRef<Data, Variables>): QueryRef<Data, Variables>;
|
|
85
|
-
/**
|
|
86
|
-
* `OnCompleteSubscription`
|
|
87
|
-
*/
|
|
88
|
-
export
|
|
89
|
-
/**
|
|
90
|
-
* Representation of full observer options in `subscribe`
|
|
91
|
-
*/
|
|
92
|
-
export interface SubscriptionOptions<Data, Variables> {
|
|
93
|
-
onNext?: OnResultSubscription<Data, Variables>;
|
|
94
|
-
onErr?: OnErrorSubscription;
|
|
95
|
-
onComplete?: OnCompleteSubscription;
|
|
96
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { DataConnectError } from '../core/error';
|
|
18
|
+
import { DataConnect } from './DataConnect';
|
|
19
|
+
import { OperationRef, QUERY_STR, DataConnectResult, SerializedRef } from './Reference';
|
|
20
|
+
/**
|
|
21
|
+
* Signature for `OnResultSubscription` for `subscribe`
|
|
22
|
+
*/
|
|
23
|
+
export type OnResultSubscription<Data, Variables> = (res: QueryResult<Data, Variables>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Signature for `OnErrorSubscription` for `subscribe`
|
|
26
|
+
*/
|
|
27
|
+
export type OnErrorSubscription = (err?: DataConnectError) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Signature for unsubscribe from `subscribe`
|
|
30
|
+
*/
|
|
31
|
+
export type QueryUnsubscribe = () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Representation of user provided subscription options.
|
|
34
|
+
*/
|
|
35
|
+
export interface DataConnectSubscription<Data, Variables> {
|
|
36
|
+
userCallback: OnResultSubscription<Data, Variables>;
|
|
37
|
+
errCallback?: (e?: DataConnectError) => void;
|
|
38
|
+
unsubscribe: () => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* QueryRef object
|
|
42
|
+
*/
|
|
43
|
+
export interface QueryRef<Data, Variables> extends OperationRef<Data, Variables> {
|
|
44
|
+
refType: typeof QUERY_STR;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Result of `executeQuery`
|
|
48
|
+
*/
|
|
49
|
+
export interface QueryResult<Data, Variables> extends DataConnectResult<Data, Variables> {
|
|
50
|
+
ref: QueryRef<Data, Variables>;
|
|
51
|
+
toJSON: () => SerializedRef<Data, Variables>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Promise returned from `executeQuery`
|
|
55
|
+
*/
|
|
56
|
+
export interface QueryPromise<Data, Variables> extends PromiseLike<QueryResult<Data, Variables>> {
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Execute Query
|
|
60
|
+
* @param queryRef query to execute.
|
|
61
|
+
* @returns `QueryPromise`
|
|
62
|
+
*/
|
|
63
|
+
export declare function executeQuery<Data, Variables>(queryRef: QueryRef<Data, Variables>): QueryPromise<Data, Variables>;
|
|
64
|
+
/**
|
|
65
|
+
* Execute Query
|
|
66
|
+
* @param dcInstance Data Connect instance to use.
|
|
67
|
+
* @param queryName Query to execute
|
|
68
|
+
* @returns `QueryRef`
|
|
69
|
+
*/
|
|
70
|
+
export declare function queryRef<Data>(dcInstance: DataConnect, queryName: string): QueryRef<Data, undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* Execute Query
|
|
73
|
+
* @param dcInstance Data Connect instance to use.
|
|
74
|
+
* @param queryName Query to execute
|
|
75
|
+
* @param variables Variables to execute with
|
|
76
|
+
* @returns `QueryRef`
|
|
77
|
+
*/
|
|
78
|
+
export declare function queryRef<Data, Variables>(dcInstance: DataConnect, queryName: string, variables: Variables): QueryRef<Data, Variables>;
|
|
79
|
+
/**
|
|
80
|
+
* Converts serialized ref to query ref
|
|
81
|
+
* @param serializedRef ref to convert to `QueryRef`
|
|
82
|
+
* @returns `QueryRef`
|
|
83
|
+
*/
|
|
84
|
+
export declare function toQueryRef<Data, Variables>(serializedRef: SerializedRef<Data, Variables>): QueryRef<Data, Variables>;
|
|
85
|
+
/**
|
|
86
|
+
* `OnCompleteSubscription`
|
|
87
|
+
*/
|
|
88
|
+
export type OnCompleteSubscription = () => void;
|
|
89
|
+
/**
|
|
90
|
+
* Representation of full observer options in `subscribe`
|
|
91
|
+
*/
|
|
92
|
+
export interface SubscriptionOptions<Data, Variables> {
|
|
93
|
+
onNext?: OnResultSubscription<Data, Variables>;
|
|
94
|
+
onErr?: OnErrorSubscription;
|
|
95
|
+
onComplete?: OnCompleteSubscription;
|
|
96
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { OnCompleteSubscription, OnErrorSubscription, OnResultSubscription, QueryRef, QueryUnsubscribe, SubscriptionOptions } from './api/query';
|
|
18
|
-
import { SerializedRef } from './api/Reference';
|
|
19
|
-
/**
|
|
20
|
-
* Subscribe to a `QueryRef`
|
|
21
|
-
* @param queryRefOrSerializedResult query ref or serialized result.
|
|
22
|
-
* @param observer observer object to use for subscribing.
|
|
23
|
-
* @returns `SubscriptionOptions`
|
|
24
|
-
*/
|
|
25
|
-
export declare function subscribe<Data, Variables>(queryRefOrSerializedResult: QueryRef<Data, Variables> | SerializedRef<Data, Variables>, observer: SubscriptionOptions<Data, Variables>): QueryUnsubscribe;
|
|
26
|
-
/**
|
|
27
|
-
* Subscribe to a `QueryRef`
|
|
28
|
-
* @param queryRefOrSerializedResult query ref or serialized result.
|
|
29
|
-
* @param onNext Callback to call when result comes back.
|
|
30
|
-
* @param onError Callback to call when error gets thrown.
|
|
31
|
-
* @param onComplete Called when subscription completes.
|
|
32
|
-
* @returns `SubscriptionOptions`
|
|
33
|
-
*/
|
|
34
|
-
export declare function subscribe<Data, Variables>(queryRefOrSerializedResult: QueryRef<Data, Variables> | SerializedRef<Data, Variables>, onNext: OnResultSubscription<Data, Variables>, onError?: OnErrorSubscription, onComplete?: OnCompleteSubscription): QueryUnsubscribe;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { OnCompleteSubscription, OnErrorSubscription, OnResultSubscription, QueryRef, QueryUnsubscribe, SubscriptionOptions } from './api/query';
|
|
18
|
+
import { SerializedRef } from './api/Reference';
|
|
19
|
+
/**
|
|
20
|
+
* Subscribe to a `QueryRef`
|
|
21
|
+
* @param queryRefOrSerializedResult query ref or serialized result.
|
|
22
|
+
* @param observer observer object to use for subscribing.
|
|
23
|
+
* @returns `SubscriptionOptions`
|
|
24
|
+
*/
|
|
25
|
+
export declare function subscribe<Data, Variables>(queryRefOrSerializedResult: QueryRef<Data, Variables> | SerializedRef<Data, Variables>, observer: SubscriptionOptions<Data, Variables>): QueryUnsubscribe;
|
|
26
|
+
/**
|
|
27
|
+
* Subscribe to a `QueryRef`
|
|
28
|
+
* @param queryRefOrSerializedResult query ref or serialized result.
|
|
29
|
+
* @param onNext Callback to call when result comes back.
|
|
30
|
+
* @param onError Callback to call when error gets thrown.
|
|
31
|
+
* @param onComplete Called when subscription completes.
|
|
32
|
+
* @returns `SubscriptionOptions`
|
|
33
|
+
*/
|
|
34
|
+
export declare function subscribe<Data, Variables>(queryRefOrSerializedResult: QueryRef<Data, Variables> | SerializedRef<Data, Variables>, onNext: OnResultSubscription<Data, Variables>, onError?: OnErrorSubscription, onComplete?: OnCompleteSubscription): QueryUnsubscribe;
|
package/dist/src/api.node.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
export { subscribe } from './api.browser';
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export { subscribe } from './api.browser';
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { AppCheckInternalComponentName, AppCheckTokenListener, AppCheckTokenResult } from '@firebase/app-check-interop-types';
|
|
18
|
-
import { Provider } from '@firebase/component';
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
* Abstraction around AppCheck's token fetching capabilities.
|
|
22
|
-
*/
|
|
23
|
-
export declare class AppCheckTokenProvider {
|
|
24
|
-
private appName_;
|
|
25
|
-
private appCheckProvider?;
|
|
26
|
-
private appCheck?;
|
|
27
|
-
constructor(appName_: string, appCheckProvider?: Provider<AppCheckInternalComponentName>);
|
|
28
|
-
getToken(forceRefresh?: boolean): Promise<AppCheckTokenResult>;
|
|
29
|
-
addTokenChangeListener(listener: AppCheckTokenListener): void;
|
|
30
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { AppCheckInternalComponentName, AppCheckTokenListener, AppCheckTokenResult } from '@firebase/app-check-interop-types';
|
|
18
|
+
import { Provider } from '@firebase/component';
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
* Abstraction around AppCheck's token fetching capabilities.
|
|
22
|
+
*/
|
|
23
|
+
export declare class AppCheckTokenProvider {
|
|
24
|
+
private appName_;
|
|
25
|
+
private appCheckProvider?;
|
|
26
|
+
private appCheck?;
|
|
27
|
+
constructor(appName_: string, appCheckProvider?: Provider<AppCheckInternalComponentName>);
|
|
28
|
+
getToken(forceRefresh?: boolean): Promise<AppCheckTokenResult>;
|
|
29
|
+
addTokenChangeListener(listener: AppCheckTokenListener): void;
|
|
30
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { FirebaseOptions } from '@firebase/app-types';
|
|
18
|
-
import { FirebaseAuthInternalName, FirebaseAuthTokenData } from '@firebase/auth-interop-types';
|
|
19
|
-
import { Provider } from '@firebase/component';
|
|
20
|
-
export interface AuthTokenProvider {
|
|
21
|
-
getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData | null>;
|
|
22
|
-
addTokenChangeListener(listener: AuthTokenListener): void;
|
|
23
|
-
}
|
|
24
|
-
export
|
|
25
|
-
export declare class FirebaseAuthProvider implements AuthTokenProvider {
|
|
26
|
-
private _appName;
|
|
27
|
-
private _options;
|
|
28
|
-
private _authProvider;
|
|
29
|
-
private _auth;
|
|
30
|
-
constructor(_appName: string, _options: FirebaseOptions, _authProvider: Provider<FirebaseAuthInternalName>);
|
|
31
|
-
getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData | null>;
|
|
32
|
-
addTokenChangeListener(listener: AuthTokenListener): void;
|
|
33
|
-
removeTokenChangeListener(listener: (token: string | null) => void): void;
|
|
34
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { FirebaseOptions } from '@firebase/app-types';
|
|
18
|
+
import { FirebaseAuthInternalName, FirebaseAuthTokenData } from '@firebase/auth-interop-types';
|
|
19
|
+
import { Provider } from '@firebase/component';
|
|
20
|
+
export interface AuthTokenProvider {
|
|
21
|
+
getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData | null>;
|
|
22
|
+
addTokenChangeListener(listener: AuthTokenListener): void;
|
|
23
|
+
}
|
|
24
|
+
export type AuthTokenListener = (token: string | null) => void;
|
|
25
|
+
export declare class FirebaseAuthProvider implements AuthTokenProvider {
|
|
26
|
+
private _appName;
|
|
27
|
+
private _options;
|
|
28
|
+
private _authProvider;
|
|
29
|
+
private _auth;
|
|
30
|
+
constructor(_appName: string, _options: FirebaseOptions, _authProvider: Provider<FirebaseAuthInternalName>);
|
|
31
|
+
getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData | null>;
|
|
32
|
+
addTokenChangeListener(listener: AuthTokenListener): void;
|
|
33
|
+
removeTokenChangeListener(listener: (token: string | null) => void): void;
|
|
34
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { DataConnectSubscription, OnErrorSubscription, OnResultSubscription, QueryPromise, QueryRef } from '../api/query';
|
|
18
|
-
import { OperationRef, OpResult } from '../api/Reference';
|
|
19
|
-
import { DataConnectTransport } from '../network';
|
|
20
|
-
import { DataConnectError } from './error';
|
|
21
|
-
interface TrackedQuery<Data, Variables> {
|
|
22
|
-
ref: Omit<OperationRef<Data, Variables>, 'dataConnect'>;
|
|
23
|
-
subscriptions: Array<DataConnectSubscription<Data, Variables>>;
|
|
24
|
-
currentCache: OpResult<Data> | null;
|
|
25
|
-
lastError: DataConnectError | null;
|
|
26
|
-
}
|
|
27
|
-
export declare class QueryManager {
|
|
28
|
-
private transport;
|
|
29
|
-
_queries: Map<string, TrackedQuery<unknown, unknown>>;
|
|
30
|
-
constructor(transport: DataConnectTransport);
|
|
31
|
-
track<Data, Variables>(queryName: string, variables: Variables, initialCache?: OpResult<Data>): TrackedQuery<Data, Variables>;
|
|
32
|
-
addSubscription<Data, Variables>(queryRef: OperationRef<Data, Variables>, onResultCallback: OnResultSubscription<Data, Variables>, onErrorCallback?: OnErrorSubscription, initialCache?: OpResult<Data>): () => void;
|
|
33
|
-
executeQuery<Data, Variables>(queryRef: QueryRef<Data, Variables>): QueryPromise<Data, Variables>;
|
|
34
|
-
enableEmulator(host: string, port: number): void;
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { DataConnectSubscription, OnErrorSubscription, OnResultSubscription, QueryPromise, QueryRef } from '../api/query';
|
|
18
|
+
import { OperationRef, OpResult } from '../api/Reference';
|
|
19
|
+
import { DataConnectTransport } from '../network';
|
|
20
|
+
import { DataConnectError } from './error';
|
|
21
|
+
interface TrackedQuery<Data, Variables> {
|
|
22
|
+
ref: Omit<OperationRef<Data, Variables>, 'dataConnect'>;
|
|
23
|
+
subscriptions: Array<DataConnectSubscription<Data, Variables>>;
|
|
24
|
+
currentCache: OpResult<Data> | null;
|
|
25
|
+
lastError: DataConnectError | null;
|
|
26
|
+
}
|
|
27
|
+
export declare class QueryManager {
|
|
28
|
+
private transport;
|
|
29
|
+
_queries: Map<string, TrackedQuery<unknown, unknown>>;
|
|
30
|
+
constructor(transport: DataConnectTransport);
|
|
31
|
+
track<Data, Variables>(queryName: string, variables: Variables, initialCache?: OpResult<Data>): TrackedQuery<Data, Variables>;
|
|
32
|
+
addSubscription<Data, Variables>(queryRef: OperationRef<Data, Variables>, onResultCallback: OnResultSubscription<Data, Variables>, onErrorCallback?: OnErrorSubscription, initialCache?: OpResult<Data>): () => void;
|
|
33
|
+
executeQuery<Data, Variables>(queryRef: QueryRef<Data, Variables>): QueryPromise<Data, Variables>;
|
|
34
|
+
enableEmulator(host: string, port: number): void;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
package/dist/src/core/error.d.ts
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
import { FirebaseError } from '@firebase/util';
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export declare const Code: {
|
|
21
|
-
OTHER: DataConnectErrorCode;
|
|
22
|
-
ALREADY_INITIALIZED: DataConnectErrorCode;
|
|
23
|
-
NOT_INITIALIZED: DataConnectErrorCode;
|
|
24
|
-
NOT_SUPPORTED: DataConnectErrorCode;
|
|
25
|
-
INVALID_ARGUMENT: DataConnectErrorCode;
|
|
26
|
-
PARTIAL_ERROR: DataConnectErrorCode;
|
|
27
|
-
UNAUTHORIZED: DataConnectErrorCode;
|
|
28
|
-
};
|
|
29
|
-
/** An error returned by a DataConnect operation. */
|
|
30
|
-
export declare class DataConnectError extends FirebaseError {
|
|
31
|
-
/**
|
|
32
|
-
* The backend error code associated with this error.
|
|
33
|
-
*/
|
|
34
|
-
readonly code: DataConnectErrorCode;
|
|
35
|
-
/**
|
|
36
|
-
* A custom error description.
|
|
37
|
-
*/
|
|
38
|
-
readonly message: string;
|
|
39
|
-
/** The stack of the error. */
|
|
40
|
-
readonly stack?: string;
|
|
41
|
-
/** @hideconstructor */
|
|
42
|
-
constructor(
|
|
43
|
-
/**
|
|
44
|
-
* The backend error code associated with this error.
|
|
45
|
-
*/
|
|
46
|
-
code: DataConnectErrorCode,
|
|
47
|
-
/**
|
|
48
|
-
* A custom error description.
|
|
49
|
-
*/
|
|
50
|
-
message: string);
|
|
51
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { FirebaseError } from '@firebase/util';
|
|
18
|
+
export type DataConnectErrorCode = 'other' | 'already-initialized' | 'not-initialized' | 'not-supported' | 'invalid-argument' | 'partial-error' | 'unauthorized';
|
|
19
|
+
export type Code = DataConnectErrorCode;
|
|
20
|
+
export declare const Code: {
|
|
21
|
+
OTHER: DataConnectErrorCode;
|
|
22
|
+
ALREADY_INITIALIZED: DataConnectErrorCode;
|
|
23
|
+
NOT_INITIALIZED: DataConnectErrorCode;
|
|
24
|
+
NOT_SUPPORTED: DataConnectErrorCode;
|
|
25
|
+
INVALID_ARGUMENT: DataConnectErrorCode;
|
|
26
|
+
PARTIAL_ERROR: DataConnectErrorCode;
|
|
27
|
+
UNAUTHORIZED: DataConnectErrorCode;
|
|
28
|
+
};
|
|
29
|
+
/** An error returned by a DataConnect operation. */
|
|
30
|
+
export declare class DataConnectError extends FirebaseError {
|
|
31
|
+
/**
|
|
32
|
+
* The backend error code associated with this error.
|
|
33
|
+
*/
|
|
34
|
+
readonly code: DataConnectErrorCode;
|
|
35
|
+
/**
|
|
36
|
+
* A custom error description.
|
|
37
|
+
*/
|
|
38
|
+
readonly message: string;
|
|
39
|
+
/** The stack of the error. */
|
|
40
|
+
readonly stack?: string;
|
|
41
|
+
/** @hideconstructor */
|
|
42
|
+
constructor(
|
|
43
|
+
/**
|
|
44
|
+
* The backend error code associated with this error.
|
|
45
|
+
*/
|
|
46
|
+
code: DataConnectErrorCode,
|
|
47
|
+
/**
|
|
48
|
+
* A custom error description.
|
|
49
|
+
*/
|
|
50
|
+
message: string);
|
|
51
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2024 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
/** The semver (www.semver.org) version of the SDK. */
|
|
18
|
-
export declare let SDK_VERSION: string;
|
|
19
|
-
/**
|
|
20
|
-
* SDK_VERSION should be set before any database instance is created
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export declare function setSDKVersion(version: string): void;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/** The semver (www.semver.org) version of the SDK. */
|
|
18
|
+
export declare let SDK_VERSION: string;
|
|
19
|
+
/**
|
|
20
|
+
* SDK_VERSION should be set before any database instance is created
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function setSDKVersion(version: string): void;
|