abstracted-firebase
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -1,9 +0,5 @@ | ||
import * as admin from "firebase-admin"; | ||
import * as client from "@firebase/database"; | ||
import { SerializedQuery } from "serialized-query"; | ||
import { Mock, Reference } from "firemock"; | ||
export declare type Reference = admin.database.Reference | client.Reference; | ||
export declare type Query = admin.database.Query | client.Query; | ||
export declare type Database = admin.database.Database | client.Database; | ||
export declare type DataSnapshot = admin.database.DataSnapshot | client.DataSnapshot; | ||
import { Mock } from "firemock"; | ||
import { rtdb } from "firebase-api-surface"; | ||
export declare type FirebaseEvent = "child_added" | "child_removed" | "child_changed" | "child_moved" | "value"; | ||
export declare enum FirebaseBoolean { | ||
@@ -25,3 +21,3 @@ true = 1, | ||
protected static isAuthorized: boolean; | ||
protected static connection: Database; | ||
protected static connection: rtdb.IFirebaseDatabase; | ||
protected mocking: boolean; | ||
@@ -36,3 +32,3 @@ protected _mock: Mock; | ||
constructor(config?: IFirebaseConfig); | ||
ref(path: string): Reference<any>; | ||
ref(path: string): rtdb.IReference; | ||
allowMocking(): void; | ||
@@ -44,5 +40,5 @@ readonly mock: Mock; | ||
set<T = any>(path: string, value: T): Promise<void>; | ||
update<T = any>(path: string, value: Partial<T>): Promise<void>; | ||
update<T = any>(path: string, value: Partial<T>): Promise<any>; | ||
remove<T = any>(path: string, ignoreMissing?: boolean): Promise<void>; | ||
getSnapshot(path: string | SerializedQuery): Promise<DataSnapshot>; | ||
getSnapshot(path: string | SerializedQuery): Promise<rtdb.IDataSnapshot>; | ||
getValue<T = any>(path: string): Promise<T>; | ||
@@ -52,5 +48,5 @@ getRecord<T = any>(path: string | SerializedQuery, idProp?: string): Promise<T>; | ||
getSortedList<T = any[]>(query: any, idProp?: string): Promise<T[]>; | ||
push<T = any>(path: string, value: T): Promise<any>; | ||
push<T = any>(path: string, value: T): Promise<void>; | ||
exists(path: string): Promise<boolean>; | ||
protected handleError(e: any, name: string, message?: string): Promise<never>; | ||
} |
@@ -74,3 +74,3 @@ "use strict"; | ||
.set(value) | ||
.catch(e => this.handleError(e, "set", `setting value @ "${path}"`)); | ||
.catch((e) => this.handleError(e, "set", `setting value @ "${path}"`)); | ||
}); | ||
@@ -134,3 +134,3 @@ } | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.ref(path).push(value); | ||
this.ref(path).push(value); | ||
}); | ||
@@ -137,0 +137,0 @@ } |
import { RealTimeDB } from "./db"; | ||
export default RealTimeDB; | ||
export { RealTimeDB, IFirebaseConfig, IFirebaseListener, FirebaseBoolean, DataSnapshot, Query, Reference, Database, DebuggingCallback } from "./db"; | ||
export { RealTimeDB, IFirebaseConfig, IFirebaseListener, FirebaseBoolean, DebuggingCallback, FirebaseEvent } from "./db"; | ||
export { rtdb, auth } from "firebase-api-surface"; |
@@ -8,1 +8,4 @@ "use strict"; | ||
exports.FirebaseBoolean = db_2.FirebaseBoolean; | ||
var firebase_api_surface_1 = require("firebase-api-surface"); | ||
exports.rtdb = firebase_api_surface_1.rtdb; | ||
exports.auth = firebase_api_surface_1.auth; |
{ | ||
"name": "abstracted-firebase", | ||
"version": "0.1.3", | ||
"description": | ||
"Core library supporting 'abstracted-admin' and 'abstracted-client' libraries", | ||
"version": "0.2.0", | ||
"description": "Core library supporting 'abstracted-admin' and 'abstracted-client' libraries", | ||
"license": "MIT", | ||
"repository": "https://github.com/forest-fire/abstracted-firebase", | ||
"author": "Ken Snyder <ken@ken.net>", | ||
"keywords": ["firebase", "typescript", "utility"], | ||
"files": ["lib"], | ||
"keywords": [ | ||
"firebase", | ||
"typescript", | ||
"utility" | ||
], | ||
"files": [ | ||
"lib" | ||
], | ||
"main": "lib/index.js", | ||
@@ -18,4 +23,3 @@ "typings": "lib/index.d.ts", | ||
"test": "ts-node ./scripts/test.ts", | ||
"coverage": | ||
"nyc --include='src/**/*.ts' --reporter=text --reporter=html --reporter=lcov mocha --compilers ts:ts-node/register --recursive 'test/**/*.test.ts'", | ||
"coverage": "nyc --include='src/**/*.ts' --reporter=text --reporter=html --reporter=lcov mocha --compilers ts:ts-node/register --recursive 'test/**/*.test.ts'", | ||
"watch": "npm run build -- --watch", | ||
@@ -27,2 +31,3 @@ "deploy": "ts-node ./scripts/deploy.ts ", | ||
"common-types": "^1.5.1", | ||
"firebase-api-surface": "^0.7.1", | ||
"lodash.first": "^3.0.0", | ||
@@ -37,8 +42,5 @@ "lodash.last": "^3.0.0", | ||
"faker": "^4.1.0", | ||
"firemock": "^0.14.7" | ||
"firemock": "^0.15.4" | ||
}, | ||
"devDependencies": { | ||
"@firebase/app-types": "^0.1.1", | ||
"@firebase/auth-types": "^0.1.1", | ||
"@firebase/database-types": "^0.1.1", | ||
"@types/chai": "^3.0.0", | ||
@@ -60,3 +62,3 @@ "@types/chalk": "^0.4.31", | ||
"firebase-admin": "^5.8.1", | ||
"firemock": "^0.14.7", | ||
"firemock": "^0.15.4", | ||
"gitbook-plugin-favicon": "^0.0.2", | ||
@@ -70,4 +72,4 @@ "js-yaml": "^3.9.1", | ||
"ts-node": "^3.0.0", | ||
"tslint": "^5.7.0", | ||
"typescript": "^2.6.2" | ||
"tslint": "^5.9.1", | ||
"typescript": "^2.8.0-dev.20180127" | ||
}, | ||
@@ -78,6 +80,14 @@ "engines": { | ||
"nyc": { | ||
"include": ["src/**/*.ts"], | ||
"exclude": ["lib"], | ||
"extension": [".ts"], | ||
"require": ["ts-node/register"], | ||
"include": [ | ||
"src/**/*.ts" | ||
], | ||
"exclude": [ | ||
"lib" | ||
], | ||
"extension": [ | ||
".ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
], | ||
"reporter": [], | ||
@@ -84,0 +94,0 @@ "all": true |
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
27
12975
10
+ Addedfirebase-api-surface@^0.7.1
+ Added@firebase/app-types@0.1.2(transitive)
+ Added@firebase/auth-types@0.1.2(transitive)
+ Added@firebase/database-types@0.1.2(transitive)
+ Added@firebase/firestore-types@0.2.2(transitive)
+ Added@firebase/messaging-types@0.1.3(transitive)
+ Added@firebase/util@0.1.11(transitive)
+ Addedfirebase-api-surface@0.7.12(transitive)
+ Addedfirebase-key@2.0.2(transitive)
+ Addedfiremock@0.15.15(transitive)
+ Addedtslib@1.9.0(transitive)
- Removedfirebase-key@1.0.6(transitive)
- Removedfiremock@0.14.9(transitive)