@firebase/firestore 3.4.14-canary.a80e29cbb → 3.4.14-canary.fcd4b8ac3

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 (36) hide show
  1. package/dist/firestore/src/api/credentials.d.ts +13 -3
  2. package/dist/firestore/src/api/index_configuration.d.ts +5 -0
  3. package/dist/index.d.ts +1 -91
  4. package/dist/index.esm2017.js +1649 -1639
  5. package/dist/index.esm2017.js.map +1 -1
  6. package/dist/index.esm5.js +2295 -2279
  7. package/dist/index.esm5.js.map +1 -1
  8. package/dist/index.node.cjs.js +36 -18
  9. package/dist/index.node.cjs.js.map +1 -1
  10. package/dist/index.node.mjs +36 -18
  11. package/dist/index.node.mjs.map +1 -1
  12. package/dist/index.rn.js +1649 -1639
  13. package/dist/index.rn.js.map +1 -1
  14. package/dist/internal.d.ts +8 -0
  15. package/dist/lite/firestore/src/api/credentials.d.ts +13 -3
  16. package/dist/lite/firestore/src/api/index_configuration.d.ts +5 -0
  17. package/dist/lite/index.browser.esm2017.js +232 -222
  18. package/dist/lite/index.browser.esm2017.js.map +1 -1
  19. package/dist/lite/index.browser.esm5.js +485 -469
  20. package/dist/lite/index.browser.esm5.js.map +1 -1
  21. package/dist/lite/index.node.cjs.js +36 -18
  22. package/dist/lite/index.node.cjs.js.map +1 -1
  23. package/dist/lite/index.node.mjs +36 -18
  24. package/dist/lite/index.node.mjs.map +1 -1
  25. package/dist/lite/index.rn.esm2017.js +232 -222
  26. package/dist/lite/index.rn.esm2017.js.map +1 -1
  27. package/dist/lite/internal.d.ts +3 -0
  28. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +23 -23
  29. package/dist/lite/packages/firestore/src/api/credentials.d.ts +13 -3
  30. package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +5 -0
  31. package/dist/lite/private.d.ts +3 -0
  32. package/dist/packages/firestore/dist/index.esm2017.d.ts +50 -50
  33. package/dist/packages/firestore/src/api/credentials.d.ts +13 -3
  34. package/dist/packages/firestore/src/api/index_configuration.d.ts +5 -0
  35. package/dist/private.d.ts +7 -92
  36. package/package.json +9 -9
@@ -138,6 +138,8 @@ declare interface AsyncQueue {
138
138
  verifyOperationInProgress(): void;
139
139
  }
140
140
 
141
+ declare type AuthTokenFactory = () => string;
142
+
141
143
  /**
142
144
  * Path represents an ordered sequence of string segments.
143
145
  */
@@ -2233,6 +2235,7 @@ declare interface FirstPartyCredentialsSettings {
2233
2235
  ['client']: unknown;
2234
2236
  ['sessionIndex']: string;
2235
2237
  ['iamToken']: string | null;
2238
+ ['authTokenFactory']: AuthTokenFactory | null;
2236
2239
  }
2237
2240
 
2238
2241
  /**
@@ -2407,6 +2410,7 @@ export declare function increment(n: number): FieldValue;
2407
2410
 
2408
2411
  /**
2409
2412
  * The SDK definition of a Firestore index.
2413
+ * @beta
2410
2414
  */
2411
2415
  export declare interface Index {
2412
2416
  /** The ID of the collection to index. */
@@ -2421,6 +2425,7 @@ export declare interface Index {
2421
2425
  *
2422
2426
  * See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format}
2423
2427
  * for a description of the format of the index definition.
2428
+ * @beta
2424
2429
  */
2425
2430
  export declare interface IndexConfiguration {
2426
2431
  /** A list of all Firestore indexes. */
@@ -2430,6 +2435,7 @@ export declare interface IndexConfiguration {
2430
2435
 
2431
2436
  /**
2432
2437
  * A single field element in an index configuration.
2438
+ * @beta
2433
2439
  */
2434
2440
  export declare interface IndexField {
2435
2441
  /** The field path to index. */
@@ -4737,6 +4743,7 @@ export declare function setDoc<T>(reference: DocumentReference<T>, data: Partial
4737
4743
  * @throws FirestoreError if the JSON format is invalid.
4738
4744
  * @returns A `Promise` that resolves once all indices are successfully
4739
4745
  * configured.
4746
+ * @beta
4740
4747
  */
4741
4748
  export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;
4742
4749
 
@@ -4764,6 +4771,7 @@ export declare function setIndexConfiguration(firestore: Firestore, configuratio
4764
4771
  * @throws FirestoreError if the JSON format is invalid.
4765
4772
  * @returns A `Promise` that resolves once all indices are successfully
4766
4773
  * configured.
4774
+ * @beta
4767
4775
  */
4768
4776
  export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
4769
4777
 
@@ -19,11 +19,13 @@ import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
19
19
  import { Provider } from '@firebase/component';
20
20
  import { User } from '../auth/user';
21
21
  import { AsyncQueue } from '../util/async_queue';
22
+ export declare type AuthTokenFactory = () => string;
22
23
  export interface FirstPartyCredentialsSettings {
23
24
  ['type']: 'gapi';
24
25
  ['client']: unknown;
25
26
  ['sessionIndex']: string;
26
27
  ['iamToken']: string | null;
28
+ ['authTokenFactory']: AuthTokenFactory | null;
27
29
  }
28
30
  export interface ProviderCredentialsSettings {
29
31
  ['type']: 'provider';
@@ -146,16 +148,24 @@ interface Gapi {
146
148
  };
147
149
  }
148
150
  export declare class FirstPartyToken implements Token {
151
+ private readonly gapi;
152
+ private readonly sessionIndex;
153
+ private readonly iamToken;
154
+ private readonly authTokenFactory;
149
155
  type: TokenType;
150
156
  user: User;
151
- headers: Map<any, any>;
152
- constructor(gapi: Gapi, sessionIndex: string, iamToken: string | null);
157
+ private _headers;
158
+ constructor(gapi: Gapi | null, sessionIndex: string, iamToken: string | null, authTokenFactory: AuthTokenFactory | null);
159
+ /** Gets an authorization token, using a provided factory function, or falling back to First Party GAPI. */
160
+ private getAuthToken;
161
+ get headers(): Map<string, string>;
153
162
  }
154
163
  export declare class FirstPartyAuthCredentialsProvider implements CredentialsProvider<User> {
155
164
  private gapi;
156
165
  private sessionIndex;
157
166
  private iamToken;
158
- constructor(gapi: Gapi, sessionIndex: string, iamToken: string | null);
167
+ private authTokenFactory;
168
+ constructor(gapi: Gapi | null, sessionIndex: string, iamToken: string | null, authTokenFactory: AuthTokenFactory | null);
159
169
  getToken(): Promise<Token | null>;
160
170
  start(asyncQueue: AsyncQueue, changeListener: CredentialChangeListener<User>): void;
161
171
  shutdown(): void;
@@ -19,6 +19,7 @@ import { Firestore } from './database';
19
19
  export { connectFirestoreEmulator, EmulatorMockTokenOptions } from '../lite-api/database';
20
20
  /**
21
21
  * A single field element in an index configuration.
22
+ * @beta
22
23
  */
23
24
  export interface IndexField {
24
25
  /** The field path to index. */
@@ -41,6 +42,7 @@ export interface IndexField {
41
42
  }
42
43
  /**
43
44
  * The SDK definition of a Firestore index.
45
+ * @beta
44
46
  */
45
47
  export interface Index {
46
48
  /** The ID of the collection to index. */
@@ -54,6 +56,7 @@ export interface Index {
54
56
  *
55
57
  * See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format}
56
58
  * for a description of the format of the index definition.
59
+ * @beta
57
60
  */
58
61
  export interface IndexConfiguration {
59
62
  /** A list of all Firestore indexes. */
@@ -80,6 +83,7 @@ export interface IndexConfiguration {
80
83
  * @throws FirestoreError if the JSON format is invalid.
81
84
  * @returns A `Promise` that resolves once all indices are successfully
82
85
  * configured.
86
+ * @beta
83
87
  */
84
88
  export declare function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise<void>;
85
89
  /**
@@ -106,6 +110,7 @@ export declare function setIndexConfiguration(firestore: Firestore, configuratio
106
110
  * @throws FirestoreError if the JSON format is invalid.
107
111
  * @returns A `Promise` that resolves once all indices are successfully
108
112
  * configured.
113
+ * @beta
109
114
  */
110
115
  export declare function setIndexConfiguration(firestore: Firestore, json: string): Promise<void>;
111
116
  export declare function parseIndexes(jsonOrConfiguration: string | IndexConfiguration): FieldIndex[];