@astronautlabs/datastore
Advanced tools
+12
-3
@@ -17,2 +17,11 @@ import { Observable } from 'rxjs'; | ||
| } | ||
| export interface Order { | ||
| field: string; | ||
| direction: 'asc' | 'desc'; | ||
| } | ||
| export interface CollectionParams { | ||
| order?: Order; | ||
| limit?: number; | ||
| startAfter?: string; | ||
| } | ||
| export interface DataStore { | ||
@@ -23,5 +32,5 @@ create<T extends Storable>(collectionPath: string, data: T): Promise<T>; | ||
| query<T extends Storable>(collectionPath: string): Query<T>; | ||
| listAll<T extends Storable>(collectionPath: string, limit?: number, startAfter?: string): Promise<T[]>; | ||
| watchAll<T extends Storable>(collectionPath: string): Observable<T[]>; | ||
| watch<T extends Storable>(collectionPath: string): Observable<T>; | ||
| listAll<T extends Storable>(collectionPath: string, params?: CollectionParams): Promise<T[]>; | ||
| watchAll<T extends Storable>(collectionPath: string, params?: CollectionParams): Observable<T[]>; | ||
| watch<T extends Storable>(docPath: string): Observable<T>; | ||
| set<T extends Storable>(docPath: string, data: T): Promise<void>; | ||
@@ -28,0 +37,0 @@ update<T extends Storable>(docPath: string, data: Partial<T>): Promise<void>; |
+2
-2
| { | ||
| "name": "@astronautlabs/datastore", | ||
| "version": "2.0.0", | ||
| "version": "3.0.0", | ||
| "description": "Isomorphic, abstracted, Firestore-compatible NoSQL data storage library", | ||
@@ -9,3 +9,3 @@ "main": "dist/index.js", | ||
| "build": "tsc -p .", | ||
| "prepare": "npm run build" | ||
| "prepublishOnly": "npm run build" | ||
| }, | ||
@@ -12,0 +12,0 @@ "author": "Astronaut Labs, LLC", |
+14
-3
@@ -21,2 +21,13 @@ import { Observable } from 'rxjs'; | ||
| export interface Order { | ||
| field : string; | ||
| direction : 'asc' | 'desc'; | ||
| } | ||
| export interface CollectionParams { | ||
| order? : Order; | ||
| limit? : number; | ||
| startAfter? : string; | ||
| } | ||
| export interface DataStore { | ||
@@ -27,5 +38,5 @@ create<T extends Storable>(collectionPath : string, data : T): Promise<T>; | ||
| query<T extends Storable>(collectionPath : string): Query<T>; | ||
| listAll<T extends Storable>(collectionPath : string, limit? : number, startAfter? : string): Promise<T[]>; | ||
| watchAll<T extends Storable>(collectionPath : string) : Observable<T[]>; | ||
| watch<T extends Storable>(collectionPath : string) : Observable<T>; | ||
| listAll<T extends Storable>(collectionPath : string, params? : CollectionParams): Promise<T[]>; | ||
| watchAll<T extends Storable>(collectionPath : string, params? : CollectionParams) : Observable<T[]>; | ||
| watch<T extends Storable>(docPath : string) : Observable<T>; | ||
| set<T extends Storable>(docPath: string, data: T): Promise<void>; | ||
@@ -32,0 +43,0 @@ update<T extends Storable>(docPath : string, data : Partial<T>): Promise<void>; |
8272
5.24%136
15.25%