Skip to content

Commit e203796

Browse files
Merge
2 parents 794e9f7 + 59a7208 commit e203796

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2540
-1057
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ packages/auth-types @bojeil-google @wti806
2929

3030
# Testing Code
3131
packages/testing @tonymeng @ryanpbrewster
32+
33+
# RxFire Code
34+
packages/rxfire @davideast

integration/browserify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "karma start --single-run"
88
},
99
"dependencies": {
10-
"firebase": "5.2.0"
10+
"firebase": "5.3.0"
1111
},
1212
"devDependencies": {
1313
"@babel/core": "7.0.0-beta.47",

integration/firebase-typings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "tsc index.ts --outDir dist"
77
},
88
"dependencies": {
9-
"firebase": "5.2.0"
9+
"firebase": "5.3.0"
1010
},
1111
"devDependencies": {
1212
"typescript": "2.8.1"

integration/messaging/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test:manual": "mocha --exit"
99
},
1010
"dependencies": {
11-
"firebase": "5.2.0"
11+
"firebase": "5.3.0"
1212
},
1313
"devDependencies": {
1414
"chai": "4.1.2",

integration/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "karma start --single-run"
77
},
88
"dependencies": {
9-
"firebase": "5.2.0"
9+
"firebase": "5.3.0"
1010
},
1111
"devDependencies": {
1212
"@babel/core": "7.0.0-beta.47",

integration/webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "karma start --single-run"
88
},
99
"dependencies": {
10-
"firebase": "5.2.0"
10+
"firebase": "5.3.0"
1111
},
1212
"devDependencies": {
1313
"@babel/core": "7.0.0-beta.47",

packages/auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/auth",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"main": "dist/auth.js",
55
"module": "dist/auth.esm.js",
66
"description": "Javascript library for Firebase Auth SDK",

packages/auth/src/rpchandler.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ fireauth.RpcHandler.ServerError = {
224224
OPERATION_NOT_ALLOWED: 'OPERATION_NOT_ALLOWED',
225225
PASSWORD_LOGIN_DISABLED: 'PASSWORD_LOGIN_DISABLED',
226226
QUOTA_EXCEEDED: 'QUOTA_EXCEEDED',
227+
RESET_PASSWORD_EXCEED_LIMIT: 'RESET_PASSWORD_EXCEED_LIMIT',
227228
SESSION_EXPIRED: 'SESSION_EXPIRED',
228229
TOKEN_EXPIRED: 'TOKEN_EXPIRED',
229230
TOO_MANY_ATTEMPTS_TRY_LATER: 'TOO_MANY_ATTEMPTS_TRY_LATER',
@@ -2231,6 +2232,8 @@ fireauth.RpcHandler.getDeveloperError_ =
22312232
// Send Password reset email errors:
22322233
errorMap[fireauth.RpcHandler.ServerError.EMAIL_NOT_FOUND] =
22332234
fireauth.authenum.Error.USER_DELETED;
2235+
errorMap[fireauth.RpcHandler.ServerError.RESET_PASSWORD_EXCEED_LIMIT] =
2236+
fireauth.authenum.Error.TOO_MANY_ATTEMPTS_TRY_LATER;
22342237

22352238
// Reset password errors:
22362239
errorMap[fireauth.RpcHandler.ServerError.EXPIRED_OOB_CODE] =

packages/auth/test/rpchandler_test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,6 +3994,8 @@ function testSendPasswordResetEmail_caughtServerError() {
39943994
var errorMap = {};
39953995
errorMap[fireauth.RpcHandler.ServerError.EMAIL_NOT_FOUND] =
39963996
fireauth.authenum.Error.USER_DELETED;
3997+
errorMap[fireauth.RpcHandler.ServerError.RESET_PASSWORD_EXCEED_LIMIT] =
3998+
fireauth.authenum.Error.TOO_MANY_ATTEMPTS_TRY_LATER;
39973999
errorMap[fireauth.RpcHandler.ServerError.INVALID_RECIPIENT_EMAIL] =
39984000
fireauth.authenum.Error.INVALID_RECIPIENT_EMAIL;
39994001
errorMap[fireauth.RpcHandler.ServerError.INVALID_SENDER] =

packages/firebase/index.d.ts

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ declare namespace firebase {
125125
declare namespace firebase.app {
126126
interface App {
127127
auth(): firebase.auth.Auth;
128-
database(): firebase.database.Database;
128+
database(url?: string): firebase.database.Database;
129129
delete(): Promise<any>;
130130
messaging(): firebase.messaging.Messaging;
131131
name: string;
@@ -769,6 +769,27 @@ declare namespace firebase.firestore {
769769
timestampsInSnapshots?: boolean;
770770
}
771771

772+
// TODO(multitab): Uncomment when multi-tab is released publicly.
773+
// /**
774+
// * Settings that can be passed to Firestore.enablePersistence() to configure
775+
// * Firestore persistence.
776+
// */
777+
// export interface PersistenceSettings {
778+
// /**
779+
// * Whether to synchronize the in-memory state of multiple tabs. Setting this
780+
// * to 'true' in all open tabs enables shared access to local persistence,
781+
// * shared execution of queries and latency-compensated local document updates
782+
// * across all connected instances.
783+
// *
784+
// * To enable this mode, `experimentalTabSynchronization:true` needs to be set
785+
// * globally in all active tabs. If omitted or set to 'false',
786+
// * `enablePersistence()` will fail in all but the first tab.
787+
// *
788+
// * NOTE: This mode is not yet recommended for production use.
789+
// */
790+
// experimentalTabSynchronization?: boolean;
791+
// }
792+
772793
export type LogLevel = 'debug' | 'error' | 'silent';
773794

774795
export function setLogLevel(logLevel: LogLevel): void;
@@ -808,6 +829,29 @@ declare namespace firebase.firestore {
808829
*/
809830
enablePersistence(): Promise<void>;
810831

832+
// TODO(multitab): Uncomment when multi-tab is released publicly.
833+
// /**
834+
// * Attempts to enable persistent storage, if possible.
835+
// *
836+
// * Must be called before any other methods (other than settings()).
837+
// *
838+
// * If this fails, enablePersistence() will reject the promise it returns.
839+
// * Note that even after this failure, the firestore instance will remain
840+
// * usable, however offline persistence will be disabled.
841+
// *
842+
// * There are several reasons why this can fail, which can be identified by
843+
// * the `code` on the error.
844+
// *
845+
// * * failed-precondition: The app is already open in another browser tab.
846+
// * * unimplemented: The browser is incompatible with the offline
847+
// * persistence implementation.
848+
// *
849+
// * @param settings Optional settings object to configure persistence.
850+
// * @return A promise that represents successfully enabling persistent
851+
// * storage.
852+
// */
853+
// enablePersistence(settings?: PersistenceSettings): Promise<void>;
854+
811855
/**
812856
* Gets a `CollectionReference` instance that refers to the collection at
813857
* the specified path.
@@ -1559,10 +1603,9 @@ declare namespace firebase.firestore {
15591603

15601604
/**
15611605
* Filter conditions in a `Query.where()` clause are specified using the
1562-
* strings '<', '<=', '==', '>=', and '>'.
1606+
* strings '<', '<=', '==', '>=', '>', and 'array-contains'.
15631607
*/
1564-
// TODO(array-features): Add 'array-contains' once backend support lands.
1565-
export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>';
1608+
export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>' | 'array-contains';
15661609

15671610
/**
15681611
* A `Query` refers to a Query which you can read or listen to. You can also
@@ -1942,8 +1985,7 @@ declare namespace firebase.firestore {
19421985
* @param elements The elements to union into the array.
19431986
* @return The FieldValue sentinel for use in a call to set() or update().
19441987
*/
1945-
// TODO(array-features): Expose this once backend support lands.
1946-
//static arrayUnion(...elements: any[]): FieldValue;
1988+
static arrayUnion(...elements: any[]): FieldValue;
19471989

19481990
/**
19491991
* Returns a special value that can be used with set() or update() that tells
@@ -1955,8 +1997,7 @@ declare namespace firebase.firestore {
19551997
* @param elements The elements to remove from the array.
19561998
* @return The FieldValue sentinel for use in a call to set() or update().
19571999
*/
1958-
// TODO(array-features): Expose this once backend support lands.
1959-
//static arrayRemove(...elements: any[]): FieldValue;
2000+
static arrayRemove(...elements: any[]): FieldValue;
19602001

19612002
/**
19622003
* Returns true if this `FieldValue` is equal to the provided one.

packages/firebase/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebase",
3-
"version": "5.2.0",
3+
"version": "5.3.0",
44
"description": "Firebase JavaScript library for web and Node.js",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"license": "Apache-2.0",
@@ -36,9 +36,9 @@
3636
"react-native": "dist/index.rn.cjs.js",
3737
"dependencies": {
3838
"@firebase/app": "0.3.3",
39-
"@firebase/auth": "0.7.0",
39+
"@firebase/auth": "0.7.1",
4040
"@firebase/database": "0.3.4",
41-
"@firebase/firestore": "0.5.6",
41+
"@firebase/firestore": "0.6.0",
4242
"@firebase/functions": "0.3.0",
4343
"@firebase/messaging": "0.3.5",
4444
"@firebase/polyfill": "0.3.3",

packages/firestore-types/index.d.ts

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,26 @@ export interface Settings {
5757
timestampsInSnapshots?: boolean;
5858
}
5959

60-
/**
61-
* Settings that can be passed to Firestore.enablePersistence() to configure
62-
* Firestore persistence.
63-
*/
64-
export interface PersistenceSettings {
65-
/**
66-
* Whether to synchronize the in-memory state of multiple tabs. Setting this
67-
* to 'true' in all open tabs enables shared access to local persistence,
68-
* shared execution of queries and latency-compensated local document updates
69-
* across all connected instances.
70-
*
71-
* To enable this mode, `experimentalTabSynchronization:true` needs to be set
72-
* globally in all active tabs. If omitted or set to 'false',
73-
* `enablePersistence()` will fail in all but the first tab.
74-
*
75-
* NOTE: This mode is not yet recommended for production use.
76-
*/
77-
experimentalTabSynchronization?: boolean;
78-
}
60+
// TODO(multitab): Uncomment when multi-tab is released publicly.
61+
// /**
62+
// * Settings that can be passed to Firestore.enablePersistence() to configure
63+
// * Firestore persistence.
64+
// */
65+
// export interface PersistenceSettings {
66+
// /**
67+
// * Whether to synchronize the in-memory state of multiple tabs. Setting this
68+
// * to 'true' in all open tabs enables shared access to local persistence,
69+
// * shared execution of queries and latency-compensated local document updates
70+
// * across all connected instances.
71+
// *
72+
// * To enable this mode, `experimentalTabSynchronization:true` needs to be set
73+
// * globally in all active tabs. If omitted or set to 'false',
74+
// * `enablePersistence()` will fail in all but the first tab.
75+
// *
76+
// * NOTE: This mode is not yet recommended for production use.
77+
// */
78+
// experimentalTabSynchronization?: boolean;
79+
// }
7980

8081
export type LogLevel = 'debug' | 'error' | 'silent';
8182

@@ -111,11 +112,33 @@ export class FirebaseFirestore {
111112
* * unimplemented: The browser is incompatible with the offline
112113
* persistence implementation.
113114
*
114-
* @param settings Optional settings object to configure persistence.
115115
* @return A promise that represents successfully enabling persistent
116116
* storage.
117117
*/
118-
enablePersistence(settings?: PersistenceSettings): Promise<void>;
118+
enablePersistence(): Promise<void>;
119+
120+
// TODO(multitab): Uncomment when multi-tab is released publicly.
121+
// /**
122+
// * Attempts to enable persistent storage, if possible.
123+
// *
124+
// * Must be called before any other methods (other than settings()).
125+
// *
126+
// * If this fails, enablePersistence() will reject the promise it returns.
127+
// * Note that even after this failure, the firestore instance will remain
128+
// * usable, however offline persistence will be disabled.
129+
// *
130+
// * There are several reasons why this can fail, which can be identified by
131+
// * the `code` on the error.
132+
// *
133+
// * * failed-precondition: The app is already open in another browser tab.
134+
// * * unimplemented: The browser is incompatible with the offline
135+
// * persistence implementation.
136+
// *
137+
// * @param settings Optional settings object to configure persistence.
138+
// * @return A promise that represents successfully enabling persistent
139+
// * storage.
140+
// */
141+
// enablePersistence(settings?: PersistenceSettings): Promise<void>;
119142

120143
/**
121144
* Gets a `CollectionReference` instance that refers to the collection at
@@ -868,10 +891,9 @@ export type OrderByDirection = 'desc' | 'asc';
868891

869892
/**
870893
* Filter conditions in a `Query.where()` clause are specified using the
871-
* strings '<', '<=', '==', '>=', and '>'.
894+
* strings '<', '<=', '==', '>=', '>', and 'array-contains'.
872895
*/
873-
// TODO(array-features): Add 'array-contains' once backend support lands.
874-
export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>';
896+
export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>' | 'array-contains';
875897

876898
/**
877899
* A `Query` refers to a Query which you can read or listen to. You can also
@@ -1247,8 +1269,7 @@ export class FieldValue {
12471269
* @param elements The elements to union into the array.
12481270
* @return The FieldValue sentinel for use in a call to set() or update().
12491271
*/
1250-
// TODO(array-features): Expose this once backend support lands.
1251-
//static arrayUnion(...elements: any[]): FieldValue;
1272+
static arrayUnion(...elements: any[]): FieldValue;
12521273

12531274
/**
12541275
* Returns a special value that can be used with set() or update() that tells
@@ -1260,8 +1281,7 @@ export class FieldValue {
12601281
* @param elements The elements to remove from the array.
12611282
* @return The FieldValue sentinel for use in a call to set() or update().
12621283
*/
1263-
// TODO(array-features): Expose this once backend support lands.
1264-
//static arrayRemove(...elements: any[]): FieldValue;
1284+
static arrayRemove(...elements: any[]): FieldValue;
12651285

12661286
/**
12671287
* Returns true if this `FieldValue` is equal to the provided one.

packages/firestore-types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/firestore-types",
3-
"version": "0.4.3",
3+
"version": "0.5.0",
44
"description": "@firebase/firestore Types",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"license": "Apache-2.0",

packages/firestore/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Unreleased
2+
- [fixed] Fixed an issue where documents could be cached as deleted when
3+
they should not have been, leading to queries returning fewer results than
4+
they should (firebase/firebase-ios-sdk#1548).
5+
- [feature] Added `firebase.firestore.FieldValue.arrayUnion()` and
6+
`firebase.firestore.FieldValue.arrayRemove()` to atomically add and remove
7+
elements from an array field in a document.
8+
- [feature] Added `'array-contains'` query operator for use with `.where()` to
9+
find documents where an array field contains a specific element.
210

311
# 0.5.0
412
- [changed] Merged the `includeQueryMetadataChanges` and

packages/firestore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firebase/firestore",
3-
"version": "0.5.6",
3+
"version": "0.6.0",
44
"description": "",
55
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
66
"scripts": {
@@ -25,7 +25,7 @@
2525
"dist"
2626
],
2727
"dependencies": {
28-
"@firebase/firestore-types": "0.4.3",
28+
"@firebase/firestore-types": "0.5.0",
2929
"@firebase/logger": "0.1.1",
3030
"@firebase/webchannel-wrapper": "0.2.8",
3131
"grpc": "1.11.3",

0 commit comments

Comments
 (0)