@firebase/data-connect 0.1.3 → 0.2.0-canary.01f36ea41
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/README.md +5 -0
- package/dist/index.cjs.js +16 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +17 -21
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +16 -20
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/internal.d.ts +7 -13
- package/dist/node-esm/index.node.esm.js +17 -21
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api/Mutation.d.ts +1 -1
- package/dist/node-esm/src/api/query.d.ts +1 -1
- package/dist/node-esm/src/core/AppCheckTokenProvider.d.ts +4 -3
- package/dist/node-esm/src/network/fetch.d.ts +6 -1
- package/dist/node-esm/src/network/transport/index.d.ts +2 -7
- package/dist/node-esm/src/network/transport/rest.d.ts +2 -2
- package/dist/private.d.ts +2 -8
- package/dist/public.d.ts +2 -7
- package/dist/src/api/Mutation.d.ts +1 -1
- package/dist/src/api/query.d.ts +1 -1
- package/dist/src/core/AppCheckTokenProvider.d.ts +4 -3
- package/dist/src/network/fetch.d.ts +6 -1
- package/dist/src/network/transport/index.d.ts +2 -7
- package/dist/src/network/transport/rest.d.ts +2 -2
- package/package.json +11 -11
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { FirebaseApp } from '@firebase/app';
|
|
17
18
|
import { AppCheckInternalComponentName, AppCheckTokenListener, AppCheckTokenResult } from '@firebase/app-check-interop-types';
|
|
18
19
|
import { Provider } from '@firebase/component';
|
|
19
20
|
/**
|
|
@@ -21,10 +22,10 @@ import { Provider } from '@firebase/component';
|
|
|
21
22
|
* Abstraction around AppCheck's token fetching capabilities.
|
|
22
23
|
*/
|
|
23
24
|
export declare class AppCheckTokenProvider {
|
|
24
|
-
private appName_;
|
|
25
25
|
private appCheckProvider?;
|
|
26
26
|
private appCheck?;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
private serverAppAppCheckToken?;
|
|
28
|
+
constructor(app: FirebaseApp, appCheckProvider?: Provider<AppCheckInternalComponentName>);
|
|
29
|
+
getToken(): Promise<AppCheckTokenResult>;
|
|
29
30
|
addTokenChangeListener(listener: AppCheckTokenListener): void;
|
|
30
31
|
}
|
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
export declare function initializeFetch(fetchImpl: typeof fetch): void;
|
|
18
|
-
export
|
|
18
|
+
export interface DataConnectFetchBody<T> {
|
|
19
|
+
name: string;
|
|
20
|
+
operationName: string;
|
|
21
|
+
variables: T;
|
|
22
|
+
}
|
|
23
|
+
export declare function dcFetch<T, U>(url: string, body: DataConnectFetchBody<U>, { signal }: AbortController, appId: string | null, accessToken: string | null, appCheckToken: string | null, _isUsingGen: boolean): Promise<{
|
|
19
24
|
data: T;
|
|
20
25
|
errors: Error[];
|
|
21
26
|
}>;
|
|
@@ -21,22 +21,17 @@ import { AuthTokenProvider } from '../../core/FirebaseAuthProvider';
|
|
|
21
21
|
* @internal
|
|
22
22
|
*/
|
|
23
23
|
export interface DataConnectTransport {
|
|
24
|
-
invokeQuery<T, U>(queryName: string, body?: U):
|
|
24
|
+
invokeQuery<T, U>(queryName: string, body?: U): Promise<{
|
|
25
25
|
data: T;
|
|
26
26
|
errors: Error[];
|
|
27
27
|
}>;
|
|
28
|
-
invokeMutation<T, U>(queryName: string, body?: U):
|
|
28
|
+
invokeMutation<T, U>(queryName: string, body?: U): Promise<{
|
|
29
29
|
data: T;
|
|
30
30
|
errors: Error[];
|
|
31
31
|
}>;
|
|
32
32
|
useEmulator(host: string, port?: number, sslEnabled?: boolean): void;
|
|
33
33
|
onTokenChanged: (token: string | null) => void;
|
|
34
34
|
}
|
|
35
|
-
export interface CancellableOperation<T> extends PromiseLike<{
|
|
36
|
-
data: T;
|
|
37
|
-
}> {
|
|
38
|
-
cancel: () => void;
|
|
39
|
-
}
|
|
40
35
|
/**
|
|
41
36
|
* @internal
|
|
42
37
|
*/
|
|
@@ -47,11 +47,11 @@ export declare class RESTTransport implements DataConnectTransport {
|
|
|
47
47
|
data: T;
|
|
48
48
|
errors: Error[];
|
|
49
49
|
}>;
|
|
50
|
-
invokeQuery: <T, U>(queryName: string, body?: U) =>
|
|
50
|
+
invokeQuery: <T, U>(queryName: string, body?: U) => Promise<{
|
|
51
51
|
data: T;
|
|
52
52
|
errors: Error[];
|
|
53
53
|
}>;
|
|
54
|
-
invokeMutation: <T, U>(queryName: string, body?: U) =>
|
|
54
|
+
invokeMutation: <T, U>(queryName: string, body?: U) => Promise<{
|
|
55
55
|
data: T;
|
|
56
56
|
errors: Error[];
|
|
57
57
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/data-connect",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-canary.01f36ea41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.node.cjs.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'",
|
|
32
32
|
"build:deps": "lerna run --scope @firebase/'{app,data-connect}' --include-dependencies build",
|
|
33
33
|
"dev": "rollup -c -w",
|
|
34
|
-
"test": "run-p --npm-path npm test:emulator",
|
|
35
|
-
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:
|
|
36
|
-
"test:all": "run-p --npm-path npm lint test:
|
|
37
|
-
"test:browser": "karma start
|
|
34
|
+
"test": "run-p --npm-path npm lint test:emulator",
|
|
35
|
+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
|
|
36
|
+
"test:all": "run-p --npm-path npm lint test:browser test:node",
|
|
37
|
+
"test:browser": "karma start",
|
|
38
38
|
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
|
|
39
39
|
"test:unit": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/unit/**/*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
|
|
40
40
|
"test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/dataconnect-test-runner.ts",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
},
|
|
46
46
|
"license": "Apache-2.0",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@firebase/app": "0.
|
|
48
|
+
"@firebase/app": "0.10.18-canary.01f36ea41"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@firebase/auth-interop-types": "0.2.4",
|
|
52
|
-
"@firebase/component": "0.6.
|
|
53
|
-
"@firebase/logger": "0.4.4",
|
|
54
|
-
"@firebase/util": "1.10.
|
|
51
|
+
"@firebase/auth-interop-types": "0.2.4-canary.01f36ea41",
|
|
52
|
+
"@firebase/component": "0.6.12-canary.01f36ea41",
|
|
53
|
+
"@firebase/logger": "0.4.4-canary.01f36ea41",
|
|
54
|
+
"@firebase/util": "1.10.3-canary.01f36ea41",
|
|
55
55
|
"tslib": "^2.1.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@firebase/app": "0.10.
|
|
58
|
+
"@firebase/app": "0.10.18-canary.01f36ea41",
|
|
59
59
|
"rollup": "2.79.1",
|
|
60
60
|
"rollup-plugin-typescript2": "0.31.2",
|
|
61
61
|
"typescript": "5.5.4"
|