abstracted-firebase
Advanced tools
Comparing version 0.27.9 to 0.27.10
@@ -12,2 +12,12 @@ import { IDictionary } from "common-types"; | ||
readonly isMockDb: boolean; | ||
/** | ||
* **getPushKey** | ||
* | ||
* Get's a push-key from the server at a given path. This ensures that multiple | ||
* client's who are writing to the database will use the server's time rather than | ||
* their own local time. | ||
* | ||
* @param path the path in the database where the push-key will be pushed to | ||
*/ | ||
getPushKey(path: string): Promise<string>; | ||
readonly mock: Mock; | ||
@@ -14,0 +24,0 @@ readonly isConnected: boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// tslint:disable: member-ordering | ||
// tslint:disable:no-implicit-dependencies | ||
@@ -34,2 +35,15 @@ const common_types_1 = require("common-types"); | ||
} | ||
/** | ||
* **getPushKey** | ||
* | ||
* Get's a push-key from the server at a given path. This ensures that multiple | ||
* client's who are writing to the database will use the server's time rather than | ||
* their own local time. | ||
* | ||
* @param path the path in the database where the push-key will be pushed to | ||
*/ | ||
async getPushKey(path) { | ||
const key = await this.ref(path).push().key; | ||
return key; | ||
} | ||
get mock() { | ||
@@ -119,3 +133,5 @@ if (!this._mocking && !this._allowMocking) { | ||
catch (e) { | ||
e.name = e.code.includes("abstracted-firebase") ? "AbstractedFirebase" : e.code; | ||
e.name = e.code.includes("abstracted-firebase") | ||
? "AbstractedFirebase" | ||
: e.code; | ||
e.code = "abstracted-firebase/unWatch"; | ||
@@ -228,3 +244,4 @@ throw e; | ||
} | ||
if (e.message.indexOf("First argument includes undefined in property") !== -1) { | ||
if (e.message.indexOf("First argument includes undefined in property") !== | ||
-1) { | ||
e.name = "FirebaseUndefinedValueAssignment"; | ||
@@ -527,3 +544,5 @@ throw new UndefinedAssignment_1.UndefinedAssignment(e); | ||
} | ||
this._onConnected.forEach(listener => listener.ctx ? listener.cb.bind(listener.ctx)(this) : listener.cb.bind(this)()); | ||
this._onConnected.forEach(listener => listener.ctx | ||
? listener.cb.bind(listener.ctx)(this) | ||
: listener.cb.bind(this)()); | ||
} | ||
@@ -544,3 +563,4 @@ else { | ||
this._mockLoadingState = "loading"; | ||
const FireMock = await Promise.resolve().then(() => require(/* webpackChunkName: "firemock" */ "firemock")); | ||
const FireMock = await Promise.resolve().then(() => require( | ||
/* webpackChunkName: "firemock" */ "firemock")); | ||
this._mockLoadingState = "loaded"; | ||
@@ -547,0 +567,0 @@ this._mock = await FireMock.Mock.prepare(config); |
@@ -12,2 +12,12 @@ import { IDictionary } from "common-types"; | ||
readonly isMockDb: boolean; | ||
/** | ||
* **getPushKey** | ||
* | ||
* Get's a push-key from the server at a given path. This ensures that multiple | ||
* client's who are writing to the database will use the server's time rather than | ||
* their own local time. | ||
* | ||
* @param path the path in the database where the push-key will be pushed to | ||
*/ | ||
getPushKey(path: string): Promise<string>; | ||
readonly mock: Mock; | ||
@@ -14,0 +24,0 @@ readonly isConnected: boolean; |
@@ -0,1 +1,2 @@ | ||
// tslint:disable: member-ordering | ||
// tslint:disable:no-implicit-dependencies | ||
@@ -32,2 +33,15 @@ import { wait } from "common-types"; | ||
} | ||
/** | ||
* **getPushKey** | ||
* | ||
* Get's a push-key from the server at a given path. This ensures that multiple | ||
* client's who are writing to the database will use the server's time rather than | ||
* their own local time. | ||
* | ||
* @param path the path in the database where the push-key will be pushed to | ||
*/ | ||
async getPushKey(path) { | ||
const key = await this.ref(path).push().key; | ||
return key; | ||
} | ||
get mock() { | ||
@@ -117,3 +131,5 @@ if (!this._mocking && !this._allowMocking) { | ||
catch (e) { | ||
e.name = e.code.includes("abstracted-firebase") ? "AbstractedFirebase" : e.code; | ||
e.name = e.code.includes("abstracted-firebase") | ||
? "AbstractedFirebase" | ||
: e.code; | ||
e.code = "abstracted-firebase/unWatch"; | ||
@@ -226,3 +242,4 @@ throw e; | ||
} | ||
if (e.message.indexOf("First argument includes undefined in property") !== -1) { | ||
if (e.message.indexOf("First argument includes undefined in property") !== | ||
-1) { | ||
e.name = "FirebaseUndefinedValueAssignment"; | ||
@@ -525,3 +542,5 @@ throw new UndefinedAssignment(e); | ||
} | ||
this._onConnected.forEach(listener => listener.ctx ? listener.cb.bind(listener.ctx)(this) : listener.cb.bind(this)()); | ||
this._onConnected.forEach(listener => listener.ctx | ||
? listener.cb.bind(listener.ctx)(this) | ||
: listener.cb.bind(this)()); | ||
} | ||
@@ -542,3 +561,4 @@ else { | ||
this._mockLoadingState = "loading"; | ||
const FireMock = await import(/* webpackChunkName: "firemock" */ "firemock"); | ||
const FireMock = await import( | ||
/* webpackChunkName: "firemock" */ "firemock"); | ||
this._mockLoadingState = "loaded"; | ||
@@ -545,0 +565,0 @@ this._mock = await FireMock.Mock.prepare(config); |
@@ -12,2 +12,12 @@ import { IDictionary } from "common-types"; | ||
readonly isMockDb: boolean; | ||
/** | ||
* **getPushKey** | ||
* | ||
* Get's a push-key from the server at a given path. This ensures that multiple | ||
* client's who are writing to the database will use the server's time rather than | ||
* their own local time. | ||
* | ||
* @param path the path in the database where the push-key will be pushed to | ||
*/ | ||
getPushKey(path: string): Promise<string>; | ||
readonly mock: Mock; | ||
@@ -14,0 +24,0 @@ readonly isConnected: boolean; |
@@ -13,2 +13,3 @@ (function (factory) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// tslint:disable: member-ordering | ||
// tslint:disable:no-implicit-dependencies | ||
@@ -45,2 +46,15 @@ const common_types_1 = require("common-types"); | ||
} | ||
/** | ||
* **getPushKey** | ||
* | ||
* Get's a push-key from the server at a given path. This ensures that multiple | ||
* client's who are writing to the database will use the server's time rather than | ||
* their own local time. | ||
* | ||
* @param path the path in the database where the push-key will be pushed to | ||
*/ | ||
async getPushKey(path) { | ||
const key = await this.ref(path).push().key; | ||
return key; | ||
} | ||
get mock() { | ||
@@ -130,3 +144,5 @@ if (!this._mocking && !this._allowMocking) { | ||
catch (e) { | ||
e.name = e.code.includes("abstracted-firebase") ? "AbstractedFirebase" : e.code; | ||
e.name = e.code.includes("abstracted-firebase") | ||
? "AbstractedFirebase" | ||
: e.code; | ||
e.code = "abstracted-firebase/unWatch"; | ||
@@ -239,3 +255,4 @@ throw e; | ||
} | ||
if (e.message.indexOf("First argument includes undefined in property") !== -1) { | ||
if (e.message.indexOf("First argument includes undefined in property") !== | ||
-1) { | ||
e.name = "FirebaseUndefinedValueAssignment"; | ||
@@ -538,3 +555,5 @@ throw new UndefinedAssignment_1.UndefinedAssignment(e); | ||
} | ||
this._onConnected.forEach(listener => listener.ctx ? listener.cb.bind(listener.ctx)(this) : listener.cb.bind(this)()); | ||
this._onConnected.forEach(listener => listener.ctx | ||
? listener.cb.bind(listener.ctx)(this) | ||
: listener.cb.bind(this)()); | ||
} | ||
@@ -555,3 +574,4 @@ else { | ||
this._mockLoadingState = "loading"; | ||
const FireMock = await (__syncRequire ? Promise.resolve().then(() => require(/* webpackChunkName: "firemock" */ "firemock")) : new Promise((resolve_1, reject_1) => { require(["firemock"], resolve_1, reject_1); })); | ||
const FireMock = await (__syncRequire ? Promise.resolve().then(() => require( | ||
/* webpackChunkName: "firemock" */ "firemock")) : new Promise((resolve_1, reject_1) => { require(["firemock"], resolve_1, reject_1); })); | ||
this._mockLoadingState = "loaded"; | ||
@@ -558,0 +578,0 @@ this._mock = await FireMock.Mock.prepare(config); |
{ | ||
"name": "abstracted-firebase", | ||
"version": "0.27.9", | ||
"version": "0.27.10", | ||
"description": "Core functional library supporting 'abstracted-admin' and 'abstracted-client'", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
153174
3698