Compare commits
39 Commits
Author | SHA1 | Date | |
---|---|---|---|
5735ab8577 | |||
def671cbe4 | |||
14042151ba | |||
c74873d02c | |||
800cdd655a | |||
68c0ceeb14 | |||
154dc5c1b3 | |||
d5c027caf0 | |||
30776a7da0 | |||
fedc0bd8c8 | |||
7b78b47a1b | |||
a4acfc0f6e | |||
a934f3608f | |||
a4f3f23bed | |||
2039f1c807 | |||
57d1a6dd0a | |||
d504e90e47 | |||
7079340657 | |||
63ceded1b8 | |||
b45e7ee206 | |||
715709f3ec | |||
0b8adea736 | |||
90d9a25b3f | |||
e49811eecd | |||
9cbdf317dc | |||
d55339013a | |||
9acdbd2842 | |||
dfce8cfcc0 | |||
38446fc79b | |||
af8c41ad6c | |||
3a24f829b4 | |||
67db1325c1 | |||
6683c05c22 | |||
f7f7852b7f | |||
df4346e0a2 | |||
eb54fbcd0d | |||
f13c12cd47 | |||
08d53f22f5 | |||
5b6523e6f4 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,5 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
test/data
|
|
||||||
pages/
|
|
||||||
coverage/
|
|
||||||
public/
|
public/
|
||||||
|
coverage/
|
||||||
|
.nogit/
|
||||||
|
@ -1,19 +1,22 @@
|
|||||||
image: hosttoday/ht-docker-node:npmts
|
# gitzone standard
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .yarn/
|
||||||
|
key: "$CI_BUILD_STAGE"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
|
- trigger
|
||||||
before_script:
|
- pages
|
||||||
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
|
|
||||||
- echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y mongodb-org
|
|
||||||
|
|
||||||
testLEGACY:
|
testLEGACY:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test legacy
|
- npmci test legacy
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
@ -22,6 +25,7 @@ testLTS:
|
|||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test lts
|
- npmci test lts
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
@ -29,15 +33,40 @@ testSTABLE:
|
|||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test stable
|
- npmci test stable
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
environment: npm_registry
|
|
||||||
script:
|
script:
|
||||||
- npmci publish
|
- npmci publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
stage: trigger
|
||||||
|
script:
|
||||||
|
- npmci trigger
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
pages:
|
||||||
|
image: hosttoday/ht-docker-node:npmci
|
||||||
|
stage: pages
|
||||||
|
script:
|
||||||
|
- npmci command yarn global add npmpage
|
||||||
|
- npmci command npmpage
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
allow_failure: true
|
||||||
|
104
README.md
104
README.md
@ -1,89 +1,29 @@
|
|||||||
# smartdata
|
# smartdata
|
||||||
|
do more with data
|
||||||
|
|
||||||
> Note: Still in Beta
|
## Availabililty
|
||||||
|
[](https://www.npmjs.com/package/smartdata)
|
||||||
|
[](https://GitLab.com/pushrocks/smartdata)
|
||||||
|
[](https://github.com/pushrocks/smartdata)
|
||||||
|
[](https://pushrocks.gitlab.io/smartdata/)
|
||||||
|
|
||||||
smartdata is a ODM that adheres to TypeScript practices and uses classes to organize data.
|
## Status for master
|
||||||
It uses MongoDB as persistent storage.
|
[](https://GitLab.com/pushrocks/smartdata/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/smartdata/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/smartdata)
|
||||||
|
[](https://david-dm.org/pushrocks/smartdata)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartdata/master/dependencies/npm)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartdata)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
## Intention
|
## Usage
|
||||||
There are many ODMs out there, however when we searched for a ODM that uses TypeScript,
|
Use TypeScript for best in class instellisense.
|
||||||
acts smart while still embracing an easy the NoSQL idea we didn't find a matching solution.
|
|
||||||
This is why we started smartdata
|
|
||||||
|
|
||||||
How MongoDB terms map to smartdata classes
|
For further information read the linked docs at the top of this README.
|
||||||
|
|
||||||
MongoDB term | smartdata class
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
--- | ---
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
Database | smartdata.Db
|
|
||||||
Collection | smartdata.DbCollection
|
|
||||||
Document | smartdata.DbDoc
|
|
||||||
|
|
||||||
### class Db
|
[](https://push.rocks)
|
||||||
represents a Database. Naturally it has .connect() etc. methods on it.
|
|
||||||
Since it is a class you can have multiple DBs defined.
|
|
||||||
```typescript
|
|
||||||
import * as smartdata from 'smartdata'
|
|
||||||
|
|
||||||
let myDb1 = new smartdata.Db('someConnectionUrl')
|
|
||||||
let myDb2 = new smartdata.Db('someConnectionUrl')
|
|
||||||
|
|
||||||
myDb1.connect()
|
|
||||||
myDb2.connect()
|
|
||||||
|
|
||||||
// continues in next block...
|
|
||||||
```
|
|
||||||
|
|
||||||
### class DbCollection
|
|
||||||
represents a collection of objects.
|
|
||||||
A collection is defined by the object class (that is extending smartdata.dbdoc) it respresents
|
|
||||||
|
|
||||||
So to get to get access to a specific collection you document
|
|
||||||
```typescript
|
|
||||||
// continues from the block before...
|
|
||||||
|
|
||||||
class myObject extends smartdata.DbDoc { // read the next block about DbDoc
|
|
||||||
property1:string
|
|
||||||
property2:number
|
|
||||||
constructor(optionsArg:{
|
|
||||||
queryArg?:any,
|
|
||||||
dataArg?:{
|
|
||||||
property1:string,
|
|
||||||
property2:number
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
super(this,optionsArg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let myCollection = myDb1.getCollection(myObject)
|
|
||||||
```
|
|
||||||
|
|
||||||
> Alert: You NEVER instantiate a collection.
|
|
||||||
This is done for you!!!
|
|
||||||
|
|
||||||
### class DbDoc
|
|
||||||
represents a individual document in a collection
|
|
||||||
and thereby is ideally suited to extend the class you want to actually store.
|
|
||||||
|
|
||||||
DbDoc extends your class with the following methods:
|
|
||||||
|
|
||||||
* `.save()` will save (or update) the object you call it on only. Any referenced non-savable objects will not get stored.
|
|
||||||
* `.saveDeep()` does the same like `.save()`.
|
|
||||||
In addition it will look for properties that reference an object
|
|
||||||
that extends DbDoc as well and call .saveDeep() on them as well.
|
|
||||||
Loops are prevented
|
|
||||||
|
|
||||||
So now we can **store** instances of classes to Db...
|
|
||||||
How do we **get** a new class instance from a Doc in the DB?
|
|
||||||
Easy! Take a look at the constructor. When you specify `optionsArg.queryArg`
|
|
||||||
smartdata will fill in the data from the database!
|
|
||||||
But when you specify a `optionsArg.dataArg` instead
|
|
||||||
the data for the class is taken from there :)
|
|
||||||
|
|
||||||
## TypeScript
|
|
||||||
How does TypeScript play into this?
|
|
||||||
Since you define your classes in TapeScript and types flow through smartdata in a generic way
|
|
||||||
you should get all the Intellisense and type checking you love when using smartdata.
|
|
||||||
smartdata itself also bundles typings.
|
|
||||||
So you don't need to install any additional types whenimporting smartdata.
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
||||||
|
3
dist/index.d.ts
vendored
3
dist/index.d.ts
vendored
@ -1,2 +1,3 @@
|
|||||||
export * from './smartdata.classes.dbcollection';
|
|
||||||
export * from './smartdata.classes.db';
|
export * from './smartdata.classes.db';
|
||||||
|
export * from './smartdata.classes.dbcollection';
|
||||||
|
export * from './smartdata.classes.dbdoc';
|
||||||
|
8
dist/index.js
vendored
8
dist/index.js
vendored
@ -2,6 +2,8 @@
|
|||||||
function __export(m) {
|
function __export(m) {
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||||
}
|
}
|
||||||
__export(require('./smartdata.classes.dbcollection'));
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
__export(require('./smartdata.classes.db'));
|
__export(require("./smartdata.classes.db"));
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBRUEsaUJBQWMsa0NBQ2QsQ0FBQyxFQUQrQztBQUNoRCxpQkFBYyx3QkFDZCxDQUFDLEVBRHFDIn0=
|
__export(require("./smartdata.classes.dbcollection"));
|
||||||
|
__export(require("./smartdata.classes.dbdoc"));
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDRDQUFzQztBQUN0QyxzREFBZ0Q7QUFDaEQsK0NBQXlDIn0=
|
29
dist/smartdata.classes.db.d.ts
vendored
29
dist/smartdata.classes.db.d.ts
vendored
@ -1,11 +1,32 @@
|
|||||||
/// <reference types="q" />
|
|
||||||
import * as plugins from './smartdata.plugins';
|
import * as plugins from './smartdata.plugins';
|
||||||
|
import { Objectmap } from 'lik';
|
||||||
|
import { DbCollection } from './smartdata.classes.dbcollection';
|
||||||
|
/**
|
||||||
|
* interface - indicates the connection status of the db
|
||||||
|
*/
|
||||||
export declare type TConnectionStatus = 'disconnected' | 'connected' | 'failed';
|
export declare type TConnectionStatus = 'disconnected' | 'connected' | 'failed';
|
||||||
export declare class Db {
|
export declare class Db {
|
||||||
dbUrl: string;
|
dbUrl: string;
|
||||||
db: plugins.mongodb.Db;
|
db: plugins.mongodb.Db;
|
||||||
status: TConnectionStatus;
|
status: TConnectionStatus;
|
||||||
constructor(dbUrl: string);
|
classCollections: Objectmap<DbCollection<any>>;
|
||||||
connect(): plugins.q.Promise<any>;
|
objectCollections: Objectmap<DbCollection<any>>;
|
||||||
close(): plugins.q.Promise<any>;
|
constructor(dbUrlArg: string);
|
||||||
|
/**
|
||||||
|
* connects to the database that was specified during instance creation
|
||||||
|
*/
|
||||||
|
connect(): Promise<any>;
|
||||||
|
/**
|
||||||
|
* closes the connection to the databse
|
||||||
|
*/
|
||||||
|
close(): Promise<any>;
|
||||||
|
/**
|
||||||
|
* gets a class based collection by name: string
|
||||||
|
*/
|
||||||
|
getClassCollectionByName<T>(nameArg: string): Promise<DbCollection<T>>;
|
||||||
|
/**
|
||||||
|
* gets an object collection by name
|
||||||
|
*/
|
||||||
|
getObjectCollectionByName<T>(nameArg: string, dbArg: Db, makeNewArg?: boolean): Promise<DbCollection<T>>;
|
||||||
|
addCollection(dbCollectionArg: DbCollection<any>): void;
|
||||||
}
|
}
|
||||||
|
64
dist/smartdata.classes.db.js
vendored
64
dist/smartdata.classes.db.js
vendored
@ -1,11 +1,28 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
const plugins = require('./smartdata.plugins');
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const plugins = require("./smartdata.plugins");
|
||||||
|
const lik_1 = require("lik");
|
||||||
|
const smartdata_classes_dbobjectdoc_1 = require("./smartdata.classes.dbobjectdoc");
|
||||||
class Db {
|
class Db {
|
||||||
constructor(dbUrl) {
|
constructor(dbUrlArg) {
|
||||||
this.dbUrl = dbUrl;
|
this.classCollections = new lik_1.Objectmap();
|
||||||
|
this.objectCollections = new lik_1.Objectmap();
|
||||||
|
this.dbUrl = dbUrlArg;
|
||||||
}
|
}
|
||||||
|
// basic connection stuff ----------------------------------------------
|
||||||
|
/**
|
||||||
|
* connects to the database that was specified during instance creation
|
||||||
|
*/
|
||||||
connect() {
|
connect() {
|
||||||
let done = plugins.q.defer();
|
let done = plugins.smartq.defer();
|
||||||
plugins.mongodb.MongoClient.connect(this.dbUrl, (err, db) => {
|
plugins.mongodb.MongoClient.connect(this.dbUrl, (err, db) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@ -17,13 +34,48 @@ class Db {
|
|||||||
});
|
});
|
||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* closes the connection to the databse
|
||||||
|
*/
|
||||||
close() {
|
close() {
|
||||||
let done = plugins.q.defer();
|
let done = plugins.smartq.defer();
|
||||||
this.db.close();
|
this.db.close();
|
||||||
plugins.beautylog.ok(`disconnected to database at ${this.dbUrl}`);
|
plugins.beautylog.ok(`disconnected to database at ${this.dbUrl}`);
|
||||||
done.resolve();
|
done.resolve();
|
||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
|
// advanced communication with the database --------------------------------
|
||||||
|
/**
|
||||||
|
* gets a class based collection by name: string
|
||||||
|
*/
|
||||||
|
getClassCollectionByName(nameArg) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let resultCollection = this.classCollections.find((dbCollectionArg) => {
|
||||||
|
return dbCollectionArg.name === nameArg;
|
||||||
|
});
|
||||||
|
return resultCollection;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* gets an object collection by name
|
||||||
|
*/
|
||||||
|
getObjectCollectionByName(nameArg, dbArg, makeNewArg = false) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let resultCollection = this.objectCollections.find((dbCollectionArg) => {
|
||||||
|
return dbCollectionArg.name === nameArg;
|
||||||
|
});
|
||||||
|
if (!resultCollection && makeNewArg) {
|
||||||
|
resultCollection = smartdata_classes_dbobjectdoc_1.getObjectDoc(nameArg, this).collection;
|
||||||
|
return resultCollection;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return resultCollection;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addCollection(dbCollectionArg) {
|
||||||
|
this.classCollections.add(dbCollectionArg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.Db = Db;
|
exports.Db = Db;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLmNsYXNzZXMuZGIuanMiLCJzb3Vy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LENBQUMsZ0JBQWdCLENBQUE7UUFDekIsQ0FBQztLQUFBO0lBRUQ7O09BRUc7SUFDRyx5QkFBeUIsQ0FBSyxPQUFlLEVBQUUsS0FBUyxFQUFHLGFBQXNCLEtBQUs7O1lBQzFGLElBQUksZ0JBQWdCLEdBQUcsSUFBSSxDQUFDLGlCQUFpQixDQUFDLElBQUksQ0FBQyxDQUFDLGVBQWUsRUFBRSxFQUFFO2dCQUNyRSxNQUFNLENBQUMsZUFBZSxDQUFDLElBQUksS0FBSyxPQUFPLENBQUE7WUFDekMsQ0FBQyxDQUFDLENBQUE7WUFDRixFQUFFLENBQUMsQ0FBQyxDQUFDLGdCQUFnQixJQUFJLFVBQVUsQ0FBQyxDQUFDLENBQUM7Z0JBQ3BDLGdCQUFnQixHQUFHLDRDQUFZLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyxDQUFDLFVBQVUsQ0FBQTtnQkFDekQsTUFBTSxDQUFDLGdCQUFnQixDQUFBO1lBQ3pCLENBQUM7WUFBQyxJQUFJLENBQUMsQ0FBQztnQkFDTixNQUFNLENBQUMsZ0JBQWdCLENBQUE7WUFDekIsQ0FBQztRQUNILENBQUM7S0FBQTtJQUVELGFBQWEsQ0FBRSxlQUFrQztRQUMvQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxDQUFDLGVBQWUsQ0FBQyxDQUFBO0lBQzVDLENBQUM7Q0FFRjtBQXRFRCxnQkFzRUMifQ==
|
34
dist/smartdata.classes.dbcollection.d.ts
vendored
34
dist/smartdata.classes.dbcollection.d.ts
vendored
@ -1,24 +1,42 @@
|
|||||||
/// <reference types="q" />
|
|
||||||
import * as plugins from './smartdata.plugins';
|
import * as plugins from './smartdata.plugins';
|
||||||
import { Db } from './smartdata.classes.db';
|
import { Db } from './smartdata.classes.db';
|
||||||
|
import { DbDoc } from './smartdata.classes.dbdoc';
|
||||||
|
export interface IFindOptions {
|
||||||
|
limit?: number;
|
||||||
|
}
|
||||||
|
export interface IDocValidation<T> {
|
||||||
|
(doc: T): boolean;
|
||||||
|
}
|
||||||
|
export declare function Collection(db: Db): (constructor: any) => void;
|
||||||
export declare class DbCollection<T> {
|
export declare class DbCollection<T> {
|
||||||
|
/**
|
||||||
|
* the collection that is used, defaults to mongodb collection,
|
||||||
|
* can be nedb datastore (sub api of mongodb)
|
||||||
|
*/
|
||||||
collection: plugins.mongodb.Collection;
|
collection: plugins.mongodb.Collection;
|
||||||
constructor(nameArg: string, dbArg: Db);
|
collectedClass: T & DbDoc<T>;
|
||||||
|
objectValidation: IDocValidation<T>;
|
||||||
|
name: string;
|
||||||
|
db: Db;
|
||||||
|
constructor(collectedClassArg: T & DbDoc<T>, dbArg: Db);
|
||||||
/**
|
/**
|
||||||
* adds a validation function that all newly inserted and updated objects have to pass
|
* adds a validation function that all newly inserted and updated objects have to pass
|
||||||
*/
|
*/
|
||||||
addObjectValidation(funcArg: any): void;
|
addDocValidation(funcArg: IDocValidation<T>): void;
|
||||||
/**
|
/**
|
||||||
* finds an object in the DbCollection
|
* finds an object in the DbCollection
|
||||||
*/
|
*/
|
||||||
find(docMatchArg: T | any): plugins.q.Promise<T[]>;
|
find(docMatchArg: T | any, optionsArg?: IFindOptions): Promise<T[]>;
|
||||||
/**
|
/**
|
||||||
* inserts object into the DbCollection
|
* inserts object into the DbCollection
|
||||||
*/
|
*/
|
||||||
insertOne(docArg: T): plugins.q.Promise<void>;
|
insertOne(docArg: T): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* inserts many objects at once into the DbCollection
|
* inserts many objects at once into the DbCollection
|
||||||
*/
|
*/
|
||||||
insertMany(docArrayArg: T[]): plugins.q.Promise<void>;
|
insertMany(docArrayArg: T[]): Promise<void>;
|
||||||
private checkDoc(doc);
|
/**
|
||||||
|
* checks a Doc for constraints
|
||||||
|
*/
|
||||||
|
private checkDoc(docArg);
|
||||||
}
|
}
|
||||||
|
68
dist/smartdata.classes.dbcollection.js
vendored
68
dist/smartdata.classes.dbcollection.js
vendored
@ -1,20 +1,44 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
const plugins = require('./smartdata.plugins');
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const plugins = require("./smartdata.plugins");
|
||||||
|
function Collection(db) {
|
||||||
|
return function (constructor) {
|
||||||
|
constructor['dbCollection'] = new DbCollection(constructor, db);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
exports.Collection = Collection;
|
||||||
class DbCollection {
|
class DbCollection {
|
||||||
constructor(nameArg, dbArg) {
|
constructor(collectedClassArg, dbArg) {
|
||||||
this.collection = dbArg.db.collection(nameArg);
|
this.objectValidation = null;
|
||||||
|
// tell the collection where it belongs
|
||||||
|
this.collectedClass = collectedClassArg;
|
||||||
|
this.name = collectedClassArg.name;
|
||||||
|
this.db = dbArg;
|
||||||
|
// make sure it actually exists
|
||||||
|
this.collection = dbArg.db.collection(this.name);
|
||||||
|
// tell the db class about it (important since Db uses different systems under the hood)
|
||||||
|
this.db.addCollection(this);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* adds a validation function that all newly inserted and updated objects have to pass
|
* adds a validation function that all newly inserted and updated objects have to pass
|
||||||
*/
|
*/
|
||||||
addObjectValidation(funcArg) { }
|
addDocValidation(funcArg) {
|
||||||
|
this.objectValidation = funcArg;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* finds an object in the DbCollection
|
* finds an object in the DbCollection
|
||||||
*/
|
*/
|
||||||
find(docMatchArg) {
|
find(docMatchArg, optionsArg) {
|
||||||
let done = plugins.q.defer();
|
let done = plugins.smartq.defer();
|
||||||
this.collection.find(docMatchArg).toArray((err, docs) => {
|
let findCursor = this.collection.find(docMatchArg);
|
||||||
|
if (optionsArg) {
|
||||||
|
if (optionsArg.limit) {
|
||||||
|
findCursor = findCursor.limit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
findCursor.toArray((err, docs) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
done.reject(err);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
done.resolve(docs);
|
done.resolve(docs);
|
||||||
@ -22,13 +46,15 @@ class DbCollection {
|
|||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* inserts object into the DbCollection
|
* inserts object into the DbCollection
|
||||||
*/
|
*/
|
||||||
insertOne(docArg) {
|
insertOne(docArg) {
|
||||||
let done = plugins.q.defer();
|
let done = plugins.smartq.defer();
|
||||||
this.checkDoc(docArg).then(() => {
|
this.checkDoc(docArg).then(() => {
|
||||||
this.collection.insertOne(docArg)
|
this.collection.insertOne(docArg)
|
||||||
.then(() => { done.resolve(); });
|
.then(() => { done.resolve(); });
|
||||||
|
}, () => {
|
||||||
|
done.reject(new Error('one the docs did not pass validation'));
|
||||||
});
|
});
|
||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
@ -36,22 +62,34 @@ class DbCollection {
|
|||||||
* inserts many objects at once into the DbCollection
|
* inserts many objects at once into the DbCollection
|
||||||
*/
|
*/
|
||||||
insertMany(docArrayArg) {
|
insertMany(docArrayArg) {
|
||||||
let done = plugins.q.defer();
|
let done = plugins.smartq.defer();
|
||||||
let checkDocPromiseArray = [];
|
let checkDocPromiseArray = [];
|
||||||
for (let docArg of docArrayArg) {
|
for (let docArg of docArrayArg) {
|
||||||
checkDocPromiseArray.push(this.checkDoc(docArg));
|
checkDocPromiseArray.push(this.checkDoc(docArg));
|
||||||
}
|
}
|
||||||
plugins.q.all(checkDocPromiseArray).then(() => {
|
Promise.all(checkDocPromiseArray).then(() => {
|
||||||
this.collection.insertMany(docArrayArg)
|
this.collection.insertMany(docArrayArg)
|
||||||
.then(() => { done.resolve(); });
|
.then(() => { done.resolve(); });
|
||||||
});
|
});
|
||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
checkDoc(doc) {
|
/**
|
||||||
let done = plugins.q.defer();
|
* checks a Doc for constraints
|
||||||
done.resolve();
|
*/
|
||||||
|
checkDoc(docArg) {
|
||||||
|
let done = plugins.smartq.defer();
|
||||||
|
let validationResult = true;
|
||||||
|
if (this.objectValidation) {
|
||||||
|
validationResult = this.objectValidation(docArg);
|
||||||
|
}
|
||||||
|
if (validationResult) {
|
||||||
|
done.resolve();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
done.reject('validation of object did not pass');
|
||||||
|
}
|
||||||
return done.promise;
|
return done.promise;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DbCollection = DbCollection;
|
exports.DbCollection = DbCollection;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLmNsYXNzZXMuZGJjb2xsZWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRkYXRhLmNsYXNzZXMuZGJjb2xsZWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxNQUFZLE9BQU8sV0FBTSxxQkFDekIsQ0FBQyxDQUQ2QztBQUc5QztJQUVJLFlBQVksT0FBZSxFQUFFLEtBQVM7UUFDbEMsSUFBSSxDQUFDLFVBQVUsR0FBRyxLQUFLLENBQUMsRUFBRSxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsQ0FBQTtJQUNsRCxDQUFDO0lBRUQ7O09BRUc7SUFDSCxtQkFBbUIsQ0FBQyxPQUFPLElBQUksQ0FBQztJQUVoQzs7T0FFRztJQUNILElBQUksQ0FBQyxXQUFvQjtRQUNyQixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBTyxDQUFBO1FBQ2pDLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLEdBQUcsRUFBRSxJQUFJO1lBQ2hELEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM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0Y7QUFsR0Qsb0NBa0dDIn0=
|
39
dist/smartdata.classes.dbdoc.d.ts
vendored
39
dist/smartdata.classes.dbdoc.d.ts
vendored
@ -0,0 +1,39 @@
|
|||||||
|
import { Objectmap } from 'lik';
|
||||||
|
import { DbCollection } from './smartdata.classes.dbcollection';
|
||||||
|
export declare type TDocCreation = 'db' | 'new' | 'mixed';
|
||||||
|
/**
|
||||||
|
* saveable - saveable decorator to be used on class properties
|
||||||
|
*/
|
||||||
|
export declare function svDb(): (target: DbDoc<any>, key: string) => void;
|
||||||
|
export declare class DbDoc<T> {
|
||||||
|
/**
|
||||||
|
* the collection object an Doc belongs to
|
||||||
|
*/
|
||||||
|
collection: DbCollection<T>;
|
||||||
|
/**
|
||||||
|
* how the Doc in memory was created, may prove useful later.
|
||||||
|
*/
|
||||||
|
creationType: TDocCreation;
|
||||||
|
/**
|
||||||
|
* an array of saveable properties of a doc
|
||||||
|
*/
|
||||||
|
saveableProperties: string[];
|
||||||
|
/**
|
||||||
|
* name
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* class constructor
|
||||||
|
*/
|
||||||
|
constructor();
|
||||||
|
/**
|
||||||
|
* saves this instance but not any connected items
|
||||||
|
* may lead to data inconsistencies, but is faster
|
||||||
|
*/
|
||||||
|
save(): void;
|
||||||
|
/**
|
||||||
|
* also store any referenced objects to DB
|
||||||
|
* better for data consistency
|
||||||
|
*/
|
||||||
|
saveDeep(savedMapArg?: Objectmap<DbDoc<any>>): void;
|
||||||
|
}
|
||||||
|
62
dist/smartdata.classes.dbdoc.js
vendored
62
dist/smartdata.classes.dbdoc.js
vendored
@ -1 +1,61 @@
|
|||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLmNsYXNzZXMuZGJkb2MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGRhdGEuY2xhc3Nlcy5kYmRvYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const lik_1 = require("lik");
|
||||||
|
/**
|
||||||
|
* saveable - saveable decorator to be used on class properties
|
||||||
|
*/
|
||||||
|
function svDb() {
|
||||||
|
return (target, key) => {
|
||||||
|
console.log('called sva');
|
||||||
|
if (!target.saveableProperties) {
|
||||||
|
target.saveableProperties = [];
|
||||||
|
}
|
||||||
|
target.saveableProperties.push(key);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
exports.svDb = svDb;
|
||||||
|
class DbDoc {
|
||||||
|
/**
|
||||||
|
* class constructor
|
||||||
|
*/
|
||||||
|
constructor() {
|
||||||
|
this.name = this.constructor['name'];
|
||||||
|
this.collection = this.constructor['dbCollection'];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* saves this instance but not any connected items
|
||||||
|
* may lead to data inconsistencies, but is faster
|
||||||
|
*/
|
||||||
|
save() {
|
||||||
|
let saveableObject = {}; // is not exposed to outside, so any is ok here
|
||||||
|
for (let propertyNameString of this.saveableProperties) {
|
||||||
|
saveableObject[propertyNameString] = this[propertyNameString];
|
||||||
|
}
|
||||||
|
switch (this.creationType) {
|
||||||
|
case 'db':
|
||||||
|
this.collection; // TODO implement collection.update()
|
||||||
|
break;
|
||||||
|
case 'new':
|
||||||
|
this.collection.insertOne(saveableObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* also store any referenced objects to DB
|
||||||
|
* better for data consistency
|
||||||
|
*/
|
||||||
|
saveDeep(savedMapArg = null) {
|
||||||
|
if (!savedMapArg) {
|
||||||
|
savedMapArg = new lik_1.Objectmap();
|
||||||
|
}
|
||||||
|
savedMapArg.add(this);
|
||||||
|
this.save();
|
||||||
|
for (let propertyKey in this) {
|
||||||
|
let property = this[propertyKey];
|
||||||
|
if (property instanceof DbDoc && !savedMapArg.checkForObject(property)) {
|
||||||
|
property.saveDeep(savedMap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DRjtBQWpFRCxzQkFpRUMifQ==
|
3
dist/smartdata.classes.dbobjectdoc.d.ts
vendored
Normal file
3
dist/smartdata.classes.dbobjectdoc.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { Db } from './smartdata.classes.db';
|
||||||
|
import { DbDoc } from './smartdata.classes.dbdoc';
|
||||||
|
export declare let getObjectDoc: (nameArg: any, dbArg: Db) => DbDoc<{}>;
|
11
dist/smartdata.classes.dbobjectdoc.js
vendored
Normal file
11
dist/smartdata.classes.dbobjectdoc.js
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const smartdata_classes_dbdoc_1 = require("./smartdata.classes.dbdoc");
|
||||||
|
const smartdata_classes_dbcollection_1 = require("./smartdata.classes.dbcollection");
|
||||||
|
exports.getObjectDoc = (nameArg, dbArg) => {
|
||||||
|
let objectDoc = new smartdata_classes_dbdoc_1.DbDoc();
|
||||||
|
objectDoc.name = nameArg;
|
||||||
|
objectDoc.collection = new smartdata_classes_dbcollection_1.DbCollection(objectDoc, dbArg);
|
||||||
|
return objectDoc;
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLmNsYXNzZXMuZGJvYmplY3Rkb2MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGRhdGEuY2xhc3Nlcy5kYm9iamVjdGRvYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUdBLHVFQUFpRDtBQUNqRCxxRkFBK0Q7QUFFcEQsUUFBQSxZQUFZLEdBQUcsQ0FBQyxPQUFPLEVBQUMsS0FBUyxFQUFFLEVBQUU7SUFDOUMsSUFBSSxTQUFTLEdBQUcsSUFBSSwrQkFBSyxFQUFFLENBQUE7SUFDM0IsU0FBUyxDQUFDLElBQUksR0FBRyxPQUFPLENBQUE7SUFDeEIsU0FBUyxDQUFDLFVBQVUsR0FBRyxJQUFJLDZDQUFZLENBQUMsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFBO0lBQ3pELE1BQU0sQ0FBQyxTQUFTLENBQUE7QUFDbEIsQ0FBQyxDQUFBIn0=
|
10
dist/smartdata.plugins.d.ts
vendored
10
dist/smartdata.plugins.d.ts
vendored
@ -1,5 +1,7 @@
|
|||||||
import 'typings-global';
|
import 'typings-global';
|
||||||
export import assert = require('assert');
|
import * as assert from 'assert';
|
||||||
export import beautylog = require('beautylog');
|
import * as beautylog from 'beautylog';
|
||||||
export import mongodb = require('mongodb');
|
import * as lodash from 'lodash';
|
||||||
export import q = require('q');
|
import * as mongodb from 'mongodb';
|
||||||
|
import * as smartq from 'smartq';
|
||||||
|
export { assert, beautylog, lodash, mongodb, smartq };
|
||||||
|
19
dist/smartdata.plugins.js
vendored
19
dist/smartdata.plugins.js
vendored
@ -1,7 +1,14 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
require('typings-global');
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.assert = require('assert');
|
require("typings-global");
|
||||||
exports.beautylog = require('beautylog');
|
const assert = require("assert");
|
||||||
exports.mongodb = require('mongodb');
|
exports.assert = assert;
|
||||||
exports.q = require('q');
|
const beautylog = require("beautylog");
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGRhdGEucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBQ1QsY0FBTSxXQUFXLFFBQVEsQ0FBQyxDQUFBO0FBQzFCLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUE7QUFDaEMsZUFBTyxXQUFXLFNBQVMsQ0FBQyxDQUFBO0FBQzVCLFNBQUMsV0FBVyxHQUFHLENBQUMsQ0FBQSJ9
|
exports.beautylog = beautylog;
|
||||||
|
const lodash = require("lodash");
|
||||||
|
exports.lodash = lodash;
|
||||||
|
const mongodb = require("mongodb");
|
||||||
|
exports.mongodb = mongodb;
|
||||||
|
const smartq = require("smartq");
|
||||||
|
exports.smartq = smartq;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGRhdGEucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2QixpQ0FBZ0M7QUFPNUIsd0JBQU07QUFOVix1Q0FBc0M7QUFPbEMsOEJBQVM7QUFOYixpQ0FBZ0M7QUFPNUIsd0JBQU07QUFOVixtQ0FBa0M7QUFPOUIsMEJBQU87QUFOWCxpQ0FBZ0M7QUFPNUIsd0JBQU0ifQ==
|
114
docs/index.md
114
docs/index.md
@ -1,19 +1,119 @@
|
|||||||
# smartdata
|
# smartdata
|
||||||
|
do more with data
|
||||||
|
|
||||||
smartdata is a ODM that adheres to TypeScript practices and uses classes to organize data.
|
## Availabililty
|
||||||
It uses MongoDB as persistent storage.
|
[](https://www.npmjs.com/package/smartdata)
|
||||||
|
[](https://GitLab.com/pushrocks/smartdata)
|
||||||
|
[](https://github.com/pushrocks/smartdata)
|
||||||
|
[](https://pushrocks.gitlab.io/smartdata/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://GitLab.com/pushrocks/smartdata/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/smartdata/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/smartdata)
|
||||||
|
[](https://david-dm.org/pushrocks/smartdata)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartdata/master/dependencies/npm)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/smartdata)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
|
smartdata is an ODM that adheres to TypeScript practices and uses classes to organize data.
|
||||||
|
It uses MongoDB or NeDb as persistent storage.
|
||||||
|
|
||||||
## Intention
|
## Intention
|
||||||
There are many ODMs out there, however when we searched for a ODM that uses TypeScript,
|
There are many ODMs out there, however when we searched for an ODM that uses TypeScript,
|
||||||
acts smart while still embracing an easy the NoSQL idea we didn't find a matching solution.
|
acts smart while still embracing the NoSQL idea we didn't find a matching solution.
|
||||||
This is why we started smartdata
|
This is why we started smartdata.
|
||||||
|
|
||||||
How MongoDB terms map to smartdata classes
|
How MongoDB terms map to smartdata classes
|
||||||
|
|
||||||
MongoDB term | smartdata class
|
MongoDB term | smartdata class
|
||||||
--- | ---
|
--- | ---
|
||||||
Database | smartdata.DbConnection
|
Database | smartdata.Db
|
||||||
Collection | smartdata.DbCollection
|
Collection | smartdata.DbCollection
|
||||||
Document | smartdata.DbDoc
|
Document | smartdata.DbDoc
|
||||||
|
|
||||||
[](https://push.rocks)
|
### class Db
|
||||||
|
represents a Database. Naturally it has .connect() etc. methods on it.
|
||||||
|
Since it is a class you can have multiple DBs defined.
|
||||||
|
```javascript
|
||||||
|
import * as smartdata from 'smartdata'
|
||||||
|
|
||||||
|
// mongodb
|
||||||
|
let myDb1 = new smartdata.Db('someConnectionUrl')
|
||||||
|
let myDb2 = new smartdata.Db('someConnectionUrl')
|
||||||
|
|
||||||
|
// nedb
|
||||||
|
let myDb3 = new smartdata('/some/path/for/persistence', 'nedb') // you may set first argument to null for just in memory db
|
||||||
|
|
||||||
|
myDb1.connect()
|
||||||
|
myDb2.connect()
|
||||||
|
|
||||||
|
// continues in next block...
|
||||||
|
```
|
||||||
|
|
||||||
|
### class DbCollection
|
||||||
|
represents a collection of objects.
|
||||||
|
A collection is defined by the object class (that is extending smartdata.dbdoc) it respresents
|
||||||
|
|
||||||
|
So to get to get access to a specific collection you document
|
||||||
|
```javascript
|
||||||
|
// continues from the block before...
|
||||||
|
|
||||||
|
@Collection(myDb1)
|
||||||
|
class MyObject extends smartdata.DbDoc<myObject> { // read the next block about DbDoc
|
||||||
|
@smartdata.svDb() property1: string // @smartdata.svDb() marks the property for db save
|
||||||
|
property2: number // this one is not marked, so it won't be save upon calling this.save()
|
||||||
|
constructor(optionsArg:{
|
||||||
|
property1: string,
|
||||||
|
property2: number
|
||||||
|
}) {
|
||||||
|
super()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let myCollection = myDb1.getCollectionByName<myObject>(myObject)
|
||||||
|
|
||||||
|
// start to instantiate instances of classes from scratch or database
|
||||||
|
|
||||||
|
let localObject = new MyObject({
|
||||||
|
property1: 'hi',
|
||||||
|
property2: 2
|
||||||
|
})
|
||||||
|
localObject.save() // saves the object to the database
|
||||||
|
```
|
||||||
|
|
||||||
|
> Alert: You NEVER instantiate a collection.
|
||||||
|
This is done for you!!!
|
||||||
|
|
||||||
|
### class DbDoc
|
||||||
|
represents a individual document in a collection
|
||||||
|
and thereby is ideally suited to extend the class you want to actually store.
|
||||||
|
|
||||||
|
DbDoc extends your class with the following methods:
|
||||||
|
|
||||||
|
* `.save()` will save (or update) the object you call it on only. Any referenced non-savable objects will not get stored.
|
||||||
|
* `.saveDeep()` does the same like `.save()`.
|
||||||
|
In addition it will look for properties that reference an object
|
||||||
|
that extends DbDoc as well and call .saveDeep() on them as well.
|
||||||
|
Loops are prevented
|
||||||
|
|
||||||
|
So now we can **store** instances of classes to Db...
|
||||||
|
How do we **get** a new class instance from a Doc in the DB?
|
||||||
|
|
||||||
|
## TypeScript
|
||||||
|
How does TypeScript play into this?
|
||||||
|
Since you define your classes in TypeScript and types flow through smartdata in a generic way
|
||||||
|
you should get all the Intellisense and type checking you love when using smartdata.
|
||||||
|
smartdata itself also bundles typings.
|
||||||
|
So you don't need to install any additional types when importing smartdata.
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this README.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
||||||
|
17
npmextra.json
Normal file
17
npmextra.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"npmdocker": {
|
||||||
|
"baseImage": "hosttoday/ht-docker-node:mongo",
|
||||||
|
"command": "npmci test stable",
|
||||||
|
"dockerSock": false
|
||||||
|
},
|
||||||
|
"npmci": {
|
||||||
|
"globalNpmTools": [
|
||||||
|
"npmts"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"npmts": {
|
||||||
|
"testConfig": {
|
||||||
|
"parallel": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
32
package.json
32
package.json
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "smartdata",
|
"name": "smartdata",
|
||||||
"version": "1.0.13",
|
"version": "1.0.28",
|
||||||
"description": "do more with data",
|
"description": "do more with data",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npm run prepareMongo && npmts)",
|
"test": "(npmts)",
|
||||||
"prepareMongo": "(rm -rf ./test/data && mkdir ./test/data/)"
|
"testLocal": "(npmdocker)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -19,19 +19,21 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/smartdata#README",
|
"homepage": "https://gitlab.com/pushrocks/smartdata#README",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/mongodb": "^2.1.32",
|
"@types/lodash": "^4.14.74",
|
||||||
"@types/q": "0.0.30",
|
"@types/mongodb": "^2.2.11",
|
||||||
"beautylog": "^5.0.23",
|
"beautylog": "^6.1.10",
|
||||||
"mongodb": "^2.2.9",
|
"lik": "^1.0.40",
|
||||||
"q": "^1.4.1",
|
"lodash": "^4.17.4",
|
||||||
"typings-global": "^1.0.14"
|
"mongodb": "^2.2.31",
|
||||||
|
"runtime-type-checks": "0.0.4",
|
||||||
|
"smartq": "^1.1.6",
|
||||||
|
"typings-global": "^1.0.20"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/shelljs": "^0.3.30",
|
"@types/shelljs": "^0.7.4",
|
||||||
"@types/should": "^8.1.29",
|
"qenv": "^1.1.7",
|
||||||
"shelljs": "^0.7.4",
|
"shelljs": "^0.7.8",
|
||||||
"should": "^11.1.0",
|
"smartstring": "^2.0.24",
|
||||||
"smartstring": "^2.0.17",
|
"tapbundle": "^1.1.1"
|
||||||
"typings-test": "^1.0.3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
53
test/test.class.ts
Normal file
53
test/test.class.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import { tap, expect } from 'tapbundle'
|
||||||
|
import * as smartq from 'smartq'
|
||||||
|
import { Qenv } from 'qenv'
|
||||||
|
|
||||||
|
let testQenv = new Qenv(process.cwd(), process.cwd() + '/.nogit/')
|
||||||
|
|
||||||
|
// the tested module
|
||||||
|
import * as smartdata from '../ts/index'
|
||||||
|
|
||||||
|
let mongoChildProcess
|
||||||
|
let testDb: smartdata.Db
|
||||||
|
|
||||||
|
tap.test('should establish a connection to mongodb', async () => {
|
||||||
|
// testDb = new smartdata.Db(`mongodb://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@sandbox-shard-00-00-uyw7y.mongodb.net:27017,sandbox-shard-00-01-uyw7y.mongodb.net:27017,sandbox-shard-00-02-uyw7y.mongodb.net:27017/${process.env.MONGO_DATABASE}?ssl=true&replicaSet=sandbox-shard-0&authSource=admin`)
|
||||||
|
testDb = new smartdata.Db(`mongodb://localhost:27017/${process.env.MONGO_DATABASE}`)
|
||||||
|
await testDb.connect()
|
||||||
|
})
|
||||||
|
|
||||||
|
let testCarInstance
|
||||||
|
|
||||||
|
tap.test('should create an extended class', async () => {
|
||||||
|
@smartdata.Collection(testDb)
|
||||||
|
class TestCar extends smartdata.DbDoc<TestCar> {
|
||||||
|
@smartdata.svDb()
|
||||||
|
color: string
|
||||||
|
constructor (optionsArg: {
|
||||||
|
color: string,
|
||||||
|
property2: number
|
||||||
|
}) {
|
||||||
|
super()
|
||||||
|
this.color = optionsArg.color
|
||||||
|
}
|
||||||
|
}
|
||||||
|
testCarInstance = new TestCar({
|
||||||
|
color: 'red',
|
||||||
|
property2: 2
|
||||||
|
})
|
||||||
|
expect(testCarInstance.name).to.equal('TestCar')
|
||||||
|
expect(testCarInstance.saveableProperties[ 0 ]).equal('color')
|
||||||
|
expect(testCarInstance.collection).be.instanceof(smartdata.DbCollection)
|
||||||
|
expect(testCarInstance).be.instanceof(smartdata.DbDoc)
|
||||||
|
if (!process.env.CI) { console.log(TestCar) }
|
||||||
|
})
|
||||||
|
|
||||||
|
tap.test('should save testCar', async () => {
|
||||||
|
await testCarInstance.save()
|
||||||
|
})
|
||||||
|
|
||||||
|
tap.test('should close the db Connection', async () => {
|
||||||
|
await testDb.close()
|
||||||
|
})
|
||||||
|
|
||||||
|
tap.start()
|
1
test/test.d.ts
vendored
1
test/test.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
import 'typings-test';
|
|
79
test/test.js
79
test/test.js
@ -1,79 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
require('typings-test');
|
|
||||||
const shelljs = require('shelljs');
|
|
||||||
const should = require('should');
|
|
||||||
const smartstring = require('smartstring');
|
|
||||||
// the tested module
|
|
||||||
const smartdata = require('../dist/index');
|
|
||||||
let mongoChildProcess;
|
|
||||||
let testDb;
|
|
||||||
let testDbCollection;
|
|
||||||
class testCar {
|
|
||||||
constructor(colorArg) {
|
|
||||||
this.color = colorArg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
describe('mongodb', function () {
|
|
||||||
it('should start mongodb', function (done) {
|
|
||||||
this.timeout(30000);
|
|
||||||
mongoChildProcess = shelljs.exec('mongod --dbpath=./test/data --port 27017', { async: true, silent: true });
|
|
||||||
let doneCalled = false;
|
|
||||||
mongoChildProcess.stdout.on('data', function (data) {
|
|
||||||
console.log(smartstring.indent.indentWithPrefix(data, "*** MongoDB Process *** : "));
|
|
||||||
if (!doneCalled) {
|
|
||||||
if (/waiting for connections on port 27017/.test(data)) {
|
|
||||||
doneCalled = true;
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
describe('smartdata', function () {
|
|
||||||
it('should establish a connection to mongodb', function (done) {
|
|
||||||
testDb = new smartdata.Db('mongodb://localhost:27017/smartdata');
|
|
||||||
testDb.connect().then(() => { done(); });
|
|
||||||
});
|
|
||||||
it('should create a collection', function () {
|
|
||||||
testDbCollection = new smartdata.DbCollection('something', testDb);
|
|
||||||
});
|
|
||||||
it('should insert a doc into the collection', function (done) {
|
|
||||||
testDbCollection.insertOne({ value1: 'test' }).then(() => { done(); });
|
|
||||||
});
|
|
||||||
it('should find all docs of testDbCollection', function (done) {
|
|
||||||
testDbCollection.find({}).then((resultArray) => {
|
|
||||||
console.log(resultArray);
|
|
||||||
should(resultArray[0].value1).equal('test');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
it('should insert many docs into the collection', function (done) {
|
|
||||||
testDbCollection.insertMany([
|
|
||||||
{ value1: 'test2' },
|
|
||||||
{ value1: 'test', value2: 3, value3: 'hi' }
|
|
||||||
]).then(() => { done(); });
|
|
||||||
});
|
|
||||||
it('should find a specified doc', function (done) {
|
|
||||||
testDbCollection.find({ 'value3': { '$exists': true } }).then((resultArray) => {
|
|
||||||
console.log(resultArray);
|
|
||||||
should(resultArray[0].value3).equal('hi');
|
|
||||||
done();
|
|
||||||
}).catch(console.log);
|
|
||||||
});
|
|
||||||
it('should close the db Connection', function () {
|
|
||||||
testDb.close();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
describe('mongodb', function () {
|
|
||||||
it('should kill mongodb', function (done) {
|
|
||||||
this.timeout(30000);
|
|
||||||
mongoChildProcess.stdout.on('data', function (data) {
|
|
||||||
if (/dbexit: rc: 0/.test(data)) {
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
shelljs.exec('mongod --dbpath=./test/data --shutdown');
|
|
||||||
mongoChildProcess.kill('SIGTERM');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FFUCxDQUFDLENBRm9CO0FBRXJCLE1BQVksT0FBTyxXQUFNLFNBQ3pCLENBQUMsQ0FEaUM7QUFDbEMsTUFBWSxNQUFNLFdBQU0sUUFDeEIsQ0FBQyxDQUQrQjtBQUNoQyxNQUFZLFdBQVcsV0FBTSxhQUc3QixDQUFDLENBSHlDO0FBRTFDLG9CQUFvQjtBQUNwQixNQUFZLFNBQVMsV0FBTSxlQUUzQixDQUFDLENBRnlDO0FBRTFDLElBQUksaUJBQWlCLENBQUE7QUFDckIsSUFBSSxNQUFvQixDQUFBO0FBUXhCLElBQUksZ0JBQXNELENBQUE7QUFFMUQ7SUFFSSxZQUFZLFFBQWU7UUFDdkIsSUFBSSxDQUFDLEtBQUssR0FBRyxRQUFRLENBQUE7SUFDekIsQ0FBQztBQUNMLENBQUM7QUFHRCxRQUFRLENBQUMsU0FBUyxFQUFFO0lBQ2hCLEVBQUUsQ0FBQyxzQkFBc0Is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BQUksRUFBRSxDQUFBO1lBQ1YsQ0FBQztRQUNMLENBQUMsQ0FBQyxDQUFBO1FBQ0YsT0FBTyxDQUFDLElBQUksQ0FBQyx3Q0FBd0MsQ0FBQyxDQUFBO1FBQ3RELGlCQUFpQixDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUNyQyxDQUFDLENBQUMsQ0FBQTtBQUNOLENBQUMsQ0FBQyxDQUFBIn0=
|
|
128
test/test.ts
128
test/test.ts
@ -1,93 +1,69 @@
|
|||||||
import 'typings-test'
|
import { tap, expect } from 'tapbundle'
|
||||||
|
import * as smartq from 'smartq'
|
||||||
|
import { Qenv } from 'qenv'
|
||||||
|
|
||||||
import * as shelljs from 'shelljs'
|
let testQenv = new Qenv(process.cwd(), process.cwd() + '/.nogit/')
|
||||||
import * as should from 'should'
|
|
||||||
import * as smartstring from 'smartstring'
|
|
||||||
|
|
||||||
// the tested module
|
// the tested module
|
||||||
import * as smartdata from '../dist/index'
|
import * as smartdata from '../ts/index'
|
||||||
|
|
||||||
let mongoChildProcess
|
let mongoChildProcess
|
||||||
let testDb: smartdata.Db
|
let testDb: smartdata.Db
|
||||||
|
|
||||||
interface ITestObject1 {
|
interface ITestObject1 {
|
||||||
value1: string
|
value1: string
|
||||||
value2?: number
|
value2?: number
|
||||||
value3?: string
|
value3?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tap.test('should establish a connection to mongodb', async () => {
|
||||||
|
// testDb = new smartdata.Db(`mongodb://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@sandbox-shard-00-00-uyw7y.mongodb.net:27017,sandbox-shard-00-01-uyw7y.mongodb.net:27017,sandbox-shard-00-02-uyw7y.mongodb.net:27017/${process.env.MONGO_DATABASE}?ssl=true&replicaSet=sandbox-shard-0&authSource=admin`)
|
||||||
|
testDb = new smartdata.Db(`mongodb://localhost:27017/${process.env.MONGO_DATABASE}`)
|
||||||
|
await testDb.connect()
|
||||||
|
})
|
||||||
|
|
||||||
|
// =======================================
|
||||||
|
// The actual tests
|
||||||
|
// =======================================
|
||||||
|
|
||||||
|
// ------
|
||||||
|
// Collections
|
||||||
|
// ------
|
||||||
let testDbCollection: smartdata.DbCollection<ITestObject1>
|
let testDbCollection: smartdata.DbCollection<ITestObject1>
|
||||||
|
|
||||||
class testCar {
|
tap.test('should give me a collection', async () => {
|
||||||
color: string
|
testDbCollection = await testDb.getObjectCollectionByName<ITestObject1>('TestValue', testDb, true)
|
||||||
constructor(colorArg:string) {
|
|
||||||
this.color = colorArg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
describe('mongodb', function () {
|
|
||||||
it('should start mongodb', function (done) {
|
|
||||||
this.timeout(30000)
|
|
||||||
mongoChildProcess = shelljs.exec('mongod --dbpath=./test/data --port 27017', { async: true, silent: true })
|
|
||||||
let doneCalled = false
|
|
||||||
mongoChildProcess.stdout.on('data', function (data) {
|
|
||||||
console.log(smartstring.indent.indentWithPrefix(data, "*** MongoDB Process *** : "))
|
|
||||||
if (!doneCalled) {
|
|
||||||
if (/waiting for connections on port 27017/.test(data)) {
|
|
||||||
doneCalled = true
|
|
||||||
done()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('smartdata', function () {
|
tap.test('should insert a doc into the collection', async () => {
|
||||||
it('should establish a connection to mongodb', function (done) {
|
await testDbCollection.insertOne({ value1: 'test' })
|
||||||
testDb = new smartdata.Db('mongodb://localhost:27017/smartdata')
|
|
||||||
testDb.connect().then(() => { done() })
|
|
||||||
})
|
|
||||||
it('should create a collection', function () {
|
|
||||||
testDbCollection = new smartdata.DbCollection<ITestObject1>('something', testDb)
|
|
||||||
})
|
|
||||||
it('should insert a doc into the collection', function (done) {
|
|
||||||
testDbCollection.insertOne({ value1: 'test' }).then(() => { done() })
|
|
||||||
})
|
|
||||||
it('should find all docs of testDbCollection', function (done) {
|
|
||||||
testDbCollection.find({}).then((resultArray) => {
|
|
||||||
console.log(resultArray)
|
|
||||||
should(resultArray[0].value1).equal('test')
|
|
||||||
done()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
it('should insert many docs into the collection', function (done) {
|
|
||||||
testDbCollection.insertMany([
|
|
||||||
{ value1: 'test2' },
|
|
||||||
{ value1: 'test', value2: 3, value3: 'hi' }
|
|
||||||
]).then(() => { done() })
|
|
||||||
})
|
|
||||||
it('should find a specified doc', function (done) {
|
|
||||||
testDbCollection.find({'value3': {'$exists': true}}).then((resultArray) => {
|
|
||||||
console.log(resultArray)
|
|
||||||
should(resultArray[0].value3).equal('hi')
|
|
||||||
done()
|
|
||||||
}).catch(console.log)
|
|
||||||
})
|
|
||||||
it('should close the db Connection', function () {
|
|
||||||
testDb.close()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('mongodb', function () {
|
tap.test('should find all docs of testDbCollection', async () => {
|
||||||
it('should kill mongodb', function (done) {
|
await testDbCollection.find({}).then(async (resultArray) => {
|
||||||
this.timeout(30000)
|
console.log(resultArray)
|
||||||
mongoChildProcess.stdout.on('data', function (data) {
|
expect(resultArray[ 0 ].value1).equal('test')
|
||||||
if (/dbexit: rc: 0/.test(data)) {
|
})
|
||||||
done()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
shelljs.exec('mongod --dbpath=./test/data --shutdown')
|
|
||||||
mongoChildProcess.kill('SIGTERM')
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
tap.test('should insert many docs into the collection', async () => {
|
||||||
|
await testDbCollection.insertMany([
|
||||||
|
{ value1: 'test2' },
|
||||||
|
{ value1: 'test', value2: 3, value3: 'hi' }
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
|
tap.test('should find a specified doc', async () => {
|
||||||
|
await testDbCollection.find({ 'value3': { '$exists': true } }).then((resultArray) => {
|
||||||
|
console.log(resultArray)
|
||||||
|
expect(resultArray[ 0 ].value3).equal('hi')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tap.test('should close the db Connection', async () => {
|
||||||
|
await testDb.close()
|
||||||
|
})
|
||||||
|
|
||||||
|
tap.start()
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import * as plugins from './smartdata.plugins'
|
|
||||||
|
|
||||||
export * from './smartdata.classes.dbcollection'
|
|
||||||
export * from './smartdata.classes.db'
|
export * from './smartdata.classes.db'
|
||||||
|
export * from './smartdata.classes.dbcollection'
|
||||||
|
export * from './smartdata.classes.dbdoc'
|
||||||
|
@ -1,33 +1,82 @@
|
|||||||
import * as plugins from './smartdata.plugins'
|
import * as plugins from './smartdata.plugins'
|
||||||
|
import { Objectmap } from 'lik'
|
||||||
|
|
||||||
|
import { DbCollection } from './smartdata.classes.dbcollection'
|
||||||
|
import { getObjectDoc } from './smartdata.classes.dbobjectdoc'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* interface - indicates the connection status of the db
|
||||||
|
*/
|
||||||
export type TConnectionStatus = 'disconnected' | 'connected' | 'failed'
|
export type TConnectionStatus = 'disconnected' | 'connected' | 'failed'
|
||||||
|
|
||||||
export class Db {
|
export class Db {
|
||||||
dbUrl: string
|
dbUrl: string
|
||||||
db: plugins.mongodb.Db
|
db: plugins.mongodb.Db
|
||||||
status: TConnectionStatus
|
status: TConnectionStatus
|
||||||
|
classCollections = new Objectmap<DbCollection<any>>()
|
||||||
|
objectCollections = new Objectmap<DbCollection<any>>()
|
||||||
|
|
||||||
constructor(dbUrl: string) {
|
constructor (dbUrlArg: string) {
|
||||||
this.dbUrl = dbUrl
|
this.dbUrl = dbUrlArg
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(): plugins.q.Promise<any> {
|
// basic connection stuff ----------------------------------------------
|
||||||
let done = plugins.q.defer()
|
|
||||||
plugins.mongodb.MongoClient.connect(this.dbUrl, (err, db) => {
|
|
||||||
if (err) { console.log(err) }
|
|
||||||
plugins.assert.equal(null, err)
|
|
||||||
this.db = db
|
|
||||||
plugins.beautylog.success(`connected to database at ${this.dbUrl}`)
|
|
||||||
done.resolve(this.db)
|
|
||||||
})
|
|
||||||
return done.promise
|
|
||||||
}
|
|
||||||
|
|
||||||
close(): plugins.q.Promise<any> {
|
/**
|
||||||
let done = plugins.q.defer()
|
* connects to the database that was specified during instance creation
|
||||||
this.db.close()
|
*/
|
||||||
plugins.beautylog.ok(`disconnected to database at ${this.dbUrl}`)
|
connect (): Promise<any> {
|
||||||
done.resolve()
|
let done = plugins.smartq.defer()
|
||||||
return done.promise
|
plugins.mongodb.MongoClient.connect(this.dbUrl, (err, db) => {
|
||||||
|
if (err) { console.log(err) }
|
||||||
|
plugins.assert.equal(null, err)
|
||||||
|
this.db = db
|
||||||
|
plugins.beautylog.success(`connected to database at ${this.dbUrl}`)
|
||||||
|
done.resolve(this.db)
|
||||||
|
})
|
||||||
|
return done.promise
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* closes the connection to the databse
|
||||||
|
*/
|
||||||
|
close (): Promise<any> {
|
||||||
|
let done = plugins.smartq.defer()
|
||||||
|
this.db.close()
|
||||||
|
plugins.beautylog.ok(`disconnected to database at ${this.dbUrl}`)
|
||||||
|
done.resolve()
|
||||||
|
return done.promise
|
||||||
|
}
|
||||||
|
|
||||||
|
// advanced communication with the database --------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets a class based collection by name: string
|
||||||
|
*/
|
||||||
|
async getClassCollectionByName<T> (nameArg: string): Promise<DbCollection<T>> {
|
||||||
|
let resultCollection = this.classCollections.find((dbCollectionArg) => {
|
||||||
|
return dbCollectionArg.name === nameArg
|
||||||
|
})
|
||||||
|
return resultCollection
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets an object collection by name
|
||||||
|
*/
|
||||||
|
async getObjectCollectionByName<T> (nameArg: string, dbArg: Db , makeNewArg: boolean = false): Promise<DbCollection<T>> {
|
||||||
|
let resultCollection = this.objectCollections.find((dbCollectionArg) => {
|
||||||
|
return dbCollectionArg.name === nameArg
|
||||||
|
})
|
||||||
|
if (!resultCollection && makeNewArg) {
|
||||||
|
resultCollection = getObjectDoc(nameArg, this).collection
|
||||||
|
return resultCollection
|
||||||
|
} else {
|
||||||
|
return resultCollection
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addCollection (dbCollectionArg: DbCollection<any>) {
|
||||||
|
this.classCollections.add(dbCollectionArg)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,60 +1,117 @@
|
|||||||
import * as plugins from './smartdata.plugins'
|
import * as plugins from './smartdata.plugins'
|
||||||
import { Db } from './smartdata.classes.db'
|
import { Db } from './smartdata.classes.db'
|
||||||
|
import { DbDoc } from './smartdata.classes.dbdoc'
|
||||||
|
|
||||||
|
export interface IFindOptions {
|
||||||
|
limit?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDocValidation<T> {
|
||||||
|
(doc: T): boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Collection (db: Db) {
|
||||||
|
return function (constructor) {
|
||||||
|
constructor[ 'dbCollection' ] = new DbCollection(constructor, db)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class DbCollection<T> {
|
export class DbCollection<T> {
|
||||||
collection: plugins.mongodb.Collection
|
/**
|
||||||
constructor(nameArg: string, dbArg: Db) {
|
* the collection that is used, defaults to mongodb collection,
|
||||||
this.collection = dbArg.db.collection(nameArg)
|
* can be nedb datastore (sub api of mongodb)
|
||||||
}
|
*/
|
||||||
|
collection: plugins.mongodb.Collection
|
||||||
|
collectedClass: T & DbDoc<T>
|
||||||
|
objectValidation: IDocValidation<T> = null
|
||||||
|
name: string
|
||||||
|
db: Db
|
||||||
|
|
||||||
/**
|
constructor (collectedClassArg: T & DbDoc<T>, dbArg: Db) {
|
||||||
* adds a validation function that all newly inserted and updated objects have to pass
|
// tell the collection where it belongs
|
||||||
*/
|
this.collectedClass = collectedClassArg
|
||||||
addObjectValidation(funcArg) { }
|
this.name = collectedClassArg.name
|
||||||
|
this.db = dbArg
|
||||||
|
|
||||||
/**
|
// make sure it actually exists
|
||||||
* finds an object in the DbCollection
|
this.collection = dbArg.db.collection(this.name)
|
||||||
*/
|
|
||||||
find(docMatchArg: T | any): plugins.q.Promise<T[]> {
|
|
||||||
let done = plugins.q.defer<T[]>()
|
|
||||||
this.collection.find(docMatchArg).toArray((err, docs) => {
|
|
||||||
if (err) { throw err }
|
|
||||||
done.resolve(docs)
|
|
||||||
})
|
|
||||||
return done.promise
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// tell the db class about it (important since Db uses different systems under the hood)
|
||||||
* inserts object into the DbCollection
|
this.db.addCollection(this)
|
||||||
*/
|
}
|
||||||
insertOne(docArg: T): plugins.q.Promise<void> {
|
|
||||||
let done = plugins.q.defer<void>()
|
|
||||||
this.checkDoc(docArg).then(() => {
|
|
||||||
this.collection.insertOne(docArg)
|
|
||||||
.then(() => { done.resolve() })
|
|
||||||
})
|
|
||||||
return done.promise
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* inserts many objects at once into the DbCollection
|
* adds a validation function that all newly inserted and updated objects have to pass
|
||||||
*/
|
*/
|
||||||
insertMany(docArrayArg: T[]): plugins.q.Promise<void> {
|
addDocValidation (funcArg: IDocValidation<T>) {
|
||||||
let done = plugins.q.defer<void>()
|
this.objectValidation = funcArg
|
||||||
let checkDocPromiseArray: plugins.q.Promise<void>[] = []
|
}
|
||||||
for (let docArg of docArrayArg){
|
|
||||||
checkDocPromiseArray.push(this.checkDoc(docArg))
|
|
||||||
}
|
|
||||||
plugins.q.all(checkDocPromiseArray).then(() => {
|
|
||||||
this.collection.insertMany(docArrayArg)
|
|
||||||
.then(() => { done.resolve() })
|
|
||||||
})
|
|
||||||
return done.promise
|
|
||||||
}
|
|
||||||
|
|
||||||
private checkDoc(doc: T): plugins.q.Promise<void> {
|
/**
|
||||||
let done = plugins.q.defer<void>()
|
* finds an object in the DbCollection
|
||||||
done.resolve()
|
*/
|
||||||
return done.promise
|
find (docMatchArg: T | any, optionsArg?: IFindOptions): Promise<T[]> {
|
||||||
|
let done = plugins.smartq.defer<T[]>()
|
||||||
|
let findCursor = this.collection.find(docMatchArg)
|
||||||
|
if (optionsArg) {
|
||||||
|
if (optionsArg.limit) { findCursor = findCursor.limit(1) }
|
||||||
}
|
}
|
||||||
|
findCursor.toArray((err, docs) => {
|
||||||
|
if (err) {
|
||||||
|
done.reject(err)
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
done.resolve(docs)
|
||||||
|
})
|
||||||
|
return done.promise
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* inserts object into the DbCollection
|
||||||
|
*/
|
||||||
|
insertOne (docArg: T): Promise<void> {
|
||||||
|
let done = plugins.smartq.defer<void>()
|
||||||
|
this.checkDoc(docArg).then(
|
||||||
|
() => {
|
||||||
|
this.collection.insertOne(docArg)
|
||||||
|
.then(() => { done.resolve() })
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
done.reject(new Error('one the docs did not pass validation'))
|
||||||
|
})
|
||||||
|
return done.promise
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* inserts many objects at once into the DbCollection
|
||||||
|
*/
|
||||||
|
insertMany (docArrayArg: T[]): Promise<void> {
|
||||||
|
let done = plugins.smartq.defer<void>()
|
||||||
|
let checkDocPromiseArray: Promise<void>[] = []
|
||||||
|
for (let docArg of docArrayArg) {
|
||||||
|
checkDocPromiseArray.push(this.checkDoc(docArg))
|
||||||
|
}
|
||||||
|
Promise.all(checkDocPromiseArray).then(() => {
|
||||||
|
this.collection.insertMany(docArrayArg)
|
||||||
|
.then(() => { done.resolve() })
|
||||||
|
})
|
||||||
|
return done.promise
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks a Doc for constraints
|
||||||
|
*/
|
||||||
|
private checkDoc (docArg: T): Promise<void> {
|
||||||
|
let done = plugins.smartq.defer<void>()
|
||||||
|
let validationResult = true
|
||||||
|
if (this.objectValidation) {
|
||||||
|
validationResult = this.objectValidation(docArg)
|
||||||
|
}
|
||||||
|
if (validationResult) {
|
||||||
|
done.resolve()
|
||||||
|
} else {
|
||||||
|
done.reject('validation of object did not pass')
|
||||||
|
}
|
||||||
|
return done.promise
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,86 @@
|
|||||||
|
import * as plugins from './smartdata.plugins'
|
||||||
|
|
||||||
|
import { Objectmap } from 'lik'
|
||||||
|
|
||||||
|
import { Db } from './smartdata.classes.db'
|
||||||
|
import { DbCollection } from './smartdata.classes.dbcollection'
|
||||||
|
|
||||||
|
export type TDocCreation = 'db' | 'new' | 'mixed'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* saveable - saveable decorator to be used on class properties
|
||||||
|
*/
|
||||||
|
export function svDb() {
|
||||||
|
return (target: DbDoc<any>, key: string) => {
|
||||||
|
console.log('called sva')
|
||||||
|
if (!target.saveableProperties) { target.saveableProperties = [] }
|
||||||
|
target.saveableProperties.push(key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DbDoc<T> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the collection object an Doc belongs to
|
||||||
|
*/
|
||||||
|
collection: DbCollection<T>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* how the Doc in memory was created, may prove useful later.
|
||||||
|
*/
|
||||||
|
creationType: TDocCreation
|
||||||
|
|
||||||
|
/**
|
||||||
|
* an array of saveable properties of a doc
|
||||||
|
*/
|
||||||
|
saveableProperties: string[]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* name
|
||||||
|
*/
|
||||||
|
name: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class constructor
|
||||||
|
*/
|
||||||
|
constructor () {
|
||||||
|
this.name = this.constructor['name']
|
||||||
|
this.collection = this.constructor[ 'dbCollection' ]
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* saves this instance but not any connected items
|
||||||
|
* may lead to data inconsistencies, but is faster
|
||||||
|
*/
|
||||||
|
save () {
|
||||||
|
let saveableObject: any = {} // is not exposed to outside, so any is ok here
|
||||||
|
for (let propertyNameString of this.saveableProperties) {
|
||||||
|
saveableObject[ propertyNameString ] = this[ propertyNameString ]
|
||||||
|
}
|
||||||
|
switch (this.creationType) {
|
||||||
|
case 'db':
|
||||||
|
this.collection // TODO implement collection.update()
|
||||||
|
break
|
||||||
|
case 'new':
|
||||||
|
this.collection.insertOne(saveableObject)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* also store any referenced objects to DB
|
||||||
|
* better for data consistency
|
||||||
|
*/
|
||||||
|
saveDeep (savedMapArg: Objectmap<DbDoc<any>> = null) {
|
||||||
|
if (!savedMapArg) {
|
||||||
|
savedMapArg = new Objectmap<DbDoc<any>>()
|
||||||
|
}
|
||||||
|
savedMapArg.add(this)
|
||||||
|
this.save()
|
||||||
|
for (let propertyKey in this) {
|
||||||
|
let property: any = this[ propertyKey ]
|
||||||
|
if (property instanceof DbDoc && !savedMapArg.checkForObject(property)) {
|
||||||
|
property.saveDeep(savedMapArg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
12
ts/smartdata.classes.dbobjectdoc.ts
Normal file
12
ts/smartdata.classes.dbobjectdoc.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import * as plugins from './smartdata.plugins'
|
||||||
|
|
||||||
|
import { Db } from './smartdata.classes.db'
|
||||||
|
import { DbDoc } from './smartdata.classes.dbdoc'
|
||||||
|
import { DbCollection } from './smartdata.classes.dbcollection'
|
||||||
|
|
||||||
|
export let getObjectDoc = (nameArg,dbArg: Db) => {
|
||||||
|
let objectDoc = new DbDoc()
|
||||||
|
objectDoc.name = nameArg
|
||||||
|
objectDoc.collection = new DbCollection(objectDoc, dbArg)
|
||||||
|
return objectDoc
|
||||||
|
}
|
@ -1,5 +1,14 @@
|
|||||||
import 'typings-global'
|
import 'typings-global'
|
||||||
export import assert = require('assert')
|
import * as assert from 'assert'
|
||||||
export import beautylog = require('beautylog')
|
import * as beautylog from 'beautylog'
|
||||||
export import mongodb = require('mongodb')
|
import * as lodash from 'lodash'
|
||||||
export import q = require('q')
|
import * as mongodb from 'mongodb'
|
||||||
|
import * as smartq from 'smartq'
|
||||||
|
|
||||||
|
export {
|
||||||
|
assert,
|
||||||
|
beautylog,
|
||||||
|
lodash,
|
||||||
|
mongodb,
|
||||||
|
smartq
|
||||||
|
}
|
||||||
|
8
tsconfig.json
Normal file
8
tsconfig.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"lib": [
|
||||||
|
"es2015"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
838
yarn.lock
Normal file
838
yarn.lock
Normal file
@ -0,0 +1,838 @@
|
|||||||
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||||
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
|
"@types/bson@*":
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/bson/-/bson-1.0.4.tgz#94260b6b96fa459346959c9216799d8919e95d2b"
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/code@^4.0.3":
|
||||||
|
version "4.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/code/-/code-4.0.3.tgz#9c4de39f86eb3eba070146d2dab7dbc3f8eac35f"
|
||||||
|
|
||||||
|
"@types/fs-extra@4.x.x":
|
||||||
|
version "4.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.5.tgz#8aa6033c0e87c653b09a6711686916864b48ec9e"
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/glob@*":
|
||||||
|
version "5.0.33"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.33.tgz#3dff7c6ce09d65abe919c7961dc3dee016f36ad7"
|
||||||
|
dependencies:
|
||||||
|
"@types/minimatch" "*"
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/lodash@^4.14.55", "@types/lodash@^4.14.74":
|
||||||
|
version "4.14.85"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.85.tgz#a16fbf942422f6eca5622b6910492c496c35069b"
|
||||||
|
|
||||||
|
"@types/minimatch@*", "@types/minimatch@3.x.x":
|
||||||
|
version "3.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.1.tgz#b683eb60be358304ef146f5775db4c0e3696a550"
|
||||||
|
|
||||||
|
"@types/mongodb@^2.2.11":
|
||||||
|
version "2.2.15"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/mongodb/-/mongodb-2.2.15.tgz#42577d8a92b9840dad440acf92fea6435c1fcfb3"
|
||||||
|
dependencies:
|
||||||
|
"@types/bson" "*"
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/node@*", "@types/node@^8.0.33":
|
||||||
|
version "8.0.53"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.53.tgz#396b35af826fa66aad472c8cb7b8d5e277f4e6d8"
|
||||||
|
|
||||||
|
"@types/shelljs@^0.7.4":
|
||||||
|
version "0.7.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.6.tgz#4ac7ca01c191ba65b8e2bf50543c5560084d8d27"
|
||||||
|
dependencies:
|
||||||
|
"@types/glob" "*"
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/vinyl@^2.0.1":
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/vinyl/-/vinyl-2.0.1.tgz#6b414dfdcd4a785e8e76e87565ed29e79490d9b7"
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/which@^1.0.28":
|
||||||
|
version "1.0.28"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
|
||||||
|
|
||||||
|
ansi-256-colors@^1.1.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/ansi-256-colors/-/ansi-256-colors-1.1.0.tgz#910de50efcc7c09e3d82f2f87abd6b700c18818a"
|
||||||
|
|
||||||
|
ansi-regex@^2.0.0:
|
||||||
|
version "2.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||||
|
|
||||||
|
ansi-styles@^2.2.1:
|
||||||
|
version "2.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||||
|
|
||||||
|
argparse@^1.0.7:
|
||||||
|
version "1.0.9"
|
||||||
|
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
|
||||||
|
dependencies:
|
||||||
|
sprintf-js "~1.0.2"
|
||||||
|
|
||||||
|
balanced-match@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||||
|
|
||||||
|
beautycolor@^1.0.7:
|
||||||
|
version "1.0.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/beautycolor/-/beautycolor-1.0.11.tgz#71c5568d5a7ed5c144d3a54f753ad1b08862aea5"
|
||||||
|
dependencies:
|
||||||
|
ansi-256-colors "^1.1.0"
|
||||||
|
typings-global "^1.0.14"
|
||||||
|
|
||||||
|
beautylog@^6.1.10:
|
||||||
|
version "6.1.10"
|
||||||
|
resolved "https://registry.yarnpkg.com/beautylog/-/beautylog-6.1.10.tgz#9c27e566937684cb689f9372d98cfa5415d50b72"
|
||||||
|
dependencies:
|
||||||
|
"@types/lodash" "^4.14.55"
|
||||||
|
beautycolor "^1.0.7"
|
||||||
|
figlet "^1.2.0"
|
||||||
|
lodash "^4.17.4"
|
||||||
|
ora "^1.1.0"
|
||||||
|
smartenv "^2.0.0"
|
||||||
|
smartq "^1.1.1"
|
||||||
|
typings-global "^1.0.14"
|
||||||
|
|
||||||
|
bindings@^1.2.1:
|
||||||
|
version "1.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"
|
||||||
|
|
||||||
|
brace-expansion@^1.1.7:
|
||||||
|
version "1.1.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
|
||||||
|
dependencies:
|
||||||
|
balanced-match "^1.0.0"
|
||||||
|
concat-map "0.0.1"
|
||||||
|
|
||||||
|
bson@~1.0.4:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/bson/-/bson-1.0.4.tgz#93c10d39eaa5b58415cbc4052f3e53e562b0b72c"
|
||||||
|
|
||||||
|
buffer-shims@~1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
|
||||||
|
|
||||||
|
chalk@^1.0.0, chalk@^1.1.1:
|
||||||
|
version "1.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
||||||
|
dependencies:
|
||||||
|
ansi-styles "^2.2.1"
|
||||||
|
escape-string-regexp "^1.0.2"
|
||||||
|
has-ansi "^2.0.0"
|
||||||
|
strip-ansi "^3.0.0"
|
||||||
|
supports-color "^2.0.0"
|
||||||
|
|
||||||
|
cli-cursor@^2.1.0:
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5"
|
||||||
|
dependencies:
|
||||||
|
restore-cursor "^2.0.0"
|
||||||
|
|
||||||
|
cli-spinners@^1.0.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.1.0.tgz#f1847b168844d917a671eb9d147e3df497c90d06"
|
||||||
|
|
||||||
|
clone-buffer@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58"
|
||||||
|
|
||||||
|
clone-stats@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680"
|
||||||
|
|
||||||
|
clone@^2.1.1:
|
||||||
|
version "2.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb"
|
||||||
|
|
||||||
|
cloneable-readable@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.0.0.tgz#a6290d413f217a61232f95e458ff38418cfb0117"
|
||||||
|
dependencies:
|
||||||
|
inherits "^2.0.1"
|
||||||
|
process-nextick-args "^1.0.6"
|
||||||
|
through2 "^2.0.1"
|
||||||
|
|
||||||
|
code@^5.1.0:
|
||||||
|
version "5.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/code/-/code-5.1.2.tgz#e3310c2078ca7dc0b49b9c39a8b0a7b06bd75efe"
|
||||||
|
dependencies:
|
||||||
|
hoek "5.x.x"
|
||||||
|
|
||||||
|
concat-map@0.0.1:
|
||||||
|
version "0.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||||
|
|
||||||
|
core-util-is@~1.0.0:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||||
|
|
||||||
|
crypto-random-string@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e"
|
||||||
|
|
||||||
|
define-properties@^1.1.2:
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
|
||||||
|
dependencies:
|
||||||
|
foreach "^2.0.5"
|
||||||
|
object-keys "^1.0.8"
|
||||||
|
|
||||||
|
early@^2.1.1:
|
||||||
|
version "2.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/early/-/early-2.1.1.tgz#841e23254ea5dc54d8afaeee82f5ab65c00ee23c"
|
||||||
|
dependencies:
|
||||||
|
beautycolor "^1.0.7"
|
||||||
|
smartq "^1.1.1"
|
||||||
|
typings-global "^1.0.16"
|
||||||
|
|
||||||
|
es-abstract@^1.5.1:
|
||||||
|
version "1.9.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.9.0.tgz#690829a07cae36b222e7fd9b75c0d0573eb25227"
|
||||||
|
dependencies:
|
||||||
|
es-to-primitive "^1.1.1"
|
||||||
|
function-bind "^1.1.1"
|
||||||
|
has "^1.0.1"
|
||||||
|
is-callable "^1.1.3"
|
||||||
|
is-regex "^1.0.4"
|
||||||
|
|
||||||
|
es-to-primitive@^1.1.1:
|
||||||
|
version "1.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
|
||||||
|
dependencies:
|
||||||
|
is-callable "^1.1.1"
|
||||||
|
is-date-object "^1.0.1"
|
||||||
|
is-symbol "^1.0.1"
|
||||||
|
|
||||||
|
es6-error@^4.0.2:
|
||||||
|
version "4.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98"
|
||||||
|
|
||||||
|
es6-promise@3.2.1:
|
||||||
|
version "3.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.2.1.tgz#ec56233868032909207170c39448e24449dd1fc4"
|
||||||
|
|
||||||
|
escape-string-regexp@^1.0.2:
|
||||||
|
version "1.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||||
|
|
||||||
|
esprima@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
|
||||||
|
|
||||||
|
figlet@^1.2.0:
|
||||||
|
version "1.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410"
|
||||||
|
|
||||||
|
first-chunk-stream@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70"
|
||||||
|
dependencies:
|
||||||
|
readable-stream "^2.0.2"
|
||||||
|
|
||||||
|
foreach@^2.0.5:
|
||||||
|
version "2.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
|
||||||
|
|
||||||
|
fs-extra@^4.0.2:
|
||||||
|
version "4.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.2.tgz#f91704c53d1b461f893452b0c307d9997647ab6b"
|
||||||
|
dependencies:
|
||||||
|
graceful-fs "^4.1.2"
|
||||||
|
jsonfile "^4.0.0"
|
||||||
|
universalify "^0.1.0"
|
||||||
|
|
||||||
|
fs.realpath@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||||
|
|
||||||
|
function-bind@^1.0.2, function-bind@^1.1.1:
|
||||||
|
version "1.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
||||||
|
|
||||||
|
glob@^7.0.0, glob@^7.1.2:
|
||||||
|
version "7.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||||
|
dependencies:
|
||||||
|
fs.realpath "^1.0.0"
|
||||||
|
inflight "^1.0.4"
|
||||||
|
inherits "2"
|
||||||
|
minimatch "^3.0.4"
|
||||||
|
once "^1.3.0"
|
||||||
|
path-is-absolute "^1.0.0"
|
||||||
|
|
||||||
|
graceful-fs@^4.1.2, graceful-fs@^4.1.6:
|
||||||
|
version "4.1.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
||||||
|
|
||||||
|
has-ansi@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||||
|
dependencies:
|
||||||
|
ansi-regex "^2.0.0"
|
||||||
|
|
||||||
|
has@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28"
|
||||||
|
dependencies:
|
||||||
|
function-bind "^1.0.2"
|
||||||
|
|
||||||
|
hoek@5.x.x:
|
||||||
|
version "5.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.2.tgz#d2f2c95d36fe7189cf8aa8c237abc1950eca1378"
|
||||||
|
|
||||||
|
home@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/home/-/home-1.0.1.tgz#96a423ceb49b98378ff5ef3ceae059a557f9dd35"
|
||||||
|
dependencies:
|
||||||
|
os-homedir "^1.0.1"
|
||||||
|
|
||||||
|
inflight@^1.0.4:
|
||||||
|
version "1.0.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||||
|
dependencies:
|
||||||
|
once "^1.3.0"
|
||||||
|
wrappy "1"
|
||||||
|
|
||||||
|
inherits@2, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3:
|
||||||
|
version "2.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||||
|
|
||||||
|
interpret@^1.0.0:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.4.tgz#820cdd588b868ffb191a809506d6c9c8f212b1b0"
|
||||||
|
|
||||||
|
is-buffer@^1.1.5:
|
||||||
|
version "1.1.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||||
|
|
||||||
|
is-callable@^1.1.1, is-callable@^1.1.3:
|
||||||
|
version "1.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
|
||||||
|
|
||||||
|
is-date-object@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
|
||||||
|
|
||||||
|
is-number@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
|
||||||
|
dependencies:
|
||||||
|
kind-of "^3.0.2"
|
||||||
|
|
||||||
|
is-regex@^1.0.4:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491"
|
||||||
|
dependencies:
|
||||||
|
has "^1.0.1"
|
||||||
|
|
||||||
|
is-symbol@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
|
||||||
|
|
||||||
|
is-utf8@^0.2.0, is-utf8@^0.2.1:
|
||||||
|
version "0.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
|
||||||
|
|
||||||
|
isarray@~1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||||
|
|
||||||
|
isexe@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||||
|
|
||||||
|
js-base64@^2.3.2:
|
||||||
|
version "2.3.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.3.2.tgz#a79a923666372b580f8e27f51845c6f7e8fbfbaf"
|
||||||
|
|
||||||
|
js-yaml@^3.10.0:
|
||||||
|
version "3.10.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
|
||||||
|
dependencies:
|
||||||
|
argparse "^1.0.7"
|
||||||
|
esprima "^4.0.0"
|
||||||
|
|
||||||
|
jsonfile@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
|
||||||
|
optionalDependencies:
|
||||||
|
graceful-fs "^4.1.6"
|
||||||
|
|
||||||
|
kind-of@^3.0.2:
|
||||||
|
version "3.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
|
||||||
|
dependencies:
|
||||||
|
is-buffer "^1.1.5"
|
||||||
|
|
||||||
|
kind-of@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
|
||||||
|
dependencies:
|
||||||
|
is-buffer "^1.1.5"
|
||||||
|
|
||||||
|
leakage@^0.3.0:
|
||||||
|
version "0.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
|
||||||
|
dependencies:
|
||||||
|
es6-error "^4.0.2"
|
||||||
|
left-pad "^1.1.3"
|
||||||
|
memwatch-next "^0.3.0"
|
||||||
|
minimist "^1.2.0"
|
||||||
|
pretty-bytes "^4.0.2"
|
||||||
|
|
||||||
|
left-pad@^1.1.3:
|
||||||
|
version "1.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.3.tgz#612f61c033f3a9e08e939f1caebeea41b6f3199a"
|
||||||
|
|
||||||
|
lik@^1.0.40:
|
||||||
|
version "1.0.43"
|
||||||
|
resolved "https://registry.yarnpkg.com/lik/-/lik-1.0.43.tgz#e81709290fb85ff61dabfa008791ba9ffed0c666"
|
||||||
|
dependencies:
|
||||||
|
"@types/lodash" "^4.14.74"
|
||||||
|
"@types/minimatch" "3.x.x"
|
||||||
|
lodash "^4.17.4"
|
||||||
|
minimatch "^3.0.4"
|
||||||
|
rxjs "^5.4.3"
|
||||||
|
smartq "^1.1.6"
|
||||||
|
typings-global "^1.0.20"
|
||||||
|
|
||||||
|
lodash@^4.17.4:
|
||||||
|
version "4.17.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||||
|
|
||||||
|
log-symbols@^1.0.2:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18"
|
||||||
|
dependencies:
|
||||||
|
chalk "^1.0.0"
|
||||||
|
|
||||||
|
memwatch-next@^0.3.0:
|
||||||
|
version "0.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/memwatch-next/-/memwatch-next-0.3.0.tgz#2111050f9a906e0aa2d72a4ec0f0089c78726f8f"
|
||||||
|
dependencies:
|
||||||
|
bindings "^1.2.1"
|
||||||
|
nan "^2.3.2"
|
||||||
|
|
||||||
|
mimic-fn@^1.0.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18"
|
||||||
|
|
||||||
|
minimatch@^3.0.4:
|
||||||
|
version "3.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||||
|
dependencies:
|
||||||
|
brace-expansion "^1.1.7"
|
||||||
|
|
||||||
|
minimist@^1.2.0:
|
||||||
|
version "1.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
||||||
|
|
||||||
|
mongodb-core@2.1.17:
|
||||||
|
version "2.1.17"
|
||||||
|
resolved "https://registry.yarnpkg.com/mongodb-core/-/mongodb-core-2.1.17.tgz#a418b337a14a14990fb510b923dee6a813173df8"
|
||||||
|
dependencies:
|
||||||
|
bson "~1.0.4"
|
||||||
|
require_optional "~1.0.0"
|
||||||
|
|
||||||
|
mongodb@^2.2.31:
|
||||||
|
version "2.2.33"
|
||||||
|
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-2.2.33.tgz#b537c471d34a6651b48f36fdbf29750340e08b50"
|
||||||
|
dependencies:
|
||||||
|
es6-promise "3.2.1"
|
||||||
|
mongodb-core "2.1.17"
|
||||||
|
readable-stream "2.2.7"
|
||||||
|
|
||||||
|
nan@^2.3.2:
|
||||||
|
version "2.8.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a"
|
||||||
|
|
||||||
|
normalize-newline@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/normalize-newline/-/normalize-newline-3.0.0.tgz#1cbea804aba436001f83938ab21ec039d69ae9d3"
|
||||||
|
|
||||||
|
object-keys@^1.0.8:
|
||||||
|
version "1.0.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
|
||||||
|
|
||||||
|
object.getownpropertydescriptors@^2.0.3:
|
||||||
|
version "2.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
|
||||||
|
dependencies:
|
||||||
|
define-properties "^1.1.2"
|
||||||
|
es-abstract "^1.5.1"
|
||||||
|
|
||||||
|
once@^1.3.0:
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||||
|
dependencies:
|
||||||
|
wrappy "1"
|
||||||
|
|
||||||
|
onetime@^2.0.0:
|
||||||
|
version "2.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4"
|
||||||
|
dependencies:
|
||||||
|
mimic-fn "^1.0.0"
|
||||||
|
|
||||||
|
ora@^1.1.0:
|
||||||
|
version "1.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/ora/-/ora-1.3.0.tgz#80078dd2b92a934af66a3ad72a5b910694ede51a"
|
||||||
|
dependencies:
|
||||||
|
chalk "^1.1.1"
|
||||||
|
cli-cursor "^2.1.0"
|
||||||
|
cli-spinners "^1.0.0"
|
||||||
|
log-symbols "^1.0.2"
|
||||||
|
|
||||||
|
os-homedir@^1.0.1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
|
||||||
|
|
||||||
|
path-is-absolute@^1.0.0:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||||
|
|
||||||
|
path-parse@^1.0.5:
|
||||||
|
version "1.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
|
||||||
|
|
||||||
|
pify@^2.3.0:
|
||||||
|
version "2.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||||
|
|
||||||
|
pretty-bytes@^4.0.2:
|
||||||
|
version "4.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
|
||||||
|
|
||||||
|
process-nextick-args@^1.0.6, process-nextick-args@~1.0.6:
|
||||||
|
version "1.0.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
|
||||||
|
|
||||||
|
qenv@^1.1.7:
|
||||||
|
version "1.1.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/qenv/-/qenv-1.1.7.tgz#d03f8bf8fe37494cf08d0919fe765dca84d9afae"
|
||||||
|
dependencies:
|
||||||
|
lodash "^4.17.4"
|
||||||
|
smartfile "^4.2.11"
|
||||||
|
typings-global "^1.0.16"
|
||||||
|
|
||||||
|
randomatic@^1.1.7:
|
||||||
|
version "1.1.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c"
|
||||||
|
dependencies:
|
||||||
|
is-number "^3.0.0"
|
||||||
|
kind-of "^4.0.0"
|
||||||
|
|
||||||
|
readable-stream@2.2.7:
|
||||||
|
version "2.2.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.7.tgz#07057acbe2467b22042d36f98c5ad507054e95b1"
|
||||||
|
dependencies:
|
||||||
|
buffer-shims "~1.0.0"
|
||||||
|
core-util-is "~1.0.0"
|
||||||
|
inherits "~2.0.1"
|
||||||
|
isarray "~1.0.0"
|
||||||
|
process-nextick-args "~1.0.6"
|
||||||
|
string_decoder "~1.0.0"
|
||||||
|
util-deprecate "~1.0.1"
|
||||||
|
|
||||||
|
readable-stream@^2.0.2, readable-stream@^2.1.5:
|
||||||
|
version "2.3.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c"
|
||||||
|
dependencies:
|
||||||
|
core-util-is "~1.0.0"
|
||||||
|
inherits "~2.0.3"
|
||||||
|
isarray "~1.0.0"
|
||||||
|
process-nextick-args "~1.0.6"
|
||||||
|
safe-buffer "~5.1.1"
|
||||||
|
string_decoder "~1.0.3"
|
||||||
|
util-deprecate "~1.0.1"
|
||||||
|
|
||||||
|
rechoir@^0.6.2:
|
||||||
|
version "0.6.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
|
||||||
|
dependencies:
|
||||||
|
resolve "^1.1.6"
|
||||||
|
|
||||||
|
reflect-metadata@^0.1.2:
|
||||||
|
version "0.1.10"
|
||||||
|
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.10.tgz#b4f83704416acad89988c9b15635d47e03b9344a"
|
||||||
|
|
||||||
|
remove-trailing-separator@^1.0.1:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
|
||||||
|
|
||||||
|
replace-ext@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb"
|
||||||
|
|
||||||
|
require-reload@0.2.2:
|
||||||
|
version "0.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/require-reload/-/require-reload-0.2.2.tgz#29a7591846caf91b6e8a3cda991683f95f8d7d42"
|
||||||
|
|
||||||
|
require_optional@~1.0.0:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e"
|
||||||
|
dependencies:
|
||||||
|
resolve-from "^2.0.0"
|
||||||
|
semver "^5.1.0"
|
||||||
|
|
||||||
|
resolve-from@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57"
|
||||||
|
|
||||||
|
resolve@^1.1.6:
|
||||||
|
version "1.5.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
|
||||||
|
dependencies:
|
||||||
|
path-parse "^1.0.5"
|
||||||
|
|
||||||
|
restore-cursor@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
|
||||||
|
dependencies:
|
||||||
|
onetime "^2.0.0"
|
||||||
|
signal-exit "^3.0.2"
|
||||||
|
|
||||||
|
runtime-type-checks@0.0.4:
|
||||||
|
version "0.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/runtime-type-checks/-/runtime-type-checks-0.0.4.tgz#5682baf2ffe53f955fe3e065b40a0a09943845c8"
|
||||||
|
dependencies:
|
||||||
|
reflect-metadata "^0.1.2"
|
||||||
|
|
||||||
|
rxjs@^5.4.3:
|
||||||
|
version "5.5.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.2.tgz#28d403f0071121967f18ad665563255d54236ac3"
|
||||||
|
dependencies:
|
||||||
|
symbol-observable "^1.0.1"
|
||||||
|
|
||||||
|
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||||
|
version "5.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
|
||||||
|
|
||||||
|
semver@^5.1.0, semver@^5.3.0:
|
||||||
|
version "5.4.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"
|
||||||
|
|
||||||
|
shelljs@^0.7.8:
|
||||||
|
version "0.7.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
|
||||||
|
dependencies:
|
||||||
|
glob "^7.0.0"
|
||||||
|
interpret "^1.0.0"
|
||||||
|
rechoir "^0.6.2"
|
||||||
|
|
||||||
|
signal-exit@^3.0.2:
|
||||||
|
version "3.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
|
||||||
|
|
||||||
|
smartchai@^1.0.3:
|
||||||
|
version "1.0.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartchai/-/smartchai-1.0.8.tgz#a074836f4ddd4b98c50f1e7ae9e8e8ad9f6f1902"
|
||||||
|
dependencies:
|
||||||
|
"@types/code" "^4.0.3"
|
||||||
|
code "^5.1.0"
|
||||||
|
typings-global "^1.0.20"
|
||||||
|
|
||||||
|
smartdelay@^1.0.3:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartdelay/-/smartdelay-1.0.4.tgz#791c1a4ee6770494064c10b1d2d2b8e6f3105b82"
|
||||||
|
dependencies:
|
||||||
|
smartq "^1.1.1"
|
||||||
|
typings-global "^1.0.16"
|
||||||
|
|
||||||
|
smartenv@^2.0.0:
|
||||||
|
version "2.0.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartenv/-/smartenv-2.0.6.tgz#b38c679b0c151b9af548f68c3a072c29d1417e8d"
|
||||||
|
dependencies:
|
||||||
|
lodash "^4.17.4"
|
||||||
|
smartq "^1.1.1"
|
||||||
|
typings-global "^1.0.14"
|
||||||
|
|
||||||
|
smartfile@^4.2.11:
|
||||||
|
version "4.2.26"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartfile/-/smartfile-4.2.26.tgz#800f08b1089e153b7fd8e0ba165da465a071d407"
|
||||||
|
dependencies:
|
||||||
|
"@types/fs-extra" "4.x.x"
|
||||||
|
"@types/vinyl" "^2.0.1"
|
||||||
|
fs-extra "^4.0.2"
|
||||||
|
glob "^7.1.2"
|
||||||
|
js-yaml "^3.10.0"
|
||||||
|
require-reload "0.2.2"
|
||||||
|
smartpath "^3.2.8"
|
||||||
|
smartq "^1.1.6"
|
||||||
|
smartrequest "^1.0.6"
|
||||||
|
typings-global "^1.0.20"
|
||||||
|
vinyl-file "^3.0.0"
|
||||||
|
|
||||||
|
smartpath@^3.2.8:
|
||||||
|
version "3.2.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartpath/-/smartpath-3.2.8.tgz#4834bd3a8bae2295baacadba23c87a501952f940"
|
||||||
|
dependencies:
|
||||||
|
home "^1.0.1"
|
||||||
|
typings-global "^1.0.14"
|
||||||
|
|
||||||
|
smartq@^1.1.1, smartq@^1.1.6:
|
||||||
|
version "1.1.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.6.tgz#0c1ff4336d95e95b4f1fdd8ccd7e2c5a323b8412"
|
||||||
|
dependencies:
|
||||||
|
typings-global "^1.0.19"
|
||||||
|
util.promisify "^1.0.0"
|
||||||
|
|
||||||
|
smartrequest@^1.0.6:
|
||||||
|
version "1.0.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartrequest/-/smartrequest-1.0.6.tgz#a006454332453b0a70d38a003a29963d039a7783"
|
||||||
|
dependencies:
|
||||||
|
smartq "^1.1.1"
|
||||||
|
typings-global "^1.0.17"
|
||||||
|
|
||||||
|
smartshell@^1.0.6:
|
||||||
|
version "1.0.19"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.19.tgz#459c7a9fab8a25007848ffc711b7a817dd6ffc00"
|
||||||
|
dependencies:
|
||||||
|
"@types/which" "^1.0.28"
|
||||||
|
shelljs "^0.7.8"
|
||||||
|
smartq "^1.1.6"
|
||||||
|
typings-global "^1.0.23"
|
||||||
|
which "^1.3.0"
|
||||||
|
|
||||||
|
smartstring@^2.0.24:
|
||||||
|
version "2.0.28"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartstring/-/smartstring-2.0.28.tgz#384b808dc3780eff0031ce7925c1b1668abbcad5"
|
||||||
|
dependencies:
|
||||||
|
crypto-random-string "^1.0.0"
|
||||||
|
js-base64 "^2.3.2"
|
||||||
|
normalize-newline "^3.0.0"
|
||||||
|
randomatic "^1.1.7"
|
||||||
|
strip-indent "^2.0.0"
|
||||||
|
typings-global "^1.0.20"
|
||||||
|
|
||||||
|
sprintf-js@~1.0.2:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||||
|
|
||||||
|
string_decoder@~1.0.0, string_decoder@~1.0.3:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
|
||||||
|
dependencies:
|
||||||
|
safe-buffer "~5.1.0"
|
||||||
|
|
||||||
|
strip-ansi@^3.0.0:
|
||||||
|
version "3.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||||
|
dependencies:
|
||||||
|
ansi-regex "^2.0.0"
|
||||||
|
|
||||||
|
strip-bom-buf@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz#1cb45aaf57530f4caf86c7f75179d2c9a51dd572"
|
||||||
|
dependencies:
|
||||||
|
is-utf8 "^0.2.1"
|
||||||
|
|
||||||
|
strip-bom-stream@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca"
|
||||||
|
dependencies:
|
||||||
|
first-chunk-stream "^2.0.0"
|
||||||
|
strip-bom "^2.0.0"
|
||||||
|
|
||||||
|
strip-bom@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
|
||||||
|
dependencies:
|
||||||
|
is-utf8 "^0.2.0"
|
||||||
|
|
||||||
|
strip-indent@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68"
|
||||||
|
|
||||||
|
supports-color@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||||
|
|
||||||
|
symbol-observable@^1.0.1:
|
||||||
|
version "1.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
|
||||||
|
|
||||||
|
tapbundle@^1.1.1:
|
||||||
|
version "1.1.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/tapbundle/-/tapbundle-1.1.8.tgz#e08aee0e100a830d8a26a583a85d37ce53312e02"
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "^8.0.33"
|
||||||
|
early "^2.1.1"
|
||||||
|
leakage "^0.3.0"
|
||||||
|
smartchai "^1.0.3"
|
||||||
|
smartdelay "^1.0.3"
|
||||||
|
smartq "^1.1.1"
|
||||||
|
typings-global "^1.0.19"
|
||||||
|
|
||||||
|
through2@^2.0.1:
|
||||||
|
version "2.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
|
||||||
|
dependencies:
|
||||||
|
readable-stream "^2.1.5"
|
||||||
|
xtend "~4.0.1"
|
||||||
|
|
||||||
|
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.17, typings-global@^1.0.19, typings-global@^1.0.20, typings-global@^1.0.23:
|
||||||
|
version "1.0.23"
|
||||||
|
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.23.tgz#cdd085803049dd07d95b2e1475243c6b2db378ab"
|
||||||
|
dependencies:
|
||||||
|
semver "^5.3.0"
|
||||||
|
smartshell "^1.0.6"
|
||||||
|
|
||||||
|
universalify@^0.1.0:
|
||||||
|
version "0.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7"
|
||||||
|
|
||||||
|
util-deprecate@~1.0.1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||||
|
|
||||||
|
util.promisify@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030"
|
||||||
|
dependencies:
|
||||||
|
define-properties "^1.1.2"
|
||||||
|
object.getownpropertydescriptors "^2.0.3"
|
||||||
|
|
||||||
|
vinyl-file@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/vinyl-file/-/vinyl-file-3.0.0.tgz#b104d9e4409ffa325faadd520642d0a3b488b365"
|
||||||
|
dependencies:
|
||||||
|
graceful-fs "^4.1.2"
|
||||||
|
pify "^2.3.0"
|
||||||
|
strip-bom-buf "^1.0.0"
|
||||||
|
strip-bom-stream "^2.0.0"
|
||||||
|
vinyl "^2.0.1"
|
||||||
|
|
||||||
|
vinyl@^2.0.1:
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.1.0.tgz#021f9c2cf951d6b939943c89eb5ee5add4fd924c"
|
||||||
|
dependencies:
|
||||||
|
clone "^2.1.1"
|
||||||
|
clone-buffer "^1.0.0"
|
||||||
|
clone-stats "^1.0.0"
|
||||||
|
cloneable-readable "^1.0.0"
|
||||||
|
remove-trailing-separator "^1.0.1"
|
||||||
|
replace-ext "^1.0.0"
|
||||||
|
|
||||||
|
which@^1.3.0:
|
||||||
|
version "1.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"
|
||||||
|
dependencies:
|
||||||
|
isexe "^2.0.0"
|
||||||
|
|
||||||
|
wrappy@1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||||
|
|
||||||
|
xtend@~4.0.1:
|
||||||
|
version "4.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
Reference in New Issue
Block a user