remove NeDB and update to use MongoDB Atlas for testing
This commit is contained in:
parent
a4f3f23bed
commit
a934f3608f
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,5 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
test/data
|
|
||||||
pages/
|
|
||||||
coverage/
|
|
||||||
public/
|
public/
|
||||||
|
coverage/
|
||||||
|
.nogit/
|
||||||
|
104
README.md
104
README.md
@ -1,16 +1,16 @@
|
|||||||
# smartdata
|
# smartdata
|
||||||
|
do more with data
|
||||||
> Note: Still in Beta
|
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty
|
||||||
[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartdata)
|
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartdata)
|
||||||
[![git](https://push.rocks/assets/repo-button-git.svg)](https://gitlab.com/pushrocks/smartdata)
|
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartdata)
|
||||||
[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartdata)
|
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartdata)
|
||||||
[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartdata/)
|
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartdata/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[![build status](https://gitlab.com/pushrocks/smartdata/badges/master/build.svg)](https://gitlab.com/pushrocks/smartdata/commits/master)
|
[![build status](https://GitLab.com/pushrocks/smartdata/badges/master/build.svg)](https://GitLab.com/pushrocks/smartdata/commits/master)
|
||||||
[![coverage report](https://gitlab.com/pushrocks/smartdata/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartdata/commits/master)
|
[![coverage report](https://GitLab.com/pushrocks/smartdata/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartdata/commits/master)
|
||||||
|
[![npm downloads per month](https://img.shields.io/npm/dm/smartdata.svg)](https://www.npmjs.com/package/smartdata)
|
||||||
[![Dependency Status](https://david-dm.org/pushrocks/smartdata.svg)](https://david-dm.org/pushrocks/smartdata)
|
[![Dependency Status](https://david-dm.org/pushrocks/smartdata.svg)](https://david-dm.org/pushrocks/smartdata)
|
||||||
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartdata/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartdata/master/dependencies/npm)
|
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartdata/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartdata/master/dependencies/npm)
|
||||||
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartdata/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartdata)
|
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartdata/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartdata)
|
||||||
@ -18,88 +18,12 @@
|
|||||||
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
|
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
|
||||||
|
|
||||||
smartdata is an ODM that adheres to TypeScript practices and uses classes to organize data.
|
## Usage
|
||||||
It uses MongoDB or NeDb as persistent storage.
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
## Intention
|
For further information read the linked docs at the top of this README.
|
||||||
There are many ODMs out there, however when we searched for an ODM that uses TypeScript,
|
|
||||||
acts smart while still embracing the NoSQL idea we didn't find a matching solution.
|
|
||||||
This is why we started smartdata.
|
|
||||||
|
|
||||||
How MongoDB terms map to smartdata classes
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
MongoDB term | smartdata class
|
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
|
||||||
--- | ---
|
|
||||||
Database | smartdata.Db
|
|
||||||
Collection | smartdata.DbCollection
|
|
||||||
Document | smartdata.DbDoc
|
|
||||||
|
|
||||||
### 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 classes from scratch or 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.
|
|
||||||
|
|
||||||
[![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks)
|
|
||||||
|
11
dist/smartdata.classes.db.d.ts
vendored
11
dist/smartdata.classes.db.d.ts
vendored
@ -9,7 +9,8 @@ export declare class Db {
|
|||||||
dbUrl: string;
|
dbUrl: string;
|
||||||
db: plugins.mongodb.Db;
|
db: plugins.mongodb.Db;
|
||||||
status: TConnectionStatus;
|
status: TConnectionStatus;
|
||||||
collections: Objectmap<DbCollection<any>>;
|
classCollections: Objectmap<DbCollection<any>>;
|
||||||
|
objectCollections: Objectmap<DbCollection<any>>;
|
||||||
constructor(dbUrlArg: string);
|
constructor(dbUrlArg: string);
|
||||||
/**
|
/**
|
||||||
* connects to the database that was specified during instance creation
|
* connects to the database that was specified during instance creation
|
||||||
@ -20,8 +21,12 @@ export declare class Db {
|
|||||||
*/
|
*/
|
||||||
close(): Promise<any>;
|
close(): Promise<any>;
|
||||||
/**
|
/**
|
||||||
* gets a collection by name: string
|
* gets a class based collection by name: string
|
||||||
*/
|
*/
|
||||||
getCollectionByName<T>(nameArg: string): Promise<DbCollection<T>>;
|
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;
|
addCollection(dbCollectionArg: DbCollection<any>): void;
|
||||||
}
|
}
|
||||||
|
49
dist/smartdata.classes.db.js
vendored
49
dist/smartdata.classes.db.js
vendored
@ -1,10 +1,20 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
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 });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const plugins = require("./smartdata.plugins");
|
const plugins = require("./smartdata.plugins");
|
||||||
const lik_1 = require("lik");
|
const lik_1 = require("lik");
|
||||||
|
const smartdata_classes_dbobjectdoc_1 = require("./smartdata.classes.dbobjectdoc");
|
||||||
class Db {
|
class Db {
|
||||||
constructor(dbUrlArg) {
|
constructor(dbUrlArg) {
|
||||||
this.collections = new lik_1.Objectmap();
|
this.classCollections = new lik_1.Objectmap();
|
||||||
|
this.objectCollections = new lik_1.Objectmap();
|
||||||
this.dbUrl = dbUrlArg;
|
this.dbUrl = dbUrlArg;
|
||||||
}
|
}
|
||||||
// basic connection stuff ----------------------------------------------
|
// basic connection stuff ----------------------------------------------
|
||||||
@ -36,21 +46,36 @@ class Db {
|
|||||||
}
|
}
|
||||||
// advanced communication with the database --------------------------------
|
// advanced communication with the database --------------------------------
|
||||||
/**
|
/**
|
||||||
* gets a collection by name: string
|
* gets a class based collection by name: string
|
||||||
*/
|
*/
|
||||||
getCollectionByName(nameArg) {
|
getClassCollectionByName(nameArg) {
|
||||||
let done = plugins.smartq.defer();
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
let resultCollection = this.collections.find((dbCollectionArg) => {
|
let resultCollection = this.classCollections.find((dbCollectionArg) => {
|
||||||
return dbCollectionArg.name === nameArg;
|
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;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (resultCollection !== null) {
|
|
||||||
done.resolve(resultCollection);
|
|
||||||
}
|
|
||||||
return done.promise;
|
|
||||||
}
|
}
|
||||||
addCollection(dbCollectionArg) {
|
addCollection(dbCollectionArg) {
|
||||||
this.collections.add(dbCollectionArg);
|
this.classCollections.add(dbCollectionArg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.Db = Db;
|
exports.Db = Db;
|
||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UksS0FBSyxPQUFPLENBQUE7WUFDekMsQ0FBQyxDQUFDLENBQUE7WUFDRixFQUFFLENBQUMsQ0FBQyxDQUFDLGdCQUFnQixJQUFJLFVBQVUsQ0FBQyxDQUFDLENBQUM7Z0JBQ3BDLGdCQUFnQixHQUFHLDRDQUFZLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyxDQUFDLFVBQVUsQ0FBQTtnQkFDekQsTUFBTSxDQUFDLGdCQUFnQixDQUFBO1lBQ3pCLENBQUM7WUFBQyxJQUFJLENBQUMsQ0FBQztnQkFDTixNQUFNLENBQUMsZ0JBQWdCLENBQUE7WUFDekIsQ0FBQztRQUNILENBQUM7S0FBQTtJQUVELGFBQWEsQ0FBRSxlQUFrQztRQUMvQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsR0FBRyxDQUFDLGVBQWUsQ0FBQyxDQUFBO0lBQzVDLENBQUM7Q0FFRjtBQXRFRCxnQkFzRUMifQ==
|
4
dist/smartdata.classes.dbcollection.js
vendored
4
dist/smartdata.classes.dbcollection.js
vendored
@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
const plugins = require("./smartdata.plugins");
|
const plugins = require("./smartdata.plugins");
|
||||||
function Collection(db) {
|
function Collection(db) {
|
||||||
return function (constructor) {
|
return function (constructor) {
|
||||||
constructor['dbCollection'] = new DbCollection(constructor.name, db);
|
constructor['dbCollection'] = new DbCollection(constructor, db);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
exports.Collection = Collection;
|
exports.Collection = Collection;
|
||||||
@ -92,4 +92,4 @@ class DbCollection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DbCollection = DbCollection;
|
exports.DbCollection = DbCollection;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLmNsYXNzZXMuZGJjb2xsZWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOl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QUMsb0JBQW9CLENBQUMsQ0FBQyxJQUFJLENBQUM7WUFDckMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxVQUFVLENBQUMsV0FBVyxDQUFDO2lCQUNwQyxJQUFJLENBQUMsUUFBUSxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQTtRQUNuQyxDQUFDLENBQUMsQ0FBQTtRQUNGLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFBO0lBQ3JCLENBQUM7SUFFRDs7T0FFRztJQUNLLFFBQVEsQ0FBRSxNQUFTO1FBQ3pCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxFQUFRLENBQUE7UUFDdkMsSUFBSSxnQkFBZ0IsR0FBRyxJQUFJLENBQUE7UUFDM0IsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLGdCQUFnQixDQUFDLENBQUMsQ0FBQztZQUMxQixnQkFBZ0IsR0FBRyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsTUFBTSxDQUFDLENBQUE7UUFDbEQsQ0FBQztRQUNELEVBQUUsQ0FBQyxDQUFDLGdCQUFnQixDQUFDLENBQUMsQ0FBQztZQUNyQixJQUFJLENBQUMsT0FBTyxFQUFFLENBQUE7UUFDaEIsQ0FBQztRQUFDLElBQUksQ0FBQyxDQUFDO1lBQ04sSUFBSSxDQUFDLE1BQU0sQ0FBQyxtQ0FBbUMsQ0FBQyxDQUFBO1FBQ2xELENBQUM7UUFDRCxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQTtJQUNyQixDQUFDO0NBQ0Y7QUFsR0Qsb0NBa0dDIn0=
|
2
dist/smartdata.classes.dbdoc.d.ts
vendored
2
dist/smartdata.classes.dbdoc.d.ts
vendored
@ -25,7 +25,7 @@ export declare class DbDoc<T> {
|
|||||||
/**
|
/**
|
||||||
* class constructor
|
* class constructor
|
||||||
*/
|
*/
|
||||||
constructor(nameArg: string);
|
constructor();
|
||||||
/**
|
/**
|
||||||
* saves this instance but not any connected items
|
* saves this instance but not any connected items
|
||||||
* may lead to data inconsistencies, but is faster
|
* may lead to data inconsistencies, but is faster
|
||||||
|
6
dist/smartdata.classes.dbdoc.js
vendored
6
dist/smartdata.classes.dbdoc.js
vendored
@ -18,9 +18,9 @@ class DbDoc {
|
|||||||
/**
|
/**
|
||||||
* class constructor
|
* class constructor
|
||||||
*/
|
*/
|
||||||
constructor(nameArg) {
|
constructor() {
|
||||||
|
this.name = this.constructor['name'];
|
||||||
this.collection = this.constructor['dbCollection'];
|
this.collection = this.constructor['dbCollection'];
|
||||||
this.name = nameArg;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* saves this instance but not any connected items
|
* saves this instance but not any connected items
|
||||||
@ -58,4 +58,4 @@ class DbDoc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.DbDoc = DbDoc;
|
exports.DbDoc = DbDoc;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLmNsYXNzZXMuZGJEb2MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGRhdGEuY2xhc3Nlcy5kYkRvYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLDZCQUErQjtBQU8vQjs7R0FFRztBQUNIO0lBQ0UsTUFBTSxDQUFDLENBQUMsTUFBa0IsRUFBRSxHQUFXO1FBQ3JDLE9BQU8sQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLENBQUE7UUFDekIsRUFBRSxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsa0JBQWtCLENBQUMsQ0FBQyxDQUFDO1lBQUMsTUFBTSxDQUFDLGtCQUFrQixHQUFHLEVBQUUsQ0FBQTtRQUFDLENBQUM7UUFDbEUsTUFBTSxDQUFDLGtCQUFrQixDQUFDLElBQUksQ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SUFBSSxDQUFDLENBQUMsQ0FBQztZQUM3QixJQUFJLFFBQVEsR0FBRyxJQUFJLENBQUUsV0FBVyxDQUFFLENBQUE7WUFDbEMsRUFBRSxDQUFDLENBQUMsUUFBUSxZQUFZLEtBQUssSUFBSSxDQUFDLFdBQVcsQ0FBQyxjQUFjLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDO2dCQUN2RSxRQUFRLENBQUMsUUFBUSxDQUFDLFdBQVcsQ0FBQyxDQUFBO1lBQ2hDLENBQUM7UUFDSCxDQUFDO0lBQ0gsQ0FBQztDQUNGO0FBakVELHNCQWlFQyJ9
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLmNsYXNzZXMuZGJvYmplY3Rkb2MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGRhdGEuY2xhc3Nlcy5kYm9iamVjdGRvYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUdBLHVFQUFpRDtBQUNqRCxxRkFBK0Q7QUFFcEQsUUFBQSxZQUFZLEdBQUcsQ0FBQyxPQUFPLEVBQUMsS0FBUztJQUMxQyxJQUFJLFNBQVMsR0FBRyxJQUFJLCtCQUFLLEVBQUUsQ0FBQTtJQUMzQixTQUFTLENBQUMsSUFBSSxHQUFHLE9BQU8sQ0FBQTtJQUN4QixTQUFTLENBQUMsVUFBVSxHQUFHLElBQUksNkNBQVksQ0FBQyxTQUFTLEVBQUUsS0FBSyxDQUFDLENBQUE7SUFDekQsTUFBTSxDQUFDLFNBQVMsQ0FBQTtBQUNsQixDQUFDLENBQUEifQ==
|
108
docs/index.md
108
docs/index.md
@ -1,19 +1,113 @@
|
|||||||
# 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.
|
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartdata)
|
||||||
|
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartdata)
|
||||||
|
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartdata)
|
||||||
|
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartdata/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[![build status](https://GitLab.com/pushrocks/smartdata/badges/master/build.svg)](https://GitLab.com/pushrocks/smartdata/commits/master)
|
||||||
|
[![coverage report](https://GitLab.com/pushrocks/smartdata/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartdata/commits/master)
|
||||||
|
[![npm downloads per month](https://img.shields.io/npm/dm/smartdata.svg)](https://www.npmjs.com/package/smartdata)
|
||||||
|
[![Dependency Status](https://david-dm.org/pushrocks/smartdata.svg)](https://david-dm.org/pushrocks/smartdata)
|
||||||
|
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartdata/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartdata/master/dependencies/npm)
|
||||||
|
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartdata/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartdata)
|
||||||
|
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](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
|
||||||
|
|
||||||
[![npm](https://push.rocks/assets/repo-header.svg)](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 classes from scratch or 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)
|
||||||
|
|
||||||
|
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
|
||||||
|
@ -8,5 +8,10 @@
|
|||||||
"globalNpmTools": [
|
"globalNpmTools": [
|
||||||
"npmts"
|
"npmts"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"npmts": {
|
||||||
|
"testConfig": {
|
||||||
|
"parallel": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
package.json
12
package.json
@ -1,13 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "smartdata",
|
"name": "smartdata",
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"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)",
|
||||||
"testLocal": "(npmdocker)",
|
"testLocal": "(npmdocker)"
|
||||||
"prepareMongo": "(rm -rf ./test/data && mkdir ./test/data/)"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -25,13 +24,14 @@
|
|||||||
"beautylog": "^6.1.10",
|
"beautylog": "^6.1.10",
|
||||||
"lik": "^1.0.32",
|
"lik": "^1.0.32",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"mongodb": "^2.2.28",
|
"mongodb": "^2.2.29",
|
||||||
"runtime-type-checks": "0.0.4",
|
"runtime-type-checks": "0.0.4",
|
||||||
"smartq": "^1.1.1",
|
"smartq": "^1.1.1",
|
||||||
"typings-global": "^1.0.17"
|
"typings-global": "^1.0.19"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/shelljs": "^0.7.2",
|
"@types/shelljs": "^0.7.2",
|
||||||
|
"qenv": "^1.1.7",
|
||||||
"shelljs": "^0.7.8",
|
"shelljs": "^0.7.8",
|
||||||
"smartstring": "^2.0.24",
|
"smartstring": "^2.0.24",
|
||||||
"tapbundle": "^1.0.14"
|
"tapbundle": "^1.0.14"
|
||||||
|
52
test/test.class.ts
Normal file
52
test/test.class.ts
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
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 '../dist/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`)
|
||||||
|
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()
|
50
test/test.ts
50
test/test.ts
@ -1,5 +1,8 @@
|
|||||||
import { tap, expect } from 'tapbundle'
|
import { tap, expect } from 'tapbundle'
|
||||||
import * as smartq from 'smartq'
|
import * as smartq from 'smartq'
|
||||||
|
import { Qenv } from 'qenv'
|
||||||
|
|
||||||
|
let testQenv = new Qenv(process.cwd(), process.cwd() + '/.nogit/')
|
||||||
|
|
||||||
// the tested module
|
// the tested module
|
||||||
import * as smartdata from '../dist/index'
|
import * as smartdata from '../dist/index'
|
||||||
@ -13,11 +16,19 @@ interface ITestObject1 {
|
|||||||
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`)
|
||||||
|
await testDb.connect()
|
||||||
|
})
|
||||||
|
|
||||||
|
// =======================================
|
||||||
|
// The actual tests
|
||||||
|
// =======================================
|
||||||
|
|
||||||
let testDbCollection: smartdata.DbCollection<ITestObject1>
|
let testDbCollection: smartdata.DbCollection<ITestObject1>
|
||||||
|
|
||||||
tap.test('should establish a connection to mongodb', async () => {
|
tap.test('should give me a collection', async () => {
|
||||||
testDb = new smartdata.Db('mongodb://localhost:27017/smartdata')
|
testDbCollection = await testDb.getObjectCollectionByName<ITestObject1>('TestValue', testDb, true)
|
||||||
await testDb.connect()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
tap.test('should insert a doc into the collection', async () => {
|
tap.test('should insert a doc into the collection', async () => {
|
||||||
@ -45,37 +56,10 @@ tap.test('should find a specified doc', async () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tap.test('should close the db Connection', async () => {
|
tap.test('should close the db Connection', async () => {
|
||||||
testDb.close()
|
await testDb.close()
|
||||||
})
|
|
||||||
|
|
||||||
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('TestCar')
|
|
||||||
this.color = optionsArg.color
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let testCarInstance = new TestCar({
|
|
||||||
color: 'red',
|
|
||||||
property2: 2
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(testCarInstance.saveableProperties[ 0 ]).equal('color')
|
|
||||||
console.log(TestCar)
|
|
||||||
expect(testCarInstance.collection).be.instanceof(smartdata.DbCollection)
|
|
||||||
expect(testCarInstance).be.instanceof(smartdata.DbDoc)
|
|
||||||
testCarInstance.save()
|
|
||||||
})
|
|
||||||
|
|
||||||
tap.test('should get a collection for testCar', async () => {
|
|
||||||
//
|
|
||||||
})
|
})
|
||||||
|
|
||||||
tap.start()
|
tap.start()
|
||||||
|
@ -2,6 +2,7 @@ import * as plugins from './smartdata.plugins'
|
|||||||
import { Objectmap } from 'lik'
|
import { Objectmap } from 'lik'
|
||||||
|
|
||||||
import { DbCollection } from './smartdata.classes.dbcollection'
|
import { DbCollection } from './smartdata.classes.dbcollection'
|
||||||
|
import { getObjectDoc } from './smartdata.classes.dbobjectdoc'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* interface - indicates the connection status of the db
|
* interface - indicates the connection status of the db
|
||||||
@ -12,7 +13,8 @@ export class Db {
|
|||||||
dbUrl: string
|
dbUrl: string
|
||||||
db: plugins.mongodb.Db
|
db: plugins.mongodb.Db
|
||||||
status: TConnectionStatus
|
status: TConnectionStatus
|
||||||
collections = new Objectmap<DbCollection<any>>()
|
classCollections = new Objectmap<DbCollection<any>>()
|
||||||
|
objectCollections = new Objectmap<DbCollection<any>>()
|
||||||
|
|
||||||
constructor (dbUrlArg: string) {
|
constructor (dbUrlArg: string) {
|
||||||
this.dbUrl = dbUrlArg
|
this.dbUrl = dbUrlArg
|
||||||
@ -49,21 +51,32 @@ export class Db {
|
|||||||
// advanced communication with the database --------------------------------
|
// advanced communication with the database --------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets a collection by name: string
|
* gets a class based collection by name: string
|
||||||
*/
|
*/
|
||||||
getCollectionByName<T>(nameArg: string): Promise<DbCollection<T>> {
|
async getClassCollectionByName<T> (nameArg: string): Promise<DbCollection<T>> {
|
||||||
let done = plugins.smartq.defer<DbCollection<any>>()
|
let resultCollection = this.classCollections.find((dbCollectionArg) => {
|
||||||
let resultCollection = this.collections.find((dbCollectionArg) => {
|
|
||||||
return dbCollectionArg.name === nameArg
|
return dbCollectionArg.name === nameArg
|
||||||
})
|
})
|
||||||
if (resultCollection !== null) {
|
return resultCollection
|
||||||
done.resolve(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
|
||||||
}
|
}
|
||||||
return done.promise
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addCollection (dbCollectionArg: DbCollection<any>) {
|
addCollection (dbCollectionArg: DbCollection<any>) {
|
||||||
this.collections.add(dbCollectionArg)
|
this.classCollections.add(dbCollectionArg)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ export interface IDocValidation<T> {
|
|||||||
|
|
||||||
export function Collection (db: Db) {
|
export function Collection (db: Db) {
|
||||||
return function (constructor) {
|
return function (constructor) {
|
||||||
constructor[ 'dbCollection' ] = new DbCollection(constructor.name, db)
|
constructor[ 'dbCollection' ] = new DbCollection(constructor, db)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,9 +43,9 @@ export class DbDoc<T> {
|
|||||||
/**
|
/**
|
||||||
* class constructor
|
* class constructor
|
||||||
*/
|
*/
|
||||||
constructor(nameArg: string) {
|
constructor () {
|
||||||
|
this.name = this.constructor['name']
|
||||||
this.collection = this.constructor[ 'dbCollection' ]
|
this.collection = this.constructor[ 'dbCollection' ]
|
||||||
this.name = nameArg
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
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
|
||||||
|
}
|
253
yarn.lock
253
yarn.lock
@ -25,6 +25,12 @@
|
|||||||
version "3.5.2"
|
version "3.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.5.2.tgz#c11cd2817d3a401b7ba0f5a420f35c56139b1c1e"
|
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.5.2.tgz#c11cd2817d3a401b7ba0f5a420f35c56139b1c1e"
|
||||||
|
|
||||||
|
"@types/fs-extra@3.x.x":
|
||||||
|
version "3.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-3.0.3.tgz#1d66eb670ebf657e57c0fda014df340c19d8aa0c"
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/lodash@^4.14.55", "@types/lodash@^4.14.62", "@types/lodash@^4.14.66":
|
"@types/lodash@^4.14.55", "@types/lodash@^4.14.62", "@types/lodash@^4.14.66":
|
||||||
version "4.14.66"
|
version "4.14.66"
|
||||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.66.tgz#3dbb83477becf130611f8fac82a8fdb199805981"
|
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.66.tgz#3dbb83477becf130611f8fac82a8fdb199805981"
|
||||||
@ -40,9 +46,9 @@
|
|||||||
"@types/bson" "*"
|
"@types/bson" "*"
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/node@*", "@types/node@^7.0.29":
|
"@types/node@*":
|
||||||
version "7.0.31"
|
version "8.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.31.tgz#80ea4d175599b2a00149c29a10a4eb2dff592e86"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.1.tgz#89c271e0c3b9ebb6a3756dd601336970b6228b77"
|
||||||
|
|
||||||
"@types/promises-a-plus@*":
|
"@types/promises-a-plus@*":
|
||||||
version "0.0.27"
|
version "0.0.27"
|
||||||
@ -64,6 +70,12 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/vinyl@^2.0.0":
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/vinyl/-/vinyl-2.0.0.tgz#fd213bf7f4136dde21fe1895500b12c186f8c268"
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/which@^1.0.28":
|
"@types/which@^1.0.28":
|
||||||
version "1.0.28"
|
version "1.0.28"
|
||||||
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
|
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
|
||||||
@ -80,6 +92,12 @@ ansi-styles@^2.2.1:
|
|||||||
version "2.2.1"
|
version "2.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
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"
|
||||||
|
|
||||||
assertion-error@^1.0.1:
|
assertion-error@^1.0.1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c"
|
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c"
|
||||||
@ -169,6 +187,26 @@ cli-spinners@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.0.0.tgz#ef987ed3d48391ac3dab9180b406a742180d6e6a"
|
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.0.0.tgz#ef987ed3d48391ac3dab9180b406a742180d6e6a"
|
||||||
|
|
||||||
|
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@^1.0.0:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149"
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
concat-map@0.0.1:
|
concat-map@0.0.1:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||||
@ -203,15 +241,33 @@ escape-string-regexp@^1.0.2:
|
|||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||||
|
|
||||||
|
esprima@^3.1.1:
|
||||||
|
version "3.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
|
||||||
|
|
||||||
figlet@^1.2.0:
|
figlet@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410"
|
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"
|
||||||
|
|
||||||
|
fs-extra@^3.0.1:
|
||||||
|
version "3.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291"
|
||||||
|
dependencies:
|
||||||
|
graceful-fs "^4.1.2"
|
||||||
|
jsonfile "^3.0.0"
|
||||||
|
universalify "^0.1.0"
|
||||||
|
|
||||||
fs.realpath@^1.0.0:
|
fs.realpath@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||||
|
|
||||||
glob@^7.0.0:
|
glob@^7.0.0, glob@^7.1.1:
|
||||||
version "7.1.2"
|
version "7.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -222,12 +278,22 @@ glob@^7.0.0:
|
|||||||
once "^1.3.0"
|
once "^1.3.0"
|
||||||
path-is-absolute "^1.0.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:
|
has-ansi@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||||
dependencies:
|
dependencies:
|
||||||
ansi-regex "^2.0.0"
|
ansi-regex "^2.0.0"
|
||||||
|
|
||||||
|
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:
|
inflight@^1.0.4:
|
||||||
version "1.0.6"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||||
@ -235,7 +301,7 @@ inflight@^1.0.4:
|
|||||||
once "^1.3.0"
|
once "^1.3.0"
|
||||||
wrappy "1"
|
wrappy "1"
|
||||||
|
|
||||||
inherits@2, inherits@~2.0.1:
|
inherits@2, inherits@^2.0.1, inherits@~2.0.1:
|
||||||
version "2.0.3"
|
version "2.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||||
|
|
||||||
@ -243,6 +309,14 @@ interpret@^1.0.0:
|
|||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
|
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
|
||||||
|
|
||||||
|
is-stream@^1.1.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
||||||
|
|
||||||
|
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:
|
isarray@~1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||||
@ -255,6 +329,19 @@ js-base64@^2.1.9:
|
|||||||
version "2.1.9"
|
version "2.1.9"
|
||||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce"
|
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce"
|
||||||
|
|
||||||
|
js-yaml@^3.8.3:
|
||||||
|
version "3.8.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6"
|
||||||
|
dependencies:
|
||||||
|
argparse "^1.0.7"
|
||||||
|
esprima "^3.1.1"
|
||||||
|
|
||||||
|
jsonfile@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.0.tgz#92e7c7444e5ffd5fa32e6a9ae8b85034df8347d0"
|
||||||
|
optionalDependencies:
|
||||||
|
graceful-fs "^4.1.6"
|
||||||
|
|
||||||
leakage@^0.3.0:
|
leakage@^0.3.0:
|
||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
|
resolved "https://registry.yarnpkg.com/leakage/-/leakage-0.3.0.tgz#15d698abdc76bbc6439601f4f3020e77e2d50c39"
|
||||||
@ -315,19 +402,19 @@ minimist@^1.2.0:
|
|||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
||||||
|
|
||||||
mongodb-core@2.1.12:
|
mongodb-core@2.1.13:
|
||||||
version "2.1.12"
|
version "2.1.13"
|
||||||
resolved "https://registry.yarnpkg.com/mongodb-core/-/mongodb-core-2.1.12.tgz#1531192511bc16ef160ac6ae0cc46776ffd8451d"
|
resolved "https://registry.yarnpkg.com/mongodb-core/-/mongodb-core-2.1.13.tgz#771ef638270ac993ab42984689ab824251b96a88"
|
||||||
dependencies:
|
dependencies:
|
||||||
bson "~1.0.4"
|
bson "~1.0.4"
|
||||||
require_optional "~1.0.0"
|
require_optional "~1.0.0"
|
||||||
|
|
||||||
mongodb@^2.2.28:
|
mongodb@^2.2.29:
|
||||||
version "2.2.28"
|
version "2.2.29"
|
||||||
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-2.2.28.tgz#d8ff45754366e03973fa259bf4f11447858da657"
|
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-2.2.29.tgz#36b244126f26766c5ebd6465b8ab5b542d6833c5"
|
||||||
dependencies:
|
dependencies:
|
||||||
es6-promise "3.2.1"
|
es6-promise "3.2.1"
|
||||||
mongodb-core "2.1.12"
|
mongodb-core "2.1.13"
|
||||||
readable-stream "2.2.7"
|
readable-stream "2.2.7"
|
||||||
|
|
||||||
nan@^2.3.2:
|
nan@^2.3.2:
|
||||||
@ -355,6 +442,10 @@ ora@^1.1.0:
|
|||||||
cli-spinners "^1.0.0"
|
cli-spinners "^1.0.0"
|
||||||
log-symbols "^1.0.2"
|
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:
|
path-is-absolute@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||||
@ -363,11 +454,15 @@ path-parse@^1.0.5:
|
|||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
|
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:
|
pretty-bytes@^4.0.2:
|
||||||
version "4.0.2"
|
version "4.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
|
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, process-nextick-args@~1.0.6:
|
||||||
version "1.0.7"
|
version "1.0.7"
|
||||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
|
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
|
||||||
|
|
||||||
@ -375,7 +470,15 @@ q@^1.5.0:
|
|||||||
version "1.5.0"
|
version "1.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1"
|
resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1"
|
||||||
|
|
||||||
readable-stream@2.2.7:
|
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"
|
||||||
|
|
||||||
|
readable-stream@2.2.7, readable-stream@^2.0.2, readable-stream@^2.1.5:
|
||||||
version "2.2.7"
|
version "2.2.7"
|
||||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.7.tgz#07057acbe2467b22042d36f98c5ad507054e95b1"
|
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.7.tgz#07057acbe2467b22042d36f98c5ad507054e95b1"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -397,6 +500,18 @@ reflect-metadata@^0.1.2:
|
|||||||
version "0.1.10"
|
version "0.1.10"
|
||||||
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.10.tgz#b4f83704416acad89988c9b15635d47e03b9344a"
|
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.10.tgz#b4f83704416acad89988c9b15635d47e03b9344a"
|
||||||
|
|
||||||
|
remove-trailing-separator@^1.0.1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz#69b062d978727ad14dc6b56ba4ab772fd8d70511"
|
||||||
|
|
||||||
|
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:
|
require_optional@~1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e"
|
resolved "https://registry.yarnpkg.com/require_optional/-/require_optional-1.0.1.tgz#4cf35a4247f64ca3df8c2ef208cc494b1ca8fc2e"
|
||||||
@ -433,9 +548,9 @@ rxjs@^5.3.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
symbol-observable "^1.0.1"
|
symbol-observable "^1.0.1"
|
||||||
|
|
||||||
safe-buffer@~5.0.1:
|
safe-buffer@~5.1.0:
|
||||||
version "5.0.1"
|
version "5.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7"
|
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
|
||||||
|
|
||||||
semver@^5.1.0, semver@^5.3.0:
|
semver@^5.1.0, semver@^5.3.0:
|
||||||
version "5.3.0"
|
version "5.3.0"
|
||||||
@ -479,6 +594,30 @@ smartenv@^2.0.0:
|
|||||||
smartq "^1.1.1"
|
smartq "^1.1.1"
|
||||||
typings-global "^1.0.14"
|
typings-global "^1.0.14"
|
||||||
|
|
||||||
|
smartfile@^4.2.11:
|
||||||
|
version "4.2.17"
|
||||||
|
resolved "https://registry.yarnpkg.com/smartfile/-/smartfile-4.2.17.tgz#9eba8f65eea7e4db51aa30562f6039815a88b125"
|
||||||
|
dependencies:
|
||||||
|
"@types/fs-extra" "3.x.x"
|
||||||
|
"@types/vinyl" "^2.0.0"
|
||||||
|
fs-extra "^3.0.1"
|
||||||
|
glob "^7.1.1"
|
||||||
|
js-yaml "^3.8.3"
|
||||||
|
require-reload "0.2.2"
|
||||||
|
smartpath "^3.2.8"
|
||||||
|
smartq "^1.1.1"
|
||||||
|
smartrequest "^1.0.4"
|
||||||
|
typings-global "^1.0.16"
|
||||||
|
vinyl "^2.0.2"
|
||||||
|
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.0, smartq@^1.1.1:
|
smartq@^1.1.0, smartq@^1.1.1:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.1.tgz#efb358705260d41ae18aef7ffd815f7b6fe17dd3"
|
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.1.tgz#efb358705260d41ae18aef7ffd815f7b6fe17dd3"
|
||||||
@ -486,6 +625,13 @@ smartq@^1.1.0, smartq@^1.1.1:
|
|||||||
typed-promisify "^0.3.0"
|
typed-promisify "^0.3.0"
|
||||||
typings-global "^1.0.14"
|
typings-global "^1.0.14"
|
||||||
|
|
||||||
|
smartrequest@^1.0.4:
|
||||||
|
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:
|
smartshell@^1.0.6:
|
||||||
version "1.0.6"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.6.tgz#27b1c79029784abe72ac7e91fe698b7ebecc6629"
|
resolved "https://registry.yarnpkg.com/smartshell/-/smartshell-1.0.6.tgz#27b1c79029784abe72ac7e91fe698b7ebecc6629"
|
||||||
@ -503,11 +649,15 @@ smartstring@^2.0.24:
|
|||||||
js-base64 "^2.1.9"
|
js-base64 "^2.1.9"
|
||||||
typings-global "^1.0.14"
|
typings-global "^1.0.14"
|
||||||
|
|
||||||
|
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.0:
|
||||||
version "1.0.2"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.2.tgz#b29e1f4e1125fa97a10382b8a533737b7491e179"
|
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
|
||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer "~5.0.1"
|
safe-buffer "~5.1.0"
|
||||||
|
|
||||||
strip-ansi@^3.0.0:
|
strip-ansi@^3.0.0:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
@ -515,6 +665,25 @@ strip-ansi@^3.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
ansi-regex "^2.0.0"
|
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"
|
||||||
|
|
||||||
supports-color@^2.0.0:
|
supports-color@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||||
@ -534,6 +703,13 @@ tapbundle@^1.0.14:
|
|||||||
smartq "^1.1.1"
|
smartq "^1.1.1"
|
||||||
typings-global "^1.0.16"
|
typings-global "^1.0.16"
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
type-detect@0.1.1:
|
type-detect@0.1.1:
|
||||||
version "0.1.1"
|
version "0.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"
|
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"
|
||||||
@ -546,18 +722,43 @@ typed-promisify@^0.3.0:
|
|||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/typed-promisify/-/typed-promisify-0.3.0.tgz#1ba0af5e444c87d8047406f18ce49092a1191853"
|
resolved "https://registry.yarnpkg.com/typed-promisify/-/typed-promisify-0.3.0.tgz#1ba0af5e444c87d8047406f18ce49092a1191853"
|
||||||
|
|
||||||
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.17:
|
typings-global@^1.0.14, typings-global@^1.0.16, typings-global@^1.0.17, typings-global@^1.0.19:
|
||||||
version "1.0.17"
|
version "1.0.19"
|
||||||
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.17.tgz#41edc331ccec3168289adc8849e1e255efbe7152"
|
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.19.tgz#3376a72d4de1e5541bf5702248ff64c3e6ea316c"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "^7.0.29"
|
|
||||||
semver "^5.3.0"
|
semver "^5.3.0"
|
||||||
smartshell "^1.0.6"
|
smartshell "^1.0.6"
|
||||||
|
|
||||||
|
universalify@^0.1.0:
|
||||||
|
version "0.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778"
|
||||||
|
|
||||||
util-deprecate@~1.0.1:
|
util-deprecate@~1.0.1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||||
|
|
||||||
|
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, vinyl@^2.0.2:
|
||||||
|
version "2.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.0.2.tgz#0a3713d8d4e9221c58f10ca16c0116c9e25eda7c"
|
||||||
|
dependencies:
|
||||||
|
clone "^1.0.0"
|
||||||
|
clone-buffer "^1.0.0"
|
||||||
|
clone-stats "^1.0.0"
|
||||||
|
cloneable-readable "^1.0.0"
|
||||||
|
is-stream "^1.1.0"
|
||||||
|
remove-trailing-separator "^1.0.1"
|
||||||
|
replace-ext "^1.0.0"
|
||||||
|
|
||||||
which@^1.2.12:
|
which@^1.2.12:
|
||||||
version "1.2.14"
|
version "1.2.14"
|
||||||
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
|
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
|
||||||
@ -567,3 +768,7 @@ which@^1.2.12:
|
|||||||
wrappy@1:
|
wrappy@1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user