Skip to content

Commit

Permalink
feat: @quipodb/json & @quipodb/steno
Browse files Browse the repository at this point in the history
  • Loading branch information
r-rajaneesh committed Nov 17, 2022
1 parent e0eb7bf commit 502650d
Show file tree
Hide file tree
Showing 13 changed files with 792 additions and 29 deletions.
7 changes: 7 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import fs from "fs-extra";
import { exec } from "child_process";
fs.readdirSync("packages").forEach((dir) => {
exec(`cd packages/${dir} && npm run build`, (error, stdout, stderr) => {
console.log(stdout);
});
});
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"version": "0.0.1-beta.0",
"type": "module",
"scripts": {
"build": "tsc index.ts -t esnext -m esnext -d --allowSyntheticDefaultImports --moduleResolution node --outDir ./dist",
"build-packages": "cd packages/core && npm run build && cd.. && cd.. && cd packages/firestore && npm run build && cd.. && cd.. && cd packages/sqlite && npm run build && cd.. && cd..",
"build": "node build.js",
"publish-beta-public": "npm publish --tag beta --registry=https://registry.npmjs.com --workspaces",
"publish-beta-private": "npm publish --tag beta --workspaces",
"publish-public": "npm publish --registry=https://registry.npmjs.com --workspaces",
Expand All @@ -30,11 +29,8 @@
"/packages/*"
],
"dependencies": {
"@firebase/firestore": "^3.6.0",
"@hapi/hapi": "^20.2.2",
"axios": "^1.1.3",
"better-sqlite3": "^7.6.2",
"bson": "^4.7.0",
"firebase": "^9.11.0",
"firebase-admin": "^11.0.1",
"fs-extra": "^10.1.0",
Expand All @@ -48,6 +44,7 @@
"@types/fs-extra": "^9.0.13",
"@types/lodash": "^4.14.186",
"@types/node": "^18.11.3",
"globby": "^13.1.2",
"typescript": "^4.8.4"
}
}
72 changes: 66 additions & 6 deletions packages/core/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
interface constructorOptions {
providers: providers[];
cache: Boolean;
}
interface providers {
createCollectionProvider(collectionName: String, cb?: Function): Promise<any> | any;
Expand All @@ -18,9 +19,10 @@ interface storage {
interface document {
[key: string]: string | number | Object | Array<any> | any;
}
export default class QuipoDB {
export declare class QuipoDB {
options: constructorOptions;
storage: storage;
cache: Boolean;
collectionName: String;
Docs: typeof Docs;
providers: providers[];
Expand All @@ -31,11 +33,14 @@ export default class QuipoDB {
interface DocsOptions {
providers: providers[];
collectionName: String;
storage: storage;
cache: Boolean;
}
declare class Docs {
private options;
private providers;
private collectionName;
private storage;
constructor(options: DocsOptions);
createDoc(data: document | document[], cb?: Function): Promise<document>;
deleteDoc(data: document | fn, cb?: Function): Promise<void>;
Expand All @@ -46,10 +51,65 @@ declare class Docs {
[x: string]: any;
save: Function;
}>;
private $add;
private $subtract;
private $multiply;
private $divide;
private $push;
private _$add;
private _$subtract;
private _$multiply;
private _$divide;
private _$push;
}
export declare class Query {
private data;
private key;
private current;
private _limit;
constructor(Data: any[]);
add(val: number): this;
/**
* Gets back to the top level on the data
*/
clearQuery(): this;
delete(key: string): this;
divide(val: number): this;
equals(val: any): this;
/**
* Check if the data exists on every object
*/
exists(key: string): boolean;
find(key: string, val: any): void;
gt(val: any): this;
gte(val: any): this;
limit(val: number): this;
lt(val: any): this;
lte(val: any): this;
multiply(val: number): this;
push(arr: any[]): this;
/**
* Get the raw data
*/
raw(): any[];
update(val: number): this;
/**
* Get into a deeper object
* @param {String} key
*/
select(key: string): this;
subtract(val: number): this;
/**
* Saves the queries on the data
*/
save(): this;
/**
* Get the Latest data
*/
toJSON(): any[];
/**
* Get the last selected query
*/
toValue(): any[];
/**
* Select a object to query next
* @param {string} key
*/
where(key: string): this;
}
export {};
Loading

0 comments on commit 502650d

Please sign in to comment.