@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.
@@ -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
- constructor(appName_: string, appCheckProvider?: Provider<AppCheckInternalComponentName>);
28
- getToken(forceRefresh?: boolean): Promise<AppCheckTokenResult>;
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 declare function dcFetch<T, U>(url: string, body: U, { signal }: AbortController, appId: string | null, accessToken: string | null, appCheckToken: string | null, _isUsingGen: boolean): Promise<{
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): PromiseLike<{
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): PromiseLike<{
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) => PromiseLike<{
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) => PromiseLike<{
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.1.3",
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:emulator",
36
- "test:all": "run-p --npm-path npm lint test:unit",
37
- "test:browser": "karma start --single-run",
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.x"
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.11",
53
- "@firebase/logger": "0.4.4",
54
- "@firebase/util": "1.10.2",
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.17",
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"