Comparing version 5.0.0-alpha.9 to 5.0.0-alpha.10
@@ -1,2 +0,1 @@ | ||
/// <reference path="./_references.d.ts" /> | ||
var __extends = this.__extends || function (d, b) { | ||
@@ -3,0 +2,0 @@ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; |
@@ -1,3 +0,1 @@ | ||
/// <reference path="./_references.d.ts" /> | ||
import _Core = require('./lib/Core'); | ||
@@ -4,0 +2,0 @@ import _Model = require('./lib/Model'); |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import Bluebird = require('bluebird'); | ||
@@ -3,0 +2,0 @@ |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../../_references.d.ts" /> | ||
import cacheDirector = require('../CacheDirector'); | ||
@@ -3,0 +2,0 @@ import MongoDB = require('mongodb'); |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
export = ICacheDirector; | ||
@@ -3,0 +2,0 @@ |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../../_references.d.ts" /> | ||
import Bluebird = require('bluebird'); | ||
@@ -3,0 +2,0 @@ import cache = require('../Cache'); |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../../_references.d.ts" /> | ||
import cache = require('../Cache'); | ||
@@ -3,0 +2,0 @@ import Bluebird = require('bluebird'); |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
export = Configuration; | ||
@@ -7,3 +6,3 @@ | ||
port?: number; | ||
hosts?: { address: string, port?: number }[]; | ||
hosts?: { address: string; port?: number }[]; | ||
database?: string; | ||
@@ -10,0 +9,0 @@ username?: string; |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import Bluebird = require('bluebird'); | ||
@@ -3,0 +2,0 @@ import MongoDB = require('mongodb'); |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import Model = require('./Model'); | ||
import Model = require('./Model'); | ||
import General = require('./General'); | ||
@@ -4,0 +3,0 @@ import MongoDB = require('mongodb'); |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
export interface Callback<T> { | ||
@@ -3,0 +2,0 @@ (err: Error, object?: T): void; |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import instance = require('./Instance'); | ||
@@ -3,0 +2,0 @@ |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import MongoDB = require('mongodb'); | ||
import MongoDB = require('mongodb'); | ||
@@ -4,0 +3,0 @@ export interface Index { |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import iridium = require('./Core'); | ||
import iridium = require('./Core'); | ||
import Model = require('./Model'); | ||
@@ -4,0 +3,0 @@ import IPlugin = require('./Plugins'); |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import Core = require('./Core'); | ||
@@ -3,0 +2,0 @@ |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../../_references.d.ts" /> | ||
import http = require('http'); | ||
@@ -3,0 +2,0 @@ import Middleware = require('../Middleware'); |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import MongoDB = require('mongodb'); | ||
import MongoDB = require('mongodb'); | ||
import Skmatc = require('skmatc'); | ||
@@ -4,0 +3,0 @@ import Concoction = require('concoction'); |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import ModelInterfaces = require('./ModelInterfaces'); | ||
import ModelInterfaces = require('./ModelInterfaces'); | ||
import Bluebird = require('bluebird'); | ||
@@ -4,0 +3,0 @@ |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import Iridium = require('./Core'); | ||
import Iridium = require('./Core'); | ||
import ISchema = require('./Schema'); | ||
@@ -4,0 +3,0 @@ import MongoDB = require('mongodb'); |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import MongoDB = require('mongodb'); | ||
import MongoDB = require('mongodb'); | ||
import Model = require('./Model'); | ||
@@ -4,0 +3,0 @@ import Concoction = require('concoction'); |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import Iridium = require('./Core'); | ||
import Iridium = require('./Core'); | ||
import ISchema = require('./Schema'); | ||
@@ -4,0 +3,0 @@ import MongoDB = require('mongodb'); |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import MongoDB = require('mongodb'); | ||
import MongoDB = require('mongodb'); | ||
import Index = require('./Index'); | ||
@@ -4,0 +3,0 @@ import Hooks = require('./Hooks'); |
@@ -1,3 +0,2 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import Model = require('./Model'); | ||
import Model = require('./Model'); | ||
import ModelInterfaces = require('./ModelInterfaces'); | ||
@@ -4,0 +3,0 @@ import util = require('util'); |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
import core = require('./Core'); | ||
@@ -3,0 +2,0 @@ import ModelInterfaces = require('./ModelInterfaces'); |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../_references.d.ts" /> | ||
export = ISchema; | ||
@@ -3,0 +2,0 @@ |
@@ -1,2 +0,1 @@ | ||
/// <reference path="../../_references.d.ts" /> | ||
import _ = require('lodash'); | ||
@@ -3,0 +2,0 @@ import MongoDB = require('mongodb'); |
{ | ||
"name": "iridium", | ||
"version": "5.0.0-alpha.9", | ||
"version": "5.0.0-alpha.10", | ||
"author": "Benjamin Pannell <admin@sierrasoftworks.com>", | ||
@@ -27,2 +27,5 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users", | ||
}, | ||
"typescript": { | ||
"definition": "iridium.d.ts" | ||
}, | ||
"engines": { | ||
@@ -48,3 +51,4 @@ "node": ">= 0.10" | ||
"jshint": "^2.7.0", | ||
"typescript": ">=1.5.0-alpha" | ||
"typescript": ">=1.5.0-alpha", | ||
"dts-generator": "^1.4.1" | ||
}, | ||
@@ -51,0 +55,0 @@ "keywords": [ |
@@ -101,5 +101,3 @@ var __extends = this.__extends || function (d, b) { | ||
it("when a single document is retrieved", function () { | ||
return model.get().then(function (instance) { | ||
return chai.expect(core.cache.get(instance._id)).to.eventually.exist; | ||
}); | ||
return model.get().then(function (instance) { return chai.expect(core.cache.get(instance._id)).to.eventually.exist; }); | ||
}); | ||
@@ -106,0 +104,0 @@ it("when an instance is modified", function () { |
@@ -159,5 +159,3 @@ var __extends = this.__extends || function (d, b) { | ||
answer: 1 | ||
}) | ||
.then(function () { return core.Test.get(); }) | ||
.then(function (instance) { return chai.expect(instance.save({ $set: { answer: 10 } })).to.eventually.have.property('answer', 10); }); | ||
}).then(function () { return core.Test.get(); }).then(function (instance) { return chai.expect(instance.save({ $set: { answer: 10 } })).to.eventually.have.property('answer', 10); }); | ||
}); | ||
@@ -167,5 +165,3 @@ it("should allow you tp specify a custom update query and conditions for the update", function () { | ||
answer: 1 | ||
}) | ||
.then(function () { return core.Test.get(); }) | ||
.then(function (instance) { return chai.expect(instance.save({ answer: { $lt: 5 } }, { $set: { answer: 10 } })).to.eventually.have.property('answer', 10); }); | ||
}).then(function () { return core.Test.get(); }).then(function (instance) { return chai.expect(instance.save({ answer: { $lt: 5 } }, { $set: { answer: 10 } })).to.eventually.have.property('answer', 10); }); | ||
}); | ||
@@ -175,5 +171,3 @@ it("should return a promise for the instance", function () { | ||
answer: 1 | ||
}) | ||
.then(function () { return core.Test.get(); }) | ||
.then(function (instance) { return chai.expect(instance.save()).to.eventually.equal(instance); }); | ||
}).then(function () { return core.Test.get(); }).then(function (instance) { return chai.expect(instance.save()).to.eventually.equal(instance); }); | ||
}); | ||
@@ -183,5 +177,3 @@ it("should allow the use of a callback instead of promises", function (done) { | ||
answer: 1 | ||
}) | ||
.then(function () { return core.Test.get(); }) | ||
.then(function (instance) { | ||
}).then(function () { return core.Test.get(); }).then(function (instance) { | ||
instance.save(function (err, result) { | ||
@@ -188,0 +180,0 @@ if (err) |
@@ -25,3 +25,4 @@ var __extends = this.__extends || function (d, b) { | ||
chai.expect(function () { | ||
new Iridium.Model(null, function () { }, 'test', { _id: false }); | ||
new Iridium.Model(null, function () { | ||
}, 'test', { _id: false }); | ||
}).to.throw("You failed to provide a valid Iridium core for this model"); | ||
@@ -36,9 +37,12 @@ }); | ||
chai.expect(function () { | ||
new Iridium.Model(core, function () { }, null, { _id: false }); | ||
new Iridium.Model(core, function () { | ||
}, null, { _id: false }); | ||
}).to.throw("You failed to provide a valid collection name for this model"); | ||
chai.expect(function () { | ||
new Iridium.Model(core, function () { }, '', { _id: false }); | ||
new Iridium.Model(core, function () { | ||
}, '', { _id: false }); | ||
}).to.throw("You failed to provide a valid collection name for this model"); | ||
chai.expect(function () { | ||
new Iridium.Model(core, function () { }, 4, { _id: false }); | ||
new Iridium.Model(core, function () { | ||
}, 4, { _id: false }); | ||
}).to.throw("You failed to provide a valid collection name for this model"); | ||
@@ -48,16 +52,21 @@ }); | ||
chai.expect(function () { | ||
new Iridium.Model(core, function () { }, 'test', null); | ||
new Iridium.Model(core, function () { | ||
}, 'test', null); | ||
}).to.throw("You failed to provide a valid schema for this model"); | ||
chai.expect(function () { | ||
new Iridium.Model(core, function () { }, 'test', { id: false }); | ||
new Iridium.Model(core, function () { | ||
}, 'test', { id: false }); | ||
}).to.throw("You failed to provide a valid schema for this model"); | ||
}); | ||
it("should correctly set the core", function () { | ||
chai.expect(new Iridium.Model(core, function () { }, 'test', { _id: false }).core).to.equal(core); | ||
chai.expect(new Iridium.Model(core, function () { | ||
}, 'test', { _id: false }).core).to.equal(core); | ||
}); | ||
it("should correctly set the collectionName", function () { | ||
chai.expect(new Iridium.Model(core, function () { }, 'test', { _id: false }).collectionName).to.equal('test'); | ||
chai.expect(new Iridium.Model(core, function () { | ||
}, 'test', { _id: false }).collectionName).to.equal('test'); | ||
}); | ||
it("should correctly set the schema", function () { | ||
chai.expect(new Iridium.Model(core, function () { }, 'test', { _id: false }).schema).to.eql({ _id: false }); | ||
chai.expect(new Iridium.Model(core, function () { | ||
}, 'test', { _id: false }).schema).to.eql({ _id: false }); | ||
}); | ||
@@ -110,3 +119,4 @@ }); | ||
it("should throw an error if you attempt to access it before connecting to the database", function () { | ||
var model = new Iridium.Model(new Iridium.Core('mongodb://localhost/test'), function () { }, 'test', { _id: false }); | ||
var model = new Iridium.Model(new Iridium.Core('mongodb://localhost/test'), function () { | ||
}, 'test', { _id: false }); | ||
chai.expect(function () { return model.collection; }).to.throw("Iridium Core not connected to a database."); | ||
@@ -354,3 +364,4 @@ }); | ||
it("should return a promise immediately", function () { | ||
chai.expect(model.find().forEach(function (i) { })).to.be.instanceof(Promise); | ||
chai.expect(model.find().forEach(function (i) { | ||
})).to.be.instanceof(Promise); | ||
}); | ||
@@ -357,0 +368,0 @@ it("should resolve the promise after all handlers have been dispatched", function () { |
@@ -12,3 +12,4 @@ var _this = this; | ||
core.register({ | ||
newInstance: function (instance, model) { }, | ||
newInstance: function (instance, model) { | ||
}, | ||
validate: [] | ||
@@ -19,4 +20,6 @@ }); | ||
core.register({ | ||
newModel: function (model) { }, | ||
newInstance: function (instance, model) { }, | ||
newModel: function (model) { | ||
}, | ||
newInstance: function (instance, model) { | ||
}, | ||
validate: [] | ||
@@ -48,3 +51,4 @@ }); | ||
core.register({ | ||
newModel: function (model) { }, | ||
newModel: function (model) { | ||
}, | ||
validate: [] | ||
@@ -55,4 +59,6 @@ }); | ||
core.register({ | ||
newModel: function (model) { }, | ||
newInstance: function (instance, model) { }, | ||
newModel: function (model) { | ||
}, | ||
newInstance: function (instance, model) { | ||
}, | ||
validate: [] | ||
@@ -64,3 +70,4 @@ }); | ||
core.register({ | ||
newModel: function (model) { }, | ||
newModel: function (model) { | ||
}, | ||
newInstance: function (instance, model) { | ||
@@ -78,3 +85,4 @@ wasCalled = true; | ||
core.register({ | ||
newModel: function (model) { }, | ||
newModel: function (model) { | ||
}, | ||
newInstance: function (instance, model) { | ||
@@ -93,4 +101,6 @@ wasCalled = true; | ||
core.register({ | ||
newModel: function (model) { }, | ||
newInstance: function (instance, model) { } | ||
newModel: function (model) { | ||
}, | ||
newInstance: function (instance, model) { | ||
} | ||
}); | ||
@@ -100,3 +110,4 @@ }); | ||
core.register({ | ||
newInstance: function (instance, model) { }, | ||
newInstance: function (instance, model) { | ||
}, | ||
validate: Skmatc.create(function (schema) { return schema == 'Test'; }, function (schema, data) { return _this.assert(data == 'test'); }) | ||
@@ -107,3 +118,4 @@ }); | ||
core.register({ | ||
newInstance: function (instance, model) { }, | ||
newInstance: function (instance, model) { | ||
}, | ||
validate: [Skmatc.create(function (schema) { return schema == 'Test'; }, function (schema, data) { return _this.assert(data == 'test'); })] | ||
@@ -110,0 +122,0 @@ }); |
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "ES5", | ||
"sourceMap": true | ||
"target": "es5", | ||
"sourceMap": true, | ||
"declaration": false | ||
}, | ||
@@ -32,4 +33,4 @@ "files": [ | ||
"test/Plugins.ts", | ||
"test/Valdiation.ts" | ||
"test/Validation.ts" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
479948
12
97
6724