@firebase/database 0.12.8 → 0.13.0

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.
@@ -53,6 +53,14 @@ export declare class Database implements _FirebaseService {
53
53
  _delete(): Promise<void>;
54
54
  _checkNotDeleted(apiName: string): void;
55
55
  }
56
+ /**
57
+ * Force the use of websockets instead of longPolling.
58
+ */
59
+ export declare function forceWebSockets(): void;
60
+ /**
61
+ * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL.
62
+ */
63
+ export declare function forceLongPolling(): void;
56
64
  /**
57
65
  * Returns the instance of the Realtime Database SDK that is associated
58
66
  * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export { Database, EmulatorMockTokenOptions, enableLogging, goOffline, goOnline, connectDatabaseEmulator } from './api/Database';
17
+ export { Database, EmulatorMockTokenOptions, enableLogging, goOffline, goOnline, forceWebSockets, forceLongPolling, connectDatabaseEmulator } from './api/Database';
18
18
  export { Query, DatabaseReference, ListenOptions, Unsubscribe, ThenableReference } from './api/Reference';
19
19
  export { OnDisconnect } from './api/OnDisconnect';
20
20
  export { DataSnapshot, EventType, QueryConstraint, QueryConstraintType, endAt, endBefore, equalTo, get, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, set, setPriority, setWithPriority, startAfter, startAt, update, child } from './api/Reference_impl';
@@ -77,12 +77,12 @@ export declare class BrowserPollConnection implements Transport {
77
77
  * Call this when a handshake has completed successfully and we want to consider the connection established
78
78
  */
79
79
  start(): void;
80
- private static forceAllow_;
80
+ static forceAllow_: boolean;
81
81
  /**
82
82
  * Forces long polling to be considered as a potential transport
83
83
  */
84
84
  static forceAllow(): void;
85
- private static forceDisallow_;
85
+ static forceDisallow_: boolean;
86
86
  /**
87
87
  * Forces longpolling to not be considered as a potential transport
88
88
  */
@@ -27,7 +27,13 @@ import { WebSocketConnection } from './WebSocketConnection';
27
27
  */
28
28
  export declare class TransportManager {
29
29
  private transports_;
30
+ static globalTransportInitialized_: boolean;
30
31
  static get ALL_TRANSPORTS(): (typeof BrowserPollConnection | typeof WebSocketConnection)[];
32
+ /**
33
+ * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after
34
+ * TransportManager has already set up transports_
35
+ */
36
+ static get IS_TRANSPORT_INITIALIZED(): boolean;
31
37
  /**
32
38
  * @param repoInfo - Metadata around the namespace we're connecting to
33
39
  */
@@ -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 {};
@@ -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 {};
package/dist/private.d.ts CHANGED
@@ -553,6 +553,16 @@ export declare type EventType = 'value' | 'child_added' | 'child_changed' | 'chi
553
553
 
554
554
  /* Excluded from this release type: _FirebaseService */
555
555
 
556
+ /**
557
+ * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL.
558
+ */
559
+ export declare function forceLongPolling(): void;
560
+
561
+ /**
562
+ * Force the use of websockets instead of longPolling.
563
+ */
564
+ export declare function forceWebSockets(): void;
565
+
556
566
  /**
557
567
  * Gets the most up-to-date result for this query.
558
568
  *
package/dist/public.d.ts CHANGED
@@ -287,6 +287,14 @@ export declare function equalTo(value: number | string | boolean | null, key?: s
287
287
  */
288
288
  export declare type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved' | 'child_removed';
289
289
  /* Excluded from this release type: _FirebaseService */
290
+ /**
291
+ * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL.
292
+ */
293
+ export declare function forceLongPolling(): void;
294
+ /**
295
+ * Force the use of websockets instead of longPolling.
296
+ */
297
+ export declare function forceWebSockets(): void;
290
298
  /**
291
299
  * Gets the most up-to-date result for this query.
292
300
  *
@@ -53,6 +53,14 @@ export declare class Database implements _FirebaseService {
53
53
  _delete(): Promise<void>;
54
54
  _checkNotDeleted(apiName: string): void;
55
55
  }
56
+ /**
57
+ * Force the use of websockets instead of longPolling.
58
+ */
59
+ export declare function forceWebSockets(): void;
60
+ /**
61
+ * Force the use of longPolling instead of websockets. This will be ignored if websocket protocol is used in databaseURL.
62
+ */
63
+ export declare function forceLongPolling(): void;
56
64
  /**
57
65
  * Returns the instance of the Realtime Database SDK that is associated
58
66
  * with the provided {@link @firebase/app#FirebaseApp}. Initializes a new instance with
@@ -14,7 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export { Database, EmulatorMockTokenOptions, enableLogging, goOffline, goOnline, connectDatabaseEmulator } from './api/Database';
17
+ export { Database, EmulatorMockTokenOptions, enableLogging, goOffline, goOnline, forceWebSockets, forceLongPolling, connectDatabaseEmulator } from './api/Database';
18
18
  export { Query, DatabaseReference, ListenOptions, Unsubscribe, ThenableReference } from './api/Reference';
19
19
  export { OnDisconnect } from './api/OnDisconnect';
20
20
  export { DataSnapshot, EventType, QueryConstraint, QueryConstraintType, endAt, endBefore, equalTo, get, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, set, setPriority, setWithPriority, startAfter, startAt, update, child } from './api/Reference_impl';
@@ -77,12 +77,12 @@ export declare class BrowserPollConnection implements Transport {
77
77
  * Call this when a handshake has completed successfully and we want to consider the connection established
78
78
  */
79
79
  start(): void;
80
- private static forceAllow_;
80
+ static forceAllow_: boolean;
81
81
  /**
82
82
  * Forces long polling to be considered as a potential transport
83
83
  */
84
84
  static forceAllow(): void;
85
- private static forceDisallow_;
85
+ static forceDisallow_: boolean;
86
86
  /**
87
87
  * Forces longpolling to not be considered as a potential transport
88
88
  */
@@ -27,7 +27,13 @@ import { WebSocketConnection } from './WebSocketConnection';
27
27
  */
28
28
  export declare class TransportManager {
29
29
  private transports_;
30
+ static globalTransportInitialized_: boolean;
30
31
  static get ALL_TRANSPORTS(): (typeof BrowserPollConnection | typeof WebSocketConnection)[];
32
+ /**
33
+ * Returns whether transport has been selected to ensure WebSocketConnection or BrowserPollConnection are not called after
34
+ * TransportManager has already set up transports_
35
+ */
36
+ static get IS_TRANSPORT_INITIALIZED(): boolean;
31
37
  /**
32
38
  * @param repoInfo - Metadata around the namespace we're connecting to
33
39
  */
@@ -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 {};
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/database",
3
- "version": "0.12.8",
3
+ "version": "0.13.0",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.node.cjs.js",
@@ -45,14 +45,14 @@
45
45
  "peerDependencies": {},
46
46
  "dependencies": {
47
47
  "@firebase/logger": "0.3.2",
48
- "@firebase/util": "1.5.2",
49
- "@firebase/component": "0.5.13",
48
+ "@firebase/util": "1.6.0",
49
+ "@firebase/component": "0.5.14",
50
50
  "@firebase/auth-interop-types": "0.1.6",
51
51
  "faye-websocket": "0.11.4",
52
52
  "tslib": "^2.1.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@firebase/app": "0.7.21",
55
+ "@firebase/app": "0.7.23",
56
56
  "rollup": "2.57.0",
57
57
  "rollup-plugin-typescript2": "0.30.0",
58
58
  "typescript": "4.2.2"