@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
@@ -1560,7 +1560,7 @@ export declare class Firestore extends Firestore_2 {
1560
1560
  readonly _persistenceKey: string;
1561
1561
  _firestoreClient: FirestoreClient | undefined;
1562
1562
  /** @hideconstructor */
1563
- constructor(databaseIdOrApp: _DatabaseId | FirebaseApp, authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>);
1563
+ constructor(authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>, databaseId: _DatabaseId, app?: FirebaseApp);
1564
1564
  _terminate(): Promise<void>;
1565
1565
  }
1566
1566
 
@@ -1572,18 +1572,18 @@ export declare class Firestore extends Firestore_2 {
1572
1572
  declare class Firestore_2 implements FirestoreService {
1573
1573
  _authCredentials: CredentialsProvider<User>;
1574
1574
  _appCheckCredentials: CredentialsProvider<string>;
1575
+ readonly _databaseId: _DatabaseId;
1576
+ readonly _app?: FirebaseApp | undefined;
1575
1577
  /**
1576
1578
  * Whether it's a Firestore or Firestore Lite instance.
1577
1579
  */
1578
1580
  type: 'firestore-lite' | 'firestore';
1579
- readonly _databaseId: _DatabaseId;
1580
1581
  readonly _persistenceKey: string;
1581
1582
  private _settings;
1582
1583
  private _settingsFrozen;
1583
1584
  private _terminateTask?;
1584
- _app?: FirebaseApp;
1585
1585
  /** @hideconstructor */
1586
- constructor(databaseIdOrApp: _DatabaseId | FirebaseApp, _authCredentials: CredentialsProvider<User>, _appCheckCredentials: CredentialsProvider<string>);
1586
+ constructor(_authCredentials: CredentialsProvider<User>, _appCheckCredentials: CredentialsProvider<string>, _databaseId: _DatabaseId, _app?: FirebaseApp | undefined);
1587
1587
  /**
1588
1588
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
1589
1589
  * instance.
@@ -2376,6 +2376,37 @@ export declare function getDocsFromCache<T>(query: Query<T>): Promise<QuerySnaps
2376
2376
  */
2377
2377
  export declare function getDocsFromServer<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
2378
2378
 
2379
+ /**
2380
+ * Returns the existing default {@link Firestore} instance that is associated with the
2381
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
2382
+ * instance with default settings.
2383
+ *
2384
+ * @returns The {@link Firestore} instance of the provided app.
2385
+ */
2386
+ export declare function getFirestore(): Firestore;
2387
+
2388
+ /**
2389
+ * Returns the existing default {@link Firestore} instance that is associated with the
2390
+ * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
2391
+ * instance with default settings.
2392
+ *
2393
+ * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
2394
+ * instance is associated with.
2395
+ * @returns The {@link Firestore} instance of the provided app.
2396
+ */
2397
+ export declare function getFirestore(app: FirebaseApp): Firestore;
2398
+
2399
+ /**
2400
+ * Returns the existing {@link Firestore} instance that is associated with the
2401
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
2402
+ * instance with default settings.
2403
+ *
2404
+ * @param databaseId - The name of database.
2405
+ * @returns The {@link Firestore} instance of the provided app.
2406
+ * @internal
2407
+ */
2408
+ export declare function getFirestore(databaseId: string): Firestore;
2409
+
2379
2410
  /**
2380
2411
  * Returns the existing {@link Firestore} instance that is associated with the
2381
2412
  * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
@@ -2383,9 +2414,11 @@ export declare function getDocsFromServer<T>(query: Query<T>): Promise<QuerySnap
2383
2414
  *
2384
2415
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
2385
2416
  * instance is associated with.
2417
+ * @param databaseId - The name of database.
2386
2418
  * @returns The {@link Firestore} instance of the provided app.
2419
+ * @internal
2387
2420
  */
2388
- export declare function getFirestore(app?: FirebaseApp): Firestore;
2421
+ export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
2389
2422
 
2390
2423
  /**
2391
2424
  * Returns a special value that can be used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link
@@ -2650,9 +2683,10 @@ declare const enum IndexType {
2650
2683
  * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will
2651
2684
  * be associated.
2652
2685
  * @param settings - A settings object to configure the {@link Firestore} instance.
2686
+ * @param databaseId - The name of database.
2653
2687
  * @returns A newly initialized {@link Firestore} instance.
2654
2688
  */
2655
- export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
2689
+ export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
2656
2690
 
2657
2691
  /**
2658
2692
  * True if and only if the Base64 conversion functions are available.
@@ -50,7 +50,7 @@ export declare class Firestore extends LiteFirestore {
50
50
  readonly _persistenceKey: string;
51
51
  _firestoreClient: FirestoreClient | undefined;
52
52
  /** @hideconstructor */
53
- constructor(databaseIdOrApp: DatabaseId | FirebaseApp, authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>);
53
+ constructor(authCredentialsProvider: CredentialsProvider<User>, appCheckCredentialsProvider: CredentialsProvider<string>, databaseId: DatabaseId, app?: FirebaseApp);
54
54
  _terminate(): Promise<void>;
55
55
  }
56
56
  /**
@@ -62,9 +62,38 @@ export declare class Firestore extends LiteFirestore {
62
62
  * @param app - The {@link @firebase/app#FirebaseApp} with which the {@link Firestore} instance will
63
63
  * be associated.
64
64
  * @param settings - A settings object to configure the {@link Firestore} instance.
65
+ * @param databaseId - The name of database.
65
66
  * @returns A newly initialized {@link Firestore} instance.
66
67
  */
67
- export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore;
68
+ export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
69
+ /**
70
+ * Returns the existing default {@link Firestore} instance that is associated with the
71
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
72
+ * instance with default settings.
73
+ *
74
+ * @returns The {@link Firestore} instance of the provided app.
75
+ */
76
+ export declare function getFirestore(): Firestore;
77
+ /**
78
+ * Returns the existing default {@link Firestore} instance that is associated with the
79
+ * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
80
+ * instance with default settings.
81
+ *
82
+ * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
83
+ * instance is associated with.
84
+ * @returns The {@link Firestore} instance of the provided app.
85
+ */
86
+ export declare function getFirestore(app: FirebaseApp): Firestore;
87
+ /**
88
+ * Returns the existing {@link Firestore} instance that is associated with the
89
+ * default {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
90
+ * instance with default settings.
91
+ *
92
+ * @param databaseId - The name of database.
93
+ * @returns The {@link Firestore} instance of the provided app.
94
+ * @internal
95
+ */
96
+ export declare function getFirestore(databaseId: string): Firestore;
68
97
  /**
69
98
  * Returns the existing {@link Firestore} instance that is associated with the
70
99
  * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
@@ -72,9 +101,11 @@ export declare function initializeFirestore(app: FirebaseApp, settings: Firestor
72
101
  *
73
102
  * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned {@link Firestore}
74
103
  * instance is associated with.
104
+ * @param databaseId - The name of database.
75
105
  * @returns The {@link Firestore} instance of the provided app.
106
+ * @internal
76
107
  */
77
- export declare function getFirestore(app?: FirebaseApp): Firestore;
108
+ export declare function getFirestore(app: FirebaseApp, databaseId: string): Firestore;
78
109
  /**
79
110
  * @internal
80
111
  */
@@ -1,3 +1,4 @@
1
+ import { FirebaseApp } from '@firebase/app';
1
2
  /**
2
3
  * @license
3
4
  * Copyright 2017 Google LLC
@@ -42,6 +43,8 @@ export declare class DatabaseInfo {
42
43
  */
43
44
  constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, useFetchStreams: boolean);
44
45
  }
46
+ /** The default database name for a project. */
47
+ export declare const DEFAULT_DATABASE_NAME = "(default)";
45
48
  /**
46
49
  * Represents the database ID a Firestore client is associated with.
47
50
  * @internal
@@ -54,3 +57,4 @@ export declare class DatabaseId {
54
57
  get isDefaultDatabase(): boolean;
55
58
  isEqual(other: {}): boolean;
56
59
  }
60
+ export declare function databaseIdFromApp(app: FirebaseApp, database?: string): DatabaseId;
@@ -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>;
@@ -63,7 +63,7 @@ l.MOCK_USER = new l("mock-user");
63
63
  * See the License for the specific language governing permissions and
64
64
  * limitations under the License.
65
65
  */
66
- let f = "9.9.2-canary.fcd4b8ac3";
66
+ let f = "9.9.4";
67
67
 
68
68
  /**
69
69
  * @license
@@ -470,22 +470,6 @@ class H {
470
470
  }
471
471
  }
472
472
 
473
- /**
474
- * @license
475
- * Copyright 2017 Google LLC
476
- *
477
- * Licensed under the Apache License, Version 2.0 (the "License");
478
- * you may not use this file except in compliance with the License.
479
- * You may obtain a copy of the License at
480
- *
481
- * http://www.apache.org/licenses/LICENSE-2.0
482
- *
483
- * Unless required by applicable law or agreed to in writing, software
484
- * distributed under the License is distributed on an "AS IS" BASIS,
485
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
486
- * See the License for the specific language governing permissions and
487
- * limitations under the License.
488
- */
489
473
  /**
490
474
  * Path represents an ordered sequence of string segments.
491
475
  */
@@ -3795,28 +3779,14 @@ class cn {
3795
3779
  * Do not call this constructor directly. Instead, use {@link getFirestore}.
3796
3780
  */ class an {
3797
3781
  /** @hideconstructor */
3798
- constructor(t, e, n) {
3799
- this._authCredentials = e, this._appCheckCredentials = n,
3782
+ constructor(t, e, n, r) {
3783
+ this._authCredentials = t, this._appCheckCredentials = e, this._databaseId = n,
3784
+ this._app = r,
3800
3785
  /**
3801
3786
  * Whether it's a Firestore or Firestore Lite instance.
3802
3787
  */
3803
3788
  this.type = "firestore-lite", this._persistenceKey = "(lite)", this._settings = new cn({}),
3804
- this._settingsFrozen = !1, t instanceof H ? this._databaseId = t : (this._app = t,
3805
- this._databaseId = function(t) {
3806
- if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new L(A, '"projectId" not provided in firebase.initializeApp.');
3807
- return new H(t.options.projectId);
3808
- }
3809
- /**
3810
- * Initializes a new instance of Cloud Firestore with the provided settings.
3811
- * Can only be called before any other functions, including
3812
- * {@link getFirestore}. If the custom settings are empty, this function is
3813
- * equivalent to calling {@link getFirestore}.
3814
- *
3815
- * @param app - The {@link @firebase/app#FirebaseApp} with which the `Firestore` instance will
3816
- * be associated.
3817
- * @param settings - A settings object to configure the `Firestore` instance.
3818
- * @returns A newly initialized `Firestore` instance.
3819
- */ (t));
3789
+ this._settingsFrozen = !1;
3820
3790
  }
3821
3791
  /**
3822
3792
  * The {@link @firebase/app#FirebaseApp} associated with this `Firestore` service
@@ -3878,24 +3848,21 @@ class cn {
3878
3848
  }
3879
3849
  }
3880
3850
 
3881
- function hn(t, e) {
3882
- const n = _getProvider(t, "firestore/lite");
3883
- if (n.isInitialized()) throw new L(x, "Firestore can only be initialized once per app.");
3884
- return n.initialize({
3885
- options: e
3851
+ function hn(t, e, n) {
3852
+ n || (n = "(default)");
3853
+ const r = _getProvider(t, "firestore/lite");
3854
+ if (r.isInitialized(n)) throw new L(x, "Firestore can only be initialized once per app.");
3855
+ return r.initialize({
3856
+ options: e,
3857
+ instanceIdentifier: n
3886
3858
  });
3887
3859
  }
3888
3860
 
3889
- /**
3890
- * Returns the existing `Firestore` instance that is associated with the
3891
- * provided {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new
3892
- * instance with default settings.
3893
- *
3894
- * @param app - The {@link @firebase/app#FirebaseApp} instance that the returned `Firestore`
3895
- * instance is associated with.
3896
- * @returns The `Firestore` instance of the provided app.
3897
- */ function ln(e = getApp()) {
3898
- return _getProvider(e, "firestore/lite").getImmediate();
3861
+ function ln(e, n) {
3862
+ const r = "object" == typeof e ? e : getApp(), s = "string" == typeof e ? e : n || "(default)";
3863
+ return _getProvider(r, "firestore/lite").getImmediate({
3864
+ identifier: s
3865
+ });
3899
3866
  }
3900
3867
 
3901
3868
  /**
@@ -5882,7 +5849,7 @@ function kr(t, e) {
5882
5849
  let e;
5883
5850
  if (t.isFoundDocument()) e = t.version; else {
5884
5851
  if (!t.isNoDocument()) throw g();
5885
- // For deleted docs, we must use baseVersion 0 when we overwrite them.
5852
+ // Represent a deleted doc using SnapshotVersion.min().
5886
5853
  e = vt.min();
5887
5854
  }
5888
5855
  const n = this.readVersions.get(t.key.toString());
@@ -5897,7 +5864,7 @@ function kr(t, e) {
5897
5864
  * as a precondition, or no precondition if it was not read.
5898
5865
  */ precondition(t) {
5899
5866
  const e = this.readVersions.get(t.toString());
5900
- return !this.writtenDocs.has(t.toString()) && e ? Re.updateTime(e) : Re.none();
5867
+ return !this.writtenDocs.has(t.toString()) && e ? e.isEqual(vt.min()) ? Re.exists(!1) : Re.updateTime(e) : Re.none();
5901
5868
  }
5902
5869
  /**
5903
5870
  * Returns the precondition for a document if the operation is an update.
@@ -6490,12 +6457,31 @@ class Gr {
6490
6457
  * @packageDocumentation
6491
6458
  */ !function(t) {
6492
6459
  f = t;
6493
- }(`${SDK_VERSION}_lite`), _registerComponent(new Component("firestore/lite", ((t, {options: e}) => {
6494
- const n = t.getProvider("app").getImmediate(), r = new an(n, new z(t.getProvider("auth-internal")), new Q(t.getProvider("app-check-internal")));
6495
- return e && r._setSettings(e), r;
6496
- }), "PUBLIC")),
6460
+ }(`${SDK_VERSION}_lite`), _registerComponent(new Component("firestore/lite", ((t, {instanceIdentifier: e, options: n}) => {
6461
+ const r = t.getProvider("app").getImmediate(), s = new an(new z(t.getProvider("auth-internal")), new Q(t.getProvider("app-check-internal")), function(t, e) {
6462
+ if (!Object.prototype.hasOwnProperty.apply(t.options, [ "projectId" ])) throw new L(A, '"projectId" not provided in firebase.initializeApp.');
6463
+ return new H(t.options.projectId, e);
6464
+ }
6465
+ /**
6466
+ * @license
6467
+ * Copyright 2017 Google LLC
6468
+ *
6469
+ * Licensed under the Apache License, Version 2.0 (the "License");
6470
+ * you may not use this file except in compliance with the License.
6471
+ * You may obtain a copy of the License at
6472
+ *
6473
+ * http://www.apache.org/licenses/LICENSE-2.0
6474
+ *
6475
+ * Unless required by applicable law or agreed to in writing, software
6476
+ * distributed under the License is distributed on an "AS IS" BASIS,
6477
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6478
+ * See the License for the specific language governing permissions and
6479
+ * limitations under the License.
6480
+ */ (r, e), r);
6481
+ return n && s._setSettings(n), s;
6482
+ }), "PUBLIC").setMultipleInstances(!0)),
6497
6483
  // RUNTIME_ENV and BUILD_TARGET are replaced by real values during the compilation
6498
- registerVersion("firestore-lite", "3.4.14-canary.fcd4b8ac3", ""), registerVersion("firestore-lite", "3.4.14-canary.fcd4b8ac3", "esm2017");
6484
+ registerVersion("firestore-lite", "3.4.15", ""), registerVersion("firestore-lite", "3.4.15", "esm2017");
6499
6485
 
6500
6486
  export { In as Bytes, pn as CollectionReference, wn as DocumentReference, Zn as DocumentSnapshot, En as FieldPath, An as FieldValue, an as Firestore, L as FirestoreError, Rn as GeoPoint, mn as Query, sr as QueryConstraint, tr as QueryDocumentSnapshot, er as QuerySnapshot, gt as Timestamp, Gr as Transaction, Or as WriteBatch, Dr as addDoc, Sr as arrayRemove, Fr as arrayUnion, yn as collection, _n as collectionGroup, fn as connectFirestoreEmulator, Nr as deleteDoc, $r as deleteField, gn as doc, Tn as documentId, _r as endAt, yr as endBefore, Ar as getDoc, Rr as getDocs, ln as getFirestore, qr as increment, hn as initializeFirestore, lr as limit, fr as limitToLast, ar as orderBy, ir as query, bn as queryEqual, vn as refEqual, Wr as runTransaction, xr as serverTimestamp, Pr as setDoc, w as setLogLevel, nr as snapshotEqual, mr as startAfter, wr as startAt, dn as terminate, Vr as updateDoc, ur as where, Cr as writeBatch };
6501
6487
  //# sourceMappingURL=index.browser.esm2017.js.map