@firebase/firestore 3.11.0-canary.5a2ceb07b → 3.11.0-canary.61586afcc

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 (60) hide show
  1. package/dist/firestore/src/api/long_polling_options.d.ts +55 -0
  2. package/dist/firestore/src/api/settings.d.ts +11 -0
  3. package/dist/firestore/src/api.d.ts +1 -0
  4. package/dist/firestore/src/core/database_info.d.ts +4 -1
  5. package/dist/firestore/src/lite-api/settings.d.ts +3 -0
  6. package/dist/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
  7. package/dist/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
  8. package/dist/index.cjs.js +1335 -1294
  9. package/dist/index.cjs.js.map +1 -1
  10. package/dist/index.d.ts +56 -0
  11. package/dist/index.esm2017.js +1251 -1210
  12. package/dist/index.esm2017.js.map +1 -1
  13. package/dist/index.esm5.js +1101 -1081
  14. package/dist/index.esm5.js.map +1 -1
  15. package/dist/index.node.cjs.js +70 -5
  16. package/dist/index.node.cjs.js.map +1 -1
  17. package/dist/index.node.mjs +70 -5
  18. package/dist/index.node.mjs.map +1 -1
  19. package/dist/index.rn.js +867 -826
  20. package/dist/index.rn.js.map +1 -1
  21. package/dist/internal.d.ts +62 -1
  22. package/dist/lite/firestore/src/api/long_polling_options.d.ts +55 -0
  23. package/dist/lite/firestore/src/api/settings.d.ts +11 -0
  24. package/dist/lite/firestore/src/api.d.ts +1 -0
  25. package/dist/lite/firestore/src/core/database_info.d.ts +4 -1
  26. package/dist/lite/firestore/src/lite-api/settings.d.ts +3 -0
  27. package/dist/lite/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
  28. package/dist/lite/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
  29. package/dist/lite/index.browser.esm2017.js +755 -715
  30. package/dist/lite/index.browser.esm2017.js.map +1 -1
  31. package/dist/lite/index.browser.esm5.js +764 -745
  32. package/dist/lite/index.browser.esm5.js.map +1 -1
  33. package/dist/lite/index.cjs.js +755 -715
  34. package/dist/lite/index.cjs.js.map +1 -1
  35. package/dist/lite/index.node.cjs.js +70 -5
  36. package/dist/lite/index.node.cjs.js.map +1 -1
  37. package/dist/lite/index.node.mjs +70 -5
  38. package/dist/lite/index.node.mjs.map +1 -1
  39. package/dist/lite/index.rn.esm2017.js +762 -722
  40. package/dist/lite/index.rn.esm2017.js.map +1 -1
  41. package/dist/lite/internal.d.ts +52 -1
  42. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +127 -144
  43. package/dist/lite/packages/firestore/src/api/long_polling_options.d.ts +55 -0
  44. package/dist/lite/packages/firestore/src/api/settings.d.ts +11 -0
  45. package/dist/lite/packages/firestore/src/api.d.ts +1 -0
  46. package/dist/lite/packages/firestore/src/core/database_info.d.ts +4 -1
  47. package/dist/lite/packages/firestore/src/lite-api/settings.d.ts +3 -0
  48. package/dist/lite/packages/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
  49. package/dist/lite/packages/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
  50. package/dist/lite/private.d.ts +52 -1
  51. package/dist/packages/firestore/dist/index.esm2017.d.ts +301 -318
  52. package/dist/packages/firestore/src/api/long_polling_options.d.ts +55 -0
  53. package/dist/packages/firestore/src/api/settings.d.ts +11 -0
  54. package/dist/packages/firestore/src/api.d.ts +1 -0
  55. package/dist/packages/firestore/src/core/database_info.d.ts +4 -1
  56. package/dist/packages/firestore/src/lite-api/settings.d.ts +3 -0
  57. package/dist/packages/firestore/src/platform/browser/webchannel_connection.d.ts +1 -0
  58. package/dist/packages/firestore/test/unit/api/long_polling_options.test.d.ts +17 -0
  59. package/dist/private.d.ts +62 -1
  60. package/package.json +9 -9
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 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
+ /**
18
+ * Options that configure the SDK’s underlying network transport (WebChannel)
19
+ * when long-polling is used.
20
+ *
21
+ * Note: This interface is "experimental" and is subject to change.
22
+ *
23
+ * See `FirestoreSettings.experimentalAutoDetectLongPolling`,
24
+ * `FirestoreSettings.experimentalForceLongPolling`, and
25
+ * `FirestoreSettings.experimentalLongPollingOptions`.
26
+ */
27
+ export interface ExperimentalLongPollingOptions {
28
+ /**
29
+ * The desired maximum timeout interval, in seconds, to complete a
30
+ * long-polling GET response. Valid values are between 5 and 30, inclusive.
31
+ * Floating point values are allowed and will be rounded to the nearest
32
+ * millisecond.
33
+ *
34
+ * By default, when long-polling is used the "hanging GET" request sent by
35
+ * the client times out after 30 seconds. To request a different timeout
36
+ * from the server, set this setting with the desired timeout.
37
+ *
38
+ * Changing the default timeout may be useful, for example, if the buffering
39
+ * proxy that necessitated enabling long-polling in the first place has a
40
+ * shorter timeout for hanging GET requests, in which case setting the
41
+ * long-polling timeout to a shorter value, such as 25 seconds, may fix
42
+ * prematurely-closed hanging GET requests.
43
+ * For example, see https://github.com/firebase/firebase-js-sdk/issues/6987.
44
+ */
45
+ timeoutSeconds?: number;
46
+ }
47
+ /**
48
+ * Compares two `ExperimentalLongPollingOptions` objects for equality.
49
+ */
50
+ export declare function longPollingOptionsEqual(options1: ExperimentalLongPollingOptions, options2: ExperimentalLongPollingOptions): boolean;
51
+ /**
52
+ * Creates and returns a new `ExperimentalLongPollingOptions` with the same
53
+ * option values as the given instance.
54
+ */
55
+ export declare function cloneLongPollingOptions(options: ExperimentalLongPollingOptions): ExperimentalLongPollingOptions;
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { FirestoreSettings as LiteSettings } from '../lite-api/settings';
18
18
  import { FirestoreLocalCache } from './cache_config';
19
+ import { ExperimentalLongPollingOptions } from './long_polling_options';
19
20
  export { DEFAULT_HOST } from '../lite-api/settings';
20
21
  /**
21
22
  * Settings that can be passed to `enableIndexedDbPersistence()` to configure
@@ -84,4 +85,14 @@ export interface FirestoreSettings extends LiteSettings {
84
85
  * cannot be combined with `experimentalForceLongPolling`.
85
86
  */
86
87
  experimentalAutoDetectLongPolling?: boolean;
88
+ /**
89
+ * Options that configure the SDK’s underlying network transport (WebChannel)
90
+ * when long-polling is used.
91
+ *
92
+ * These options are only used if `experimentalForceLongPolling` is true or if
93
+ * `experimentalAutoDetectLongPolling` is true and the auto-detection
94
+ * determined that long-polling was needed. Otherwise, these options have no
95
+ * effect.
96
+ */
97
+ experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
87
98
  }
@@ -21,6 +21,7 @@ export { documentId, FieldPath } from './api/field_path';
21
21
  export { clearIndexedDbPersistence, connectFirestoreEmulator, disableNetwork, EmulatorMockTokenOptions, enableIndexedDbPersistence, enableMultiTabIndexedDbPersistence, enableNetwork, ensureFirestoreConfigured, Firestore, getFirestore, initializeFirestore, loadBundle, namedQuery, terminate, waitForPendingWrites } from './api/database';
22
22
  export { LoadBundleTask, LoadBundleTaskProgress, TaskState } from './api/bundle';
23
23
  export { FirestoreSettings, PersistenceSettings } from './api/settings';
24
+ export { ExperimentalLongPollingOptions } from './api/long_polling_options';
24
25
  export { DocumentChange, DocumentChangeType, DocumentSnapshot, FirestoreDataConverter, QueryDocumentSnapshot, QuerySnapshot, snapshotEqual, SnapshotMetadata, SnapshotOptions } from './api/snapshot';
25
26
  export { collection, collectionGroup, CollectionReference, doc, DocumentData, DocumentReference, PartialWithFieldValue, Query, queryEqual, refEqual, SetOptions, UpdateData, WithFieldValue } from './api/reference';
26
27
  export { and, endAt, endBefore, limit, limitToLast, or, orderBy, OrderByDirection, query, QueryCompositeFilterConstraint, QueryConstraint, QueryConstraintType, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryFilterConstraint, QueryLimitConstraint, QueryNonFilterConstraint, QueryOrderByConstraint, QueryStartAtConstraint, startAfter, startAt, where, WhereFilterOp } from './api/filter';
@@ -1,4 +1,5 @@
1
1
  import { FirebaseApp } from '@firebase/app';
2
+ import { ExperimentalLongPollingOptions } from '../api/long_polling_options';
2
3
  /**
3
4
  * @license
4
5
  * Copyright 2017 Google LLC
@@ -23,6 +24,7 @@ export declare class DatabaseInfo {
23
24
  readonly ssl: boolean;
24
25
  readonly forceLongPolling: boolean;
25
26
  readonly autoDetectLongPolling: boolean;
27
+ readonly longPollingOptions: ExperimentalLongPollingOptions;
26
28
  readonly useFetchStreams: boolean;
27
29
  /**
28
30
  * Constructs a DatabaseInfo using the provided host, databaseId and
@@ -38,10 +40,11 @@ export declare class DatabaseInfo {
38
40
  * when using WebChannel as the network transport.
39
41
  * @param autoDetectLongPolling - Whether to use the detectBufferingProxy
40
42
  * option when using WebChannel as the network transport.
43
+ * @param longPollingOptions Options that configure long-polling.
41
44
  * @param useFetchStreams Whether to use the Fetch API instead of
42
45
  * XMLHTTPRequest
43
46
  */
44
- constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, useFetchStreams: boolean);
47
+ constructor(databaseId: DatabaseId, appId: string, persistenceKey: string, host: string, ssl: boolean, forceLongPolling: boolean, autoDetectLongPolling: boolean, longPollingOptions: ExperimentalLongPollingOptions, useFetchStreams: boolean);
45
48
  }
46
49
  /** The default database name for a project. */
47
50
  export declare const DEFAULT_DATABASE_NAME = "(default)";
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { FirestoreLocalCache } from '../api/cache_config';
18
18
  import { CredentialsSettings } from '../api/credentials';
19
+ import { ExperimentalLongPollingOptions } from '../api/long_polling_options';
19
20
  export declare const DEFAULT_HOST = "firestore.googleapis.com";
20
21
  export declare const DEFAULT_SSL = true;
21
22
  /**
@@ -41,6 +42,7 @@ export interface PrivateSettings extends FirestoreSettings {
41
42
  cacheSizeBytes?: number;
42
43
  experimentalForceLongPolling?: boolean;
43
44
  experimentalAutoDetectLongPolling?: boolean;
45
+ experimentalLongPollingOptions?: ExperimentalLongPollingOptions;
44
46
  useFetchStreams?: boolean;
45
47
  localCache?: FirestoreLocalCache;
46
48
  }
@@ -57,6 +59,7 @@ export declare class FirestoreSettingsImpl {
57
59
  readonly cacheSizeBytes: number;
58
60
  readonly experimentalForceLongPolling: boolean;
59
61
  readonly experimentalAutoDetectLongPolling: boolean;
62
+ readonly experimentalLongPollingOptions: ExperimentalLongPollingOptions;
60
63
  readonly ignoreUndefinedProperties: boolean;
61
64
  readonly useFetchStreams: boolean;
62
65
  readonly cache?: FirestoreLocalCache;
@@ -23,6 +23,7 @@ export declare class WebChannelConnection extends RestConnection {
23
23
  private readonly forceLongPolling;
24
24
  private readonly autoDetectLongPolling;
25
25
  private readonly useFetchStreams;
26
+ private readonly longPollingOptions;
26
27
  constructor(info: DatabaseInfo);
27
28
  protected performRPCRequest<Req, Resp>(rpcName: string, url: string, headers: StringMap, body: Req): Promise<Resp>;
28
29
  openStream<Req, Resp>(rpcName: string, authToken: Token | null, appCheckToken: Token | null): Stream<Req, Resp>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 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 {};