@firebase/firestore 3.4.14-canary.fcd4b8ac3 → 3.4.15

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/firestore/src/api/database.d.ts +34 -3
  3. package/dist/firestore/src/core/database_info.d.ts +4 -0
  4. package/dist/firestore/src/lite-api/database.d.ts +51 -7
  5. package/dist/firestore/test/integration/api/provider.test.d.ts +17 -0
  6. package/dist/firestore/test/integration/util/firebase_export.d.ts +2 -1
  7. package/dist/firestore/test/integration/util/helpers.d.ts +1 -0
  8. package/dist/index.d.ts +14 -3
  9. package/dist/index.esm2017.js +67 -68
  10. package/dist/index.esm2017.js.map +1 -1
  11. package/dist/index.esm5.js +52 -55
  12. package/dist/index.esm5.js.map +1 -1
  13. package/dist/index.node.cjs.js +47 -42
  14. package/dist/index.node.cjs.js.map +1 -1
  15. package/dist/index.node.mjs +47 -42
  16. package/dist/index.node.mjs.map +1 -1
  17. package/dist/index.rn.js +67 -68
  18. package/dist/index.rn.js.map +1 -1
  19. package/dist/internal.d.ts +40 -6
  20. package/dist/lite/firestore/src/api/database.d.ts +34 -3
  21. package/dist/lite/firestore/src/core/database_info.d.ts +4 -0
  22. package/dist/lite/firestore/src/lite-api/database.d.ts +51 -7
  23. package/dist/lite/firestore/test/integration/api/provider.test.d.ts +17 -0
  24. package/dist/lite/firestore/test/integration/util/firebase_export.d.ts +2 -1
  25. package/dist/lite/firestore/test/integration/util/helpers.d.ts +1 -0
  26. package/dist/lite/index.browser.esm2017.js +43 -57
  27. package/dist/lite/index.browser.esm2017.js.map +1 -1
  28. package/dist/lite/index.browser.esm5.js +181 -184
  29. package/dist/lite/index.browser.esm5.js.map +1 -1
  30. package/dist/lite/index.d.ts +15 -4
  31. package/dist/lite/index.node.cjs.js +37 -45
  32. package/dist/lite/index.node.cjs.js.map +1 -1
  33. package/dist/lite/index.node.mjs +37 -45
  34. package/dist/lite/index.node.mjs.map +1 -1
  35. package/dist/lite/index.rn.esm2017.js +43 -57
  36. package/dist/lite/index.rn.esm2017.js.map +1 -1
  37. package/dist/lite/internal.d.ts +55 -7
  38. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +6 -43
  39. package/dist/lite/packages/firestore/src/api/database.d.ts +34 -3
  40. package/dist/lite/packages/firestore/src/core/database_info.d.ts +4 -0
  41. package/dist/lite/packages/firestore/src/lite-api/database.d.ts +51 -7
  42. package/dist/lite/packages/firestore/test/integration/api/provider.test.d.ts +17 -0
  43. package/dist/lite/packages/firestore/test/integration/util/firebase_export.d.ts +2 -1
  44. package/dist/lite/packages/firestore/test/integration/util/helpers.d.ts +1 -0
  45. package/dist/lite/private.d.ts +22 -7
  46. package/dist/packages/firestore/dist/index.esm2017.d.ts +20 -15
  47. package/dist/packages/firestore/src/api/database.d.ts +34 -3
  48. package/dist/packages/firestore/src/core/database_info.d.ts +4 -0
  49. package/dist/packages/firestore/src/lite-api/database.d.ts +51 -7
  50. package/dist/packages/firestore/test/integration/api/provider.test.d.ts +17 -0
  51. package/dist/packages/firestore/test/integration/util/firebase_export.d.ts +2 -1
  52. package/dist/packages/firestore/test/integration/util/helpers.d.ts +1 -0
  53. package/dist/private.d.ts +21 -7
  54. package/package.json +10 -9
@@ -34,18 +34,18 @@ declare module '@firebase/component' {
34
34
  export declare class Firestore implements FirestoreService {
35
35
  _authCredentials: CredentialsProvider<User>;
36
36
  _appCheckCredentials: CredentialsProvider<string>;
37
+ readonly _databaseId: DatabaseId;
38
+ readonly _app?: FirebaseApp | undefined;
37
39
  /**
38
40
  * Whether it's a Firestore or Firestore Lite instance.
39
41
  */
40
42
  type: 'firestore-lite' | 'firestore';
41
- readonly _databaseId: DatabaseId;
42
43
  readonly _persistenceKey: string;
43
44
  private _settings;
44
45
  private _settingsFrozen;
45
46
  private _terminateTask?;
46
- _app?: FirebaseApp;
47
47
  /** @hideconstructor */
48
- constructor(databaseIdOrApp: DatabaseId | FirebaseApp, _authCredentials: CredentialsProvider<User>, _appCheckCredentials: CredentialsProvider<string>);
48
+ constructor(_authCredentials: CredentialsProvider<User>, _appCheckCredentials: CredentialsProvider<string>, _databaseId: DatabaseId, _app?: FirebaseApp | undefined);
49
49
  /**
50
50
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
51
51
  * instance.
@@ -81,15 +81,59 @@ export declare class Firestore implements FirestoreService {
81
81
  */
82
82
  export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
83
83
  /**
84
- * Returns the existing `Firestore` instance that is associated with the
84
+ * Initializes a new instance of Cloud Firestore with the provided settings.
85
+ * Can only be called before any other functions, including
86
+ * {@link getFirestore}. If the custom settings are empty, this function is
87
+ * equivalent to calling {@link getFirestore}.
88
+ *
89
+ * @param app - The {@link @firebase/app#FirebaseApp} with which the `Firestore` instance will
90
+ * be associated.
91
+ * @param settings - A settings object to configure the `Firestore` instance.
92
+ * @param databaseId - The name of database.
93
+ * @returns A newly initialized `Firestore` instance.
94
+ * @internal
95
+ */
96
+ export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
97
+ /**
98
+ * Returns the existing default {@link Firestore} instance that is associated with the
99
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
100
+ * instance with default settings.
101
+ *
102
+ * @returns The {@link Firestore} instance of the provided app.
103
+ */
104
+ export declare function getFirestore(): Firestore;
105
+ /**
106
+ * Returns the existing default {@link Firestore} instance that is associated with the
107
+ * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
108
+ * instance with default settings.
109
+ *
110
+ * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
111
+ * instance is associated with.
112
+ * @returns The {@link Firestore} instance of the provided app.
113
+ */
114
+ export declare function getFirestore(app: FirebaseApp): Firestore;
115
+ /**
116
+ * Returns the existing {@link Firestore} instance that is associated with the
117
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
118
+ * instance with default settings.
119
+ *
120
+ * @param databaseId - The name of database.
121
+ * @returns The {@link Firestore} instance of the provided app.
122
+ * @internal
123
+ */
124
+ export declare function getFirestore(databaseId: string): Firestore;
125
+ /**
126
+ * Returns the existing {@link Firestore} instance that is associated with the
85
127
  * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
86
128
  * instance with default settings.
87
129
  *
88
- * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
130
+ * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
89
131
  * instance is associated with.
90
- * @returns The `Firestore` instance of the provided app.
132
+ * @param databaseId - The name of database.
133
+ * @returns The {@link Firestore} instance of the provided app.
134
+ * @internal
91
135
  */
92
- export declare function getFirestore(app?: FirebaseApp): Firestore;
136
+ export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
93
137
  export { EmulatorMockTokenOptions } from '@firebase/util';
94
138
  /**
95
139
  * Modify this instance to communicate with the Cloud Firestore emulator.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 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 {};
@@ -17,6 +17,7 @@
17
17
  import { FirebaseApp } from '@firebase/app';
18
18
  import { Firestore } from '../../../src';
19
19
  import { PrivateSettings } from '../../../src/lite-api/settings';
20
- export declare function newTestFirestore(projectId: string, nameOrApp?: string | FirebaseApp, settings?: PrivateSettings): Firestore;
20
+ export declare function newTestApp(projectId: string, appName?: string): FirebaseApp;
21
+ export declare function newTestFirestore(app: FirebaseApp, settings?: PrivateSettings, dbName?: string): Firestore;
21
22
  export * from '../../../src';
22
23
  export { PrivateSettings };
@@ -37,6 +37,7 @@ export declare function withTestDb(persistence: boolean, fn: (db: Firestore) =>
37
37
  export declare function withAlternateTestDb(persistence: boolean, fn: (db: Firestore) => Promise<void>): Promise<void>;
38
38
  export declare function withTestDbs(persistence: boolean, numDbs: number, fn: (db: Firestore[]) => Promise<void>): Promise<void>;
39
39
  export declare function withTestDbsSettings(persistence: boolean, projectId: string, settings: PrivateSettings, numDbs: number, fn: (db: Firestore[]) => Promise<void>): Promise<void>;
40
+ export declare function withNamedTestDbsOrSkipUnlessUsingEmulator(persistence: boolean, dbNames: string[], fn: (db: Firestore[]) => Promise<void>): Promise<void>;
40
41
  export declare function withTestDoc(persistence: boolean, fn: (doc: DocumentReference, db: Firestore) => Promise<void>): Promise<void>;
41
42
  export declare function withTestDocAndSettings(persistence: boolean, settings: PrivateSettings, fn: (doc: DocumentReference) => Promise<void>): Promise<void>;
42
43
  export declare function withTestDocAndInitialData(persistence: boolean, initialData: DocumentData | null, fn: (doc: DocumentReference, db: Firestore) => Promise<void>): Promise<void>;
package/dist/private.d.ts CHANGED
@@ -1392,7 +1392,7 @@ export declare class Firestore extends Firestore_2 {
1392
1392
  readonly _persistenceKey: string;
1393
1393
  _firestoreClient: FirestoreClient | undefined;
1394
1394
  /** @hideconstructor */
1395
- constructor(databaseIdOrApp: _DatabaseId | FirebaseApp, authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>);
1395
+ constructor(authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>, databaseId: _DatabaseId, app?: FirebaseApp);
1396
1396
  _terminate(): Promise<void>;
1397
1397
  }
1398
1398
 
@@ -1404,18 +1404,18 @@ export declare class Firestore extends Firestore_2 {
1404
1404
  declare class Firestore_2 implements FirestoreService {
1405
1405
  _authCredentials: CredentialsProvider<User>;
1406
1406
  _appCheckCredentials: CredentialsProvider<string>;
1407
+ readonly _databaseId: _DatabaseId;
1408
+ readonly _app?: FirebaseApp | undefined;
1407
1409
  /**
1408
1410
  * Whether it's a Firestore or Firestore Lite instance.
1409
1411
  */
1410
1412
  type: 'firestore-lite' | 'firestore';
1411
- readonly _databaseId: _DatabaseId;
1412
1413
  readonly _persistenceKey: string;
1413
1414
  private _settings;
1414
1415
  private _settingsFrozen;
1415
1416
  private _terminateTask?;
1416
- _app?: FirebaseApp;
1417
1417
  /** @hideconstructor */
1418
- constructor(databaseIdOrApp: _DatabaseId | FirebaseApp, _authCredentials: CredentialsProvider<User>, _appCheckCredentials: CredentialsProvider<string>);
1418
+ constructor(_authCredentials: CredentialsProvider<User>, _appCheckCredentials: CredentialsProvider<string>, _databaseId: _DatabaseId, _app?: FirebaseApp | undefined);
1419
1419
  /**
1420
1420
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
1421
1421
  * instance.
@@ -2209,7 +2209,16 @@ export declare function getDocsFromCache<T>(query: Query<T>): Promise<QuerySnaps
2209
2209
  export declare function getDocsFromServer<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
2210
2210
 
2211
2211
  /**
2212
- * Returns the existing {@link Firestore} instance that is associated with the
2212
+ * Returns the existing default {@link Firestore} instance that is associated with the
2213
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
2214
+ * instance with default settings.
2215
+ *
2216
+ * @returns The {@link Firestore} instance of the provided app.
2217
+ */
2218
+ export declare function getFirestore(): Firestore;
2219
+
2220
+ /**
2221
+ * Returns the existing default {@link Firestore} instance that is associated with the
2213
2222
  * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
2214
2223
  * instance with default settings.
2215
2224
  *
@@ -2217,7 +2226,11 @@ export declare function getDocsFromServer<T>(query: Query<T>): Promise<QuerySnap
2217
2226
  * instance is associated with.
2218
2227
  * @returns The {@link Firestore} instance of the provided app.
2219
2228
  */
2220
- export declare function getFirestore(app?: FirebaseApp): Firestore;
2229
+ export declare function getFirestore(app: FirebaseApp): Firestore;
2230
+
2231
+ /* Excluded declaration from this release type: getFirestore */
2232
+
2233
+ /* Excluded declaration from this release type: getFirestore */
2221
2234
 
2222
2235
  /**
2223
2236
  * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link
@@ -2439,9 +2452,10 @@ declare const enum IndexType {
2439
2452
  * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will
2440
2453
  * be associated.
2441
2454
  * @param settings - A settings object to configure the {@link Firestore} instance.
2455
+ * @param databaseId - The name of database.
2442
2456
  * @returns A newly initialized {@link Firestore} instance.
2443
2457
  */
2444
- export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
2458
+ export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
2445
2459
 
2446
2460
  /* Excluded from this release type: _isBase64Available */
2447
2461
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/firestore",
3
- "version": "3.4.14-canary.fcd4b8ac3",
3
+ "version": "3.4.15",
4
4
  "engines": {
5
5
  "node": ">=10.10.0"
6
6
  },
@@ -30,6 +30,7 @@
30
30
  "test:all:ci": "run-p test:browser test:lite:browser test:travis",
31
31
  "test:all": "run-p test:browser test:lite:browser test:travis test:minified",
32
32
  "test:browser": "karma start --single-run",
33
+ "test:browser:unit": "karma start --single-run --unit",
33
34
  "test:browser:debug": "karma start --browsers=Chrome --auto-watch",
34
35
  "test:node": "node ./scripts/run-tests.js --main=test/register.ts --emulator 'test/{,!(browser|lite)/**/}*.test.ts'",
35
36
  "test:node:prod": "node ./scripts/run-tests.js --main=test/register.ts 'test/{,!(browser|lite)/**/}*.test.ts'",
@@ -79,22 +80,22 @@
79
80
  "lite/package.json"
80
81
  ],
81
82
  "dependencies": {
82
- "@firebase/component": "0.5.17-canary.fcd4b8ac3",
83
- "@firebase/logger": "0.3.3-canary.fcd4b8ac3",
84
- "@firebase/util": "1.6.3-canary.fcd4b8ac3",
85
- "@firebase/webchannel-wrapper": "0.6.2-canary.fcd4b8ac3",
83
+ "@firebase/component": "0.5.17",
84
+ "@firebase/logger": "0.3.3",
85
+ "@firebase/util": "1.6.3",
86
+ "@firebase/webchannel-wrapper": "0.6.2",
86
87
  "@grpc/grpc-js": "^1.3.2",
87
88
  "@grpc/proto-loader": "^0.6.13",
88
89
  "node-fetch": "2.6.7",
89
90
  "tslib": "^2.1.0"
90
91
  },
91
92
  "peerDependencies": {
92
- "@firebase/app": "0.7.30-canary.fcd4b8ac3"
93
+ "@firebase/app": "0.x"
93
94
  },
94
95
  "devDependencies": {
95
- "@firebase/app": "0.7.30-canary.fcd4b8ac3",
96
- "@firebase/app-compat": "0.1.31-canary.fcd4b8ac3",
97
- "@firebase/auth": "0.20.5-canary.fcd4b8ac3",
96
+ "@firebase/app": "0.7.32",
97
+ "@firebase/app-compat": "0.1.33",
98
+ "@firebase/auth": "0.20.6",
98
99
  "@rollup/plugin-alias": "3.1.9",
99
100
  "@rollup/plugin-json": "4.1.0",
100
101
  "@types/eslint": "7.29.0",