Skip to content

Commit 79cbcf3

Browse files
committed
Merge branch 'dataconnect' into mtewani/add-heartbeat-dc
2 parents bf4faab + 01ca9df commit 79cbcf3

File tree

10 files changed

+32
-27
lines changed

10 files changed

+32
-27
lines changed

packages/data-connect/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646
},
4747
"license": "Apache-2.0",
4848
"dependencies": {
49-
"@firebase/auth-interop-types": "0.2.2",
50-
"@firebase/component": "0.6.6",
51-
"@firebase/logger": "0.4.1",
52-
"@firebase/util": "1.9.5",
49+
"@firebase/auth-interop-types": "0.2.3",
50+
"@firebase/component": "0.6.7",
51+
"@firebase/logger": "0.4.2",
52+
"@firebase/util": "1.9.6",
5353
"tslib": "^2.1.0"
5454
},
5555
"devDependencies": {
56-
"@firebase/app": "0.10.2",
56+
"@firebase/app": "0.10.5",
5757
"rollup": "2.79.1",
5858
"rollup-plugin-typescript2": "0.31.2",
5959
"typescript": "4.7.4"

packages/data-connect/src/api/DataConnect.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import { RESTTransport } from '../network/transport/rest';
3636

3737
import { MutationManager } from './Mutation';
3838

39-
4039
/**
4140
* Connector Config for calling Data Connect backend.
4241
*/
@@ -131,10 +130,10 @@ export class DataConnect {
131130

132131
if (this._authProvider) {
133132
this._authTokenProvider = new FirebaseAuthProvider(
134-
this.app.name,
135-
this.app.options,
136-
this._authProvider
137-
);
133+
this.app.name,
134+
this.app.options,
135+
this._authProvider
136+
);
138137
}
139138

140139
this.initialized = true;
@@ -239,7 +238,7 @@ export function getDataConnect(
239238
/**
240239
* Delete DataConnect instance
241240
* @param dataConnect DataConnect instance
242-
* @returns
241+
* @returns
243242
*/
244243
export function terminate(dataConnect: DataConnect): Promise<void> {
245244
return dataConnect._delete();

packages/data-connect/src/api/Mutation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function mutationRef<Data>(
4040
mutationName: string
4141
): MutationRef<Data, undefined>;
4242
/**
43-
*
43+
*
4444
* @param dcInstance Data Connect instance
4545
* @param mutationName name of mutation
4646
* @param variables variables to send with mutation
@@ -51,7 +51,7 @@ export function mutationRef<Data, Variables>(
5151
variables: Variables
5252
): MutationRef<Data, Variables>;
5353
/**
54-
*
54+
*
5555
* @param dcInstance Data Connect instance
5656
* @param mutationName name of mutation
5757
* @param variables variables to send with mutation

packages/data-connect/src/core/FirebaseAuthProvider.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,3 @@ export class FirebaseAuthProvider implements AuthTokenProvider {
7979
.then(auth => auth.removeAuthTokenListener(listener));
8080
}
8181
}
82-

packages/data-connect/src/core/QueryManager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ export class QueryManager {
163163
queryRef.variables
164164
)}. Calling executeQuery.`
165165
);
166-
const promise = this.executeQuery(
167-
queryRef as QueryRef<Data, Variables>
168-
);
166+
const promise = this.executeQuery(queryRef as QueryRef<Data, Variables>);
169167
// We want to ignore the error and let subscriptions handle it
170168
promise.then(undefined, err => {});
171169
}

packages/data-connect/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ export * from './api.browser';
2929

3030
registerDataConnect();
3131

32-
3332
declare module '@firebase/component' {
3433
interface NameServiceMapping {
3534
'data-connect': DataConnect;
3635
}
37-
}
36+
}

packages/data-connect/src/network/fetch.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ export function dcFetch<T, U>(
4444
method: 'POST',
4545
headers,
4646
signal
47-
}).catch(err => {
48-
throw new DataConnectError(Code.OTHER, "Failed to fetch: " + JSON.stringify(err));
4947
})
48+
.catch(err => {
49+
throw new DataConnectError(
50+
Code.OTHER,
51+
'Failed to fetch: ' + JSON.stringify(err)
52+
);
53+
})
5054
.then(async response => {
5155
let jsonResponse = null;
5256
try {

packages/data-connect/src/util/map.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
* limitations under the License.
1616
*/
1717

18-
export function setIfNotExists<T>(map: Map<string, T>, key: string, val: T): void {
18+
export function setIfNotExists<T>(
19+
map: Map<string, T>,
20+
key: string,
21+
val: T
22+
): void {
1923
if (!map.has(key)) {
2024
map.set(key, val);
2125
}

packages/data-connect/test/emulatorSeeder.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ import * as path from 'path';
3838
// }
3939
// }
4040

41-
42-
4341
import { ReferenceType } from '../src';
4442

4543
// }

packages/data-connect/test/queries.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ import {
3131
QueryResult,
3232
SerializedRef,
3333
subscribe,
34-
terminate
35-
, SOURCE_CACHE, SOURCE_SERVER } from '../src';
34+
terminate,
35+
SOURCE_CACHE,
36+
SOURCE_SERVER
37+
} from '../src';
3638

3739
import { setupQueries } from './emulatorSeeder';
3840
import { getConnectionConfig, initDatabase, PROJECT_ID } from './util';
@@ -161,7 +163,9 @@ describe('DataConnect Tests', async () => {
161163
});
162164
connectDataConnectEmulator(fakeInstance, 'localhost', Number(0));
163165
const taskListQuery = queryRef<TaskListResponse>(dc, 'listPosts');
164-
expect(await executeQuery(taskListQuery)).to.eventually.be.rejectedWith('ECONNREFUSED');
166+
expect(await executeQuery(taskListQuery)).to.eventually.be.rejectedWith(
167+
'ECONNREFUSED'
168+
);
165169
});
166170
});
167171
async function waitForFirstEvent<Data, Variables>(

0 commit comments

Comments
 (0)