@firebase/database
Advanced tools
Comparing version 0.1.10-0 to 0.1.10-canary.0226ed2
@@ -22,3 +22,3 @@ import { FirebaseNamespace } from '@firebase/app-types'; | ||
}; | ||
export declare function initStandalone(app: any, url: any): { | ||
export declare function initStandalone(app: any, url: any, version?: string): { | ||
instance: Database; | ||
@@ -25,0 +25,0 @@ namespace: { |
@@ -19,2 +19,3 @@ "use strict"; | ||
var app_1 = require("@firebase/app"); | ||
var util_1 = require("@firebase/util"); | ||
var Database_1 = require("./src/api/Database"); | ||
@@ -26,8 +27,7 @@ exports.Database = Database_1.Database; | ||
exports.Reference = Reference_1.Reference; | ||
var util_1 = require("./src/core/util/util"); | ||
exports.enableLogging = util_1.enableLogging; | ||
var util_2 = require("./src/core/util/util"); | ||
exports.enableLogging = util_2.enableLogging; | ||
var RepoManager_1 = require("./src/core/RepoManager"); | ||
var INTERNAL = require("./src/api/internal"); | ||
var TEST_ACCESS = require("./src/api/test_access"); | ||
var util_2 = require("@firebase/util"); | ||
require("./src/nodePatches"); | ||
@@ -43,3 +43,11 @@ /** | ||
exports.ServerValue = ServerValue; | ||
function initStandalone(app, url) { | ||
function initStandalone(app, url, version) { | ||
/** | ||
* This should allow the firebase-admin package to provide a custom version | ||
* to the backend | ||
*/ | ||
util_1.CONSTANTS.NODE_ADMIN = true; | ||
if (version) { | ||
app_1.default.SDK_VERSION = version; | ||
} | ||
return { | ||
@@ -51,3 +59,3 @@ instance: RepoManager_1.RepoManager.getInstance().databaseFromApp(app, url), | ||
Database: Database_1.Database, | ||
enableLogging: util_1.enableLogging, | ||
enableLogging: util_2.enableLogging, | ||
INTERNAL: INTERNAL, | ||
@@ -68,3 +76,3 @@ ServerValue: ServerValue, | ||
Database: Database_1.Database, | ||
enableLogging: util_1.enableLogging, | ||
enableLogging: util_2.enableLogging, | ||
INTERNAL: INTERNAL, | ||
@@ -74,3 +82,3 @@ ServerValue: ServerValue, | ||
}, null, true); | ||
if (util_2.isNodeSdk()) { | ||
if (util_1.isNodeSdk()) { | ||
module.exports = Object.assign({}, namespace, { initStandalone: initStandalone }); | ||
@@ -77,0 +85,0 @@ } |
@@ -18,2 +18,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var util_1 = require("../core/util/util"); | ||
@@ -122,9 +123,13 @@ var parser_1 = require("../core/util/libs/parser"); | ||
DatabaseInternals.prototype.delete = function () { | ||
this.database.checkDeleted_('delete'); | ||
RepoManager_1.RepoManager.getInstance().deleteRepo(this.database.repo_); | ||
this.database.repo_ = null; | ||
this.database.root_ = null; | ||
this.database.INTERNAL = null; | ||
this.database = null; | ||
return Promise.resolve(); | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
this.database.checkDeleted_('delete'); | ||
RepoManager_1.RepoManager.getInstance().deleteRepo(this.database.repo_); | ||
this.database.repo_ = null; | ||
this.database.root_ = null; | ||
this.database.INTERNAL = null; | ||
this.database = null; | ||
return [2 /*return*/]; | ||
}); | ||
}); | ||
}; | ||
@@ -131,0 +136,0 @@ return DatabaseInternals; |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var onDisconnect_1 = require("./onDisconnect"); | ||
@@ -42,3 +33,3 @@ var TransactionResult_1 = require("./TransactionResult"); | ||
var Reference = /** @class */ (function (_super) { | ||
__extends(Reference, _super); | ||
tslib_1.__extends(Reference, _super); | ||
/** | ||
@@ -45,0 +36,0 @@ * Call options: |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var app_1 = require("@firebase/app"); | ||
@@ -57,3 +48,3 @@ var util_1 = require("@firebase/util"); | ||
var PersistentConnection = /** @class */ (function (_super) { | ||
__extends(PersistentConnection, _super); | ||
tslib_1.__extends(PersistentConnection, _super); | ||
/** | ||
@@ -60,0 +51,0 @@ * @implements {ServerActions} |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var util_1 = require("@firebase/util"); | ||
@@ -41,3 +32,3 @@ var util_2 = require("./util/util"); | ||
var ReadonlyRestClient = /** @class */ (function (_super) { | ||
__extends(ReadonlyRestClient, _super); | ||
tslib_1.__extends(ReadonlyRestClient, _super); | ||
/** | ||
@@ -44,0 +35,0 @@ * @param {!RepoInfo} repoInfo_ Data about the namespace we are connecting to |
@@ -46,3 +46,3 @@ "use strict"; | ||
RepoInfo.prototype.needsQueryParam = function () { | ||
return this.host !== this.internalHost; | ||
return this.host !== this.internalHost || this.isCustomHost(); | ||
}; | ||
@@ -49,0 +49,0 @@ RepoInfo.prototype.isCacheableHost = function () { |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var util_1 = require("@firebase/util"); | ||
@@ -455,3 +446,3 @@ var util_2 = require("../util/util"); | ||
var MaxNode = /** @class */ (function (_super) { | ||
__extends(MaxNode, _super); | ||
tslib_1.__extends(MaxNode, _super); | ||
function MaxNode() { | ||
@@ -458,0 +449,0 @@ return _super.call(this, new SortedMap_1.SortedMap(comparators_1.NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap_1.IndexMap.Default) || this; |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var Index_1 = require("./Index"); | ||
@@ -35,3 +26,3 @@ var Node_1 = require("../Node"); | ||
var KeyIndex = /** @class */ (function (_super) { | ||
__extends(KeyIndex, _super); | ||
tslib_1.__extends(KeyIndex, _super); | ||
function KeyIndex() { | ||
@@ -38,0 +29,0 @@ return _super !== null && _super.apply(this, arguments) || this; |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var util_1 = require("@firebase/util"); | ||
@@ -41,3 +32,3 @@ var util_2 = require("../../util/util"); | ||
var PathIndex = /** @class */ (function (_super) { | ||
__extends(PathIndex, _super); | ||
tslib_1.__extends(PathIndex, _super); | ||
function PathIndex(indexPath_) { | ||
@@ -44,0 +35,0 @@ var _this = _super.call(this) || this; |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var Index_1 = require("./Index"); | ||
@@ -49,3 +40,3 @@ var util_1 = require("../../util/util"); | ||
var PriorityIndex = /** @class */ (function (_super) { | ||
__extends(PriorityIndex, _super); | ||
tslib_1.__extends(PriorityIndex, _super); | ||
function PriorityIndex() { | ||
@@ -52,0 +43,0 @@ return _super !== null && _super.apply(this, arguments) || this; |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var Index_1 = require("./Index"); | ||
@@ -39,3 +30,3 @@ var Node_1 = require("../Node"); | ||
var ValueIndex = /** @class */ (function (_super) { | ||
__extends(ValueIndex, _super); | ||
tslib_1.__extends(ValueIndex, _super); | ||
function ValueIndex() { | ||
@@ -42,0 +33,0 @@ return _super !== null && _super.apply(this, arguments) || this; |
@@ -41,2 +41,26 @@ "use strict"; | ||
/** | ||
* @param {!string} queryString | ||
* @return {!{[key:string]:string}} key value hash | ||
*/ | ||
function decodeQuery(queryString) { | ||
var results = {}; | ||
if (queryString.startsWith('?')) { | ||
queryString = queryString.substring(1); | ||
} | ||
for (var _i = 0, _a = queryString.split('&'); _i < _a.length; _i++) { | ||
var segment = _a[_i]; | ||
if (segment.length === 0) { | ||
continue; | ||
} | ||
var kv = segment.split('='); | ||
if (kv.length === 2) { | ||
results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); | ||
} | ||
else { | ||
util_1.warn("Invalid query segment '" + segment + "' in query '" + queryString + "'"); | ||
} | ||
} | ||
return results; | ||
} | ||
/** | ||
* | ||
@@ -85,3 +109,3 @@ * @param {!string} dataURL | ||
} | ||
// Parse host and path. | ||
// Parse host, path, and query string. | ||
var slashInd = dataURL.indexOf('/'); | ||
@@ -91,4 +115,12 @@ if (slashInd === -1) { | ||
} | ||
host = dataURL.substring(0, slashInd); | ||
pathString = decodePath(dataURL.substring(slashInd)); | ||
var questionMarkInd = dataURL.indexOf('?'); | ||
if (questionMarkInd === -1) { | ||
questionMarkInd = dataURL.length; | ||
} | ||
host = dataURL.substring(0, Math.min(slashInd, questionMarkInd)); | ||
if (slashInd < questionMarkInd) { | ||
// For pathString, questionMarkInd will always come after slashInd | ||
pathString = decodePath(dataURL.substring(slashInd, questionMarkInd)); | ||
} | ||
var queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd))); | ||
// If we have a port, use scheme for determining if it's secure. | ||
@@ -115,2 +147,6 @@ colonInd = host.indexOf(':'); | ||
} | ||
// Support `ns` query param if subdomain not already set | ||
if (subdomain === '' && 'ns' in queryParams) { | ||
subdomain = queryParams['ns']; | ||
} | ||
} | ||
@@ -117,0 +153,0 @@ return { |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var util_1 = require("@firebase/util"); | ||
@@ -42,3 +33,3 @@ var EventEmitter_1 = require("./EventEmitter"); | ||
var OnlineMonitor = /** @class */ (function (_super) { | ||
__extends(OnlineMonitor, _super); | ||
tslib_1.__extends(OnlineMonitor, _super); | ||
function OnlineMonitor() { | ||
@@ -45,0 +36,0 @@ var _this = _super.call(this, ['online']) || this; |
@@ -17,13 +17,4 @@ "use strict"; | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var EventEmitter_1 = require("./EventEmitter"); | ||
@@ -35,3 +26,3 @@ var util_1 = require("@firebase/util"); | ||
var VisibilityMonitor = /** @class */ (function (_super) { | ||
__extends(VisibilityMonitor, _super); | ||
tslib_1.__extends(VisibilityMonitor, _super); | ||
function VisibilityMonitor() { | ||
@@ -38,0 +29,0 @@ var _this = _super.call(this, ['visible']) || this; |
@@ -22,3 +22,3 @@ import { FirebaseNamespace } from '@firebase/app-types'; | ||
}; | ||
export declare function initStandalone(app: any, url: any): { | ||
export declare function initStandalone(app: any, url: any, version?: string): { | ||
instance: Database; | ||
@@ -25,0 +25,0 @@ namespace: { |
@@ -17,2 +17,3 @@ /** | ||
import firebase from '@firebase/app'; | ||
import { CONSTANTS, isNodeSdk } from '@firebase/util'; | ||
import { Database } from './src/api/Database'; | ||
@@ -25,3 +26,2 @@ import { Query } from './src/api/Query'; | ||
import * as TEST_ACCESS from './src/api/test_access'; | ||
import { isNodeSdk } from '@firebase/util'; | ||
import './src/nodePatches'; | ||
@@ -36,3 +36,11 @@ /** | ||
var ServerValue = Database.ServerValue; | ||
export function initStandalone(app, url) { | ||
export function initStandalone(app, url, version) { | ||
/** | ||
* This should allow the firebase-admin package to provide a custom version | ||
* to the backend | ||
*/ | ||
CONSTANTS.NODE_ADMIN = true; | ||
if (version) { | ||
firebase.SDK_VERSION = version; | ||
} | ||
return { | ||
@@ -39,0 +47,0 @@ instance: RepoManager.getInstance().databaseFromApp(app, url), |
@@ -16,2 +16,3 @@ /** | ||
*/ | ||
import * as tslib_1 from "tslib"; | ||
import { fatal } from '../core/util/util'; | ||
@@ -120,9 +121,13 @@ import { parseRepoInfo } from '../core/util/libs/parser'; | ||
DatabaseInternals.prototype.delete = function () { | ||
this.database.checkDeleted_('delete'); | ||
RepoManager.getInstance().deleteRepo(this.database.repo_); | ||
this.database.repo_ = null; | ||
this.database.root_ = null; | ||
this.database.INTERNAL = null; | ||
this.database = null; | ||
return Promise.resolve(); | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
this.database.checkDeleted_('delete'); | ||
RepoManager.getInstance().deleteRepo(this.database.repo_); | ||
this.database.repo_ = null; | ||
this.database.root_ = null; | ||
this.database.INTERNAL = null; | ||
this.database = null; | ||
return [2 /*return*/]; | ||
}); | ||
}); | ||
}; | ||
@@ -129,0 +134,0 @@ return DatabaseInternals; |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { OnDisconnect } from './onDisconnect'; | ||
@@ -40,3 +31,3 @@ import { TransactionResult } from './TransactionResult'; | ||
var Reference = /** @class */ (function (_super) { | ||
__extends(Reference, _super); | ||
tslib_1.__extends(Reference, _super); | ||
/** | ||
@@ -43,0 +34,0 @@ * Call options: |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import firebase from '@firebase/app'; | ||
@@ -55,3 +46,3 @@ import { forEach, contains, isEmpty, getCount, safeGet } from '@firebase/util'; | ||
var PersistentConnection = /** @class */ (function (_super) { | ||
__extends(PersistentConnection, _super); | ||
tslib_1.__extends(PersistentConnection, _super); | ||
/** | ||
@@ -58,0 +49,0 @@ * @implements {ServerActions} |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { assert } from '@firebase/util'; | ||
@@ -39,3 +30,3 @@ import { logWrapper, warn } from './util/util'; | ||
var ReadonlyRestClient = /** @class */ (function (_super) { | ||
__extends(ReadonlyRestClient, _super); | ||
tslib_1.__extends(ReadonlyRestClient, _super); | ||
/** | ||
@@ -42,0 +33,0 @@ * @param {!RepoInfo} repoInfo_ Data about the namespace we are connecting to |
@@ -44,3 +44,3 @@ /** | ||
RepoInfo.prototype.needsQueryParam = function () { | ||
return this.host !== this.internalHost; | ||
return this.host !== this.internalHost || this.isCustomHost(); | ||
}; | ||
@@ -47,0 +47,0 @@ RepoInfo.prototype.isCacheableHost = function () { |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { assert } from '@firebase/util'; | ||
@@ -453,3 +444,3 @@ import { sha1, MAX_NAME, MIN_NAME } from '../util/util'; | ||
var MaxNode = /** @class */ (function (_super) { | ||
__extends(MaxNode, _super); | ||
tslib_1.__extends(MaxNode, _super); | ||
function MaxNode() { | ||
@@ -456,0 +447,0 @@ return _super.call(this, new SortedMap(NAME_COMPARATOR), ChildrenNode.EMPTY_NODE, IndexMap.Default) || this; |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { Index } from './Index'; | ||
@@ -33,3 +24,3 @@ import { NamedNode } from '../Node'; | ||
var KeyIndex = /** @class */ (function (_super) { | ||
__extends(KeyIndex, _super); | ||
tslib_1.__extends(KeyIndex, _super); | ||
function KeyIndex() { | ||
@@ -36,0 +27,0 @@ return _super !== null && _super.apply(this, arguments) || this; |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { assert } from '@firebase/util'; | ||
@@ -39,3 +30,3 @@ import { nameCompare, MAX_NAME } from '../../util/util'; | ||
var PathIndex = /** @class */ (function (_super) { | ||
__extends(PathIndex, _super); | ||
tslib_1.__extends(PathIndex, _super); | ||
function PathIndex(indexPath_) { | ||
@@ -42,0 +33,0 @@ var _this = _super.call(this) || this; |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { Index } from './Index'; | ||
@@ -45,3 +36,3 @@ import { nameCompare, MAX_NAME } from '../../util/util'; | ||
var PriorityIndex = /** @class */ (function (_super) { | ||
__extends(PriorityIndex, _super); | ||
tslib_1.__extends(PriorityIndex, _super); | ||
function PriorityIndex() { | ||
@@ -48,0 +39,0 @@ return _super !== null && _super.apply(this, arguments) || this; |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { Index } from './Index'; | ||
@@ -37,3 +28,3 @@ import { NamedNode } from '../Node'; | ||
var ValueIndex = /** @class */ (function (_super) { | ||
__extends(ValueIndex, _super); | ||
tslib_1.__extends(ValueIndex, _super); | ||
function ValueIndex() { | ||
@@ -40,0 +31,0 @@ return _super !== null && _super.apply(this, arguments) || this; |
@@ -18,3 +18,3 @@ /** | ||
import { RepoInfo } from '../../RepoInfo'; | ||
import { warnIfPageIsSecure, fatal } from '../util'; | ||
import { warnIfPageIsSecure, warn, fatal } from '../util'; | ||
/** | ||
@@ -40,2 +40,26 @@ * @param {!string} pathString | ||
/** | ||
* @param {!string} queryString | ||
* @return {!{[key:string]:string}} key value hash | ||
*/ | ||
function decodeQuery(queryString) { | ||
var results = {}; | ||
if (queryString.startsWith('?')) { | ||
queryString = queryString.substring(1); | ||
} | ||
for (var _i = 0, _a = queryString.split('&'); _i < _a.length; _i++) { | ||
var segment = _a[_i]; | ||
if (segment.length === 0) { | ||
continue; | ||
} | ||
var kv = segment.split('='); | ||
if (kv.length === 2) { | ||
results[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]); | ||
} | ||
else { | ||
warn("Invalid query segment '" + segment + "' in query '" + queryString + "'"); | ||
} | ||
} | ||
return results; | ||
} | ||
/** | ||
* | ||
@@ -84,3 +108,3 @@ * @param {!string} dataURL | ||
} | ||
// Parse host and path. | ||
// Parse host, path, and query string. | ||
var slashInd = dataURL.indexOf('/'); | ||
@@ -90,4 +114,12 @@ if (slashInd === -1) { | ||
} | ||
host = dataURL.substring(0, slashInd); | ||
pathString = decodePath(dataURL.substring(slashInd)); | ||
var questionMarkInd = dataURL.indexOf('?'); | ||
if (questionMarkInd === -1) { | ||
questionMarkInd = dataURL.length; | ||
} | ||
host = dataURL.substring(0, Math.min(slashInd, questionMarkInd)); | ||
if (slashInd < questionMarkInd) { | ||
// For pathString, questionMarkInd will always come after slashInd | ||
pathString = decodePath(dataURL.substring(slashInd, questionMarkInd)); | ||
} | ||
var queryParams = decodeQuery(dataURL.substring(Math.min(dataURL.length, questionMarkInd))); | ||
// If we have a port, use scheme for determining if it's secure. | ||
@@ -114,2 +146,6 @@ colonInd = host.indexOf(':'); | ||
} | ||
// Support `ns` query param if subdomain not already set | ||
if (subdomain === '' && 'ns' in queryParams) { | ||
subdomain = queryParams['ns']; | ||
} | ||
} | ||
@@ -116,0 +152,0 @@ return { |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { assert } from '@firebase/util'; | ||
@@ -40,3 +31,3 @@ import { EventEmitter } from './EventEmitter'; | ||
var OnlineMonitor = /** @class */ (function (_super) { | ||
__extends(OnlineMonitor, _super); | ||
tslib_1.__extends(OnlineMonitor, _super); | ||
function OnlineMonitor() { | ||
@@ -43,0 +34,0 @@ var _this = _super.call(this, ['online']) || this; |
@@ -16,12 +16,3 @@ /** | ||
*/ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
import * as tslib_1 from "tslib"; | ||
import { EventEmitter } from './EventEmitter'; | ||
@@ -33,3 +24,3 @@ import { assert } from '@firebase/util'; | ||
var VisibilityMonitor = /** @class */ (function (_super) { | ||
__extends(VisibilityMonitor, _super); | ||
tslib_1.__extends(VisibilityMonitor, _super); | ||
function VisibilityMonitor() { | ||
@@ -36,0 +27,0 @@ var _this = _super.call(this, ['visible']) || this; |
{ | ||
"name": "@firebase/database", | ||
"version": "0.1.10-0", | ||
"version": "0.1.10-canary.0226ed2", | ||
"description": "", | ||
@@ -18,9 +18,10 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", | ||
"peerDependencies": { | ||
"@firebase/app": "^0.1.0", | ||
"@firebase/app-types": "^0.1.0" | ||
"@firebase/app": "0.1.9-canary.0226ed2", | ||
"@firebase/app-types": "0.1.1-canary.0226ed2" | ||
}, | ||
"dependencies": { | ||
"@firebase/database-types": "0.1.1", | ||
"@firebase/util": "0.1.9-0", | ||
"faye-websocket": "0.11.1" | ||
"@firebase/database-types": "0.1.1-canary.0226ed2", | ||
"@firebase/util": "0.1.9-canary.0226ed2", | ||
"faye-websocket": "0.11.1", | ||
"tslib": "^1.9.0" | ||
}, | ||
@@ -27,0 +28,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3775795
6
45678
+ Addedtslib@^1.9.0
+ Added@firebase/app@0.1.9-canary.0226ed2(transitive)
+ Added@firebase/app-types@0.1.1-canary.0226ed2(transitive)
+ Added@firebase/database-types@0.1.1-canary.0226ed2(transitive)
+ Added@firebase/util@0.1.9-canary.0226ed2(transitive)
- Removed@firebase/app@0.1.10(transitive)
- Removed@firebase/app-types@0.1.2(transitive)
- Removed@firebase/database-types@0.1.1(transitive)
- Removed@firebase/util@0.1.100.1.9-0(transitive)