@firebase/database 0.13.2-canary.69e2ee064 → 0.13.2-canary.6a8be1337
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.
- package/dist/index.esm2017.js +2 -18
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +5 -22
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +5 -22
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.standalone.js +4 -21
- package/dist/index.standalone.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +2 -18
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +7 -8
package/dist/index.standalone.js
CHANGED
|
@@ -1037,7 +1037,7 @@ var WebSocketConnection = /** @class */ (function () {
|
|
|
1037
1037
|
if (util.isNodeSdk()) {
|
|
1038
1038
|
var device = this.nodeAdmin ? 'AdminNode' : 'Node';
|
|
1039
1039
|
// UA Format: Firebase/<wire_protocol>/<sdk_version>/<platform>/<device>
|
|
1040
|
-
|
|
1040
|
+
options = {
|
|
1041
1041
|
headers: {
|
|
1042
1042
|
'User-Agent': "Firebase/" + PROTOCOL_VERSION + "/" + SDK_VERSION + "/" + process.platform + "/" + device,
|
|
1043
1043
|
'X-Firebase-GMPID': this.applicationId || ''
|
|
@@ -1049,10 +1049,10 @@ var WebSocketConnection = /** @class */ (function () {
|
|
|
1049
1049
|
// Note that this header is just used to bypass appcheck, and the token should still be sent
|
|
1050
1050
|
// through the websocket connection once it is established.
|
|
1051
1051
|
if (this.authToken) {
|
|
1052
|
-
|
|
1052
|
+
options.headers['Authorization'] = "Bearer " + this.authToken;
|
|
1053
1053
|
}
|
|
1054
1054
|
if (this.appCheckToken) {
|
|
1055
|
-
|
|
1055
|
+
options.headers['X-Firebase-AppCheck'] = this.appCheckToken;
|
|
1056
1056
|
}
|
|
1057
1057
|
// Plumb appropriate http_proxy environment variable into faye-websocket if it exists.
|
|
1058
1058
|
var env = process['env'];
|
|
@@ -1060,7 +1060,7 @@ var WebSocketConnection = /** @class */ (function () {
|
|
|
1060
1060
|
? env['HTTPS_PROXY'] || env['https_proxy']
|
|
1061
1061
|
: env['HTTP_PROXY'] || env['http_proxy'];
|
|
1062
1062
|
if (proxy) {
|
|
1063
|
-
|
|
1063
|
+
options['proxy'] = { origin: proxy };
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
1066
|
this.mySock = new WebSocketImpl(this.connURL, [], options);
|
|
@@ -3303,7 +3303,6 @@ var VisibilityMonitor = /** @class */ (function (_super) {
|
|
|
3303
3303
|
*/
|
|
3304
3304
|
var RECONNECT_MIN_DELAY = 1000;
|
|
3305
3305
|
var RECONNECT_MAX_DELAY_DEFAULT = 60 * 5 * 1000; // 5 minutes in milliseconds (Case: 1858)
|
|
3306
|
-
var GET_CONNECT_TIMEOUT = 3 * 1000;
|
|
3307
3306
|
var RECONNECT_MAX_DELAY_FOR_ADMINS = 30 * 1000; // 30 seconds for admin clients (likely to be a backend server)
|
|
3308
3307
|
var RECONNECT_DELAY_MULTIPLIER = 1.3;
|
|
3309
3308
|
var RECONNECT_DELAY_RESET_TIMEOUT = 30000; // Reset delay back to MIN_DELAY after being connected for 30sec.
|
|
@@ -3382,7 +3381,6 @@ var PersistentConnection = /** @class */ (function (_super) {
|
|
|
3382
3381
|
}
|
|
3383
3382
|
};
|
|
3384
3383
|
PersistentConnection.prototype.get = function (query) {
|
|
3385
|
-
var _this = this;
|
|
3386
3384
|
this.initConnection_();
|
|
3387
3385
|
var deferred = new util.Deferred();
|
|
3388
3386
|
var request = {
|
|
@@ -3405,21 +3403,6 @@ var PersistentConnection = /** @class */ (function (_super) {
|
|
|
3405
3403
|
this.outstandingGets_.push(outstandingGet);
|
|
3406
3404
|
this.outstandingGetCount_++;
|
|
3407
3405
|
var index = this.outstandingGets_.length - 1;
|
|
3408
|
-
if (!this.connected_) {
|
|
3409
|
-
setTimeout(function () {
|
|
3410
|
-
var get = _this.outstandingGets_[index];
|
|
3411
|
-
if (get === undefined || outstandingGet !== get) {
|
|
3412
|
-
return;
|
|
3413
|
-
}
|
|
3414
|
-
delete _this.outstandingGets_[index];
|
|
3415
|
-
_this.outstandingGetCount_--;
|
|
3416
|
-
if (_this.outstandingGetCount_ === 0) {
|
|
3417
|
-
_this.outstandingGets_ = [];
|
|
3418
|
-
}
|
|
3419
|
-
_this.log_('get ' + index + ' timed out on connection');
|
|
3420
|
-
deferred.reject(new Error('Client is offline.'));
|
|
3421
|
-
}, GET_CONNECT_TIMEOUT);
|
|
3422
|
-
}
|
|
3423
3406
|
if (this.connected_) {
|
|
3424
3407
|
this.sendGet_(index);
|
|
3425
3408
|
}
|