From d0c7b4040f90fc5eb70d068fb0bcce21b42f3fbf Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Wed, 22 Apr 2015 08:25:28 +0200 Subject: [PATCH] Explicitly reference the _references.d.ts file for all lib files --- lib/Cache.ts | 2 +- lib/CacheDirector.js.map | 2 +- lib/CacheDirector.ts | 1 + lib/Configuration.js.map | 2 +- lib/Configuration.ts | 1 + lib/Core.js | 7 +------ lib/Core.js.map | 2 +- lib/Core.ts | 8 +------- lib/General.js | 1 + lib/General.js.map | 2 +- lib/General.ts | 1 + lib/Hooks.js | 1 - lib/Hooks.js.map | 2 +- lib/Hooks.ts | 3 +-- lib/Instance.js | 6 ------ lib/Instance.js.map | 2 +- lib/Instance.ts | 8 +------- lib/Middleware.js.map | 2 +- lib/Middleware.ts | 1 + lib/Model.js | 1 + lib/Model.js.map | 2 +- lib/Model.ts | 2 +- lib/Plugins.js | 1 - lib/Plugins.js.map | 2 +- lib/Plugins.ts | 3 +-- lib/Schema.js.map | 2 +- lib/Schema.ts | 1 + lib/cacheControllers/IDDirector.ts | 1 + lib/caches/MemoryCache.ts | 2 +- lib/caches/NoOpCache.ts | 2 +- lib/middleware/Express.ts | 1 + lib/utils/Omnom.ts | 5 +---- test/support/chai.js | 1 + test/support/chai.js.map | 2 +- test/support/chai.ts | 1 + test/support/config.ts | 1 + 36 files changed, 33 insertions(+), 51 deletions(-) diff --git a/lib/Cache.ts b/lib/Cache.ts index 386ff7d..cd7cf0f 100644 --- a/lib/Cache.ts +++ b/lib/Cache.ts @@ -1,4 +1,4 @@ -/// +/// import Promise = require('bluebird'); export = ICache; diff --git a/lib/CacheDirector.js.map b/lib/CacheDirector.js.map index 37bc429..5d0b8a0 100644 --- a/lib/CacheDirector.js.map +++ b/lib/CacheDirector.js.map @@ -1 +1 @@ -{"version":3,"file":"CacheDirector.js","sourceRoot":"","sources":["CacheDirector.ts"],"names":[],"mappings":"AAKC"} \ No newline at end of file +{"version":3,"file":"CacheDirector.js","sourceRoot":"","sources":["CacheDirector.ts"],"names":[],"mappings":"AAMC"} \ No newline at end of file diff --git a/lib/CacheDirector.ts b/lib/CacheDirector.ts index d2867c8..c034789 100644 --- a/lib/CacheDirector.ts +++ b/lib/CacheDirector.ts @@ -1,3 +1,4 @@ +/// export = ICacheDirector; interface ICacheDirector { diff --git a/lib/Configuration.js.map b/lib/Configuration.js.map index c47a3d8..2406aa6 100644 --- a/lib/Configuration.js.map +++ b/lib/Configuration.js.map @@ -1 +1 @@ -{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["Configuration.ts"],"names":[],"mappings":"AASC"} \ No newline at end of file +{"version":3,"file":"Configuration.js","sourceRoot":"","sources":["Configuration.ts"],"names":[],"mappings":"AAUC"} \ No newline at end of file diff --git a/lib/Configuration.ts b/lib/Configuration.ts index 59572fc..d6f0d77 100644 --- a/lib/Configuration.ts +++ b/lib/Configuration.ts @@ -1,3 +1,4 @@ +/// export = Configuration; interface Configuration { diff --git a/lib/Core.js b/lib/Core.js index b5b290b..0f09c09 100644 --- a/lib/Core.js +++ b/lib/Core.js @@ -1,9 +1,4 @@ -/// -/// -/// -/// -/// -/// +/// var Promise = require('bluebird'); var MongoDB = require('mongodb'); var expressMiddleware = require('./middleware/Express'); diff --git a/lib/Core.js.map b/lib/Core.js.map index e36b211..aa8cb84 100644 --- a/lib/Core.js.map +++ b/lib/Core.js.map @@ -1 +1 @@ -{"version":3,"file":"Core.js","sourceRoot":"","sources":["Core.ts"],"names":["Core","Core.constructor","Core.plugins","Core.settings","Core.connection","Core.url","Core.cache","Core.register","Core.connect","Core.close","Core.express"],"mappings":"AAAA,kDAAkD;AAClD,wDAAwD;AACxD,sDAAsD;AACtD,0DAA0D;AAC1D,gCAAgC;AAChC,mCAAmC;AAEnC,IAAO,OAAO,WAAW,UAAU,CAAC,CAAC;AACrC,IAAO,OAAO,WAAW,SAAS,CAAC,CAAC;AAWpC,IAAO,iBAAiB,WAAW,sBAAsB,CAAC,CAAC;AAG3D,IAAO,SAAS,W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IACHA,sBAAOA,GAAPA;QACIU,MAAMA,CAACA,iBAAiBA,CAACA,wBAAwBA,CAACA,IAAIA,CAACA,CAACA;IAC5DA,CAACA;IACLV,WAACA;AAADA,CAACA,AApJD,IAoJC;AAtJD,iBAAS,IAAI,CAAC"} \ No newline at end of file +{"version":3,"file":"Core.js","sourceRoot":"","sources":["Core.ts"],"names":["Core","Core.constructor","Core.plugins","Core.settings","Core.connection","Core.url","Core.cache","Core.register","Core.connect","Core.close","Core.express"],"mappings":"AACA,AADA,4CAA4C;AAC5C,IAAO,OAAO,WAAW,UAAU,CAAC,CAAC;AACrC,IAAO,OAAO,WAAW,SAAS,CAAC,CAAC;AAWpC,IAAO,iBAAiB,WAAW,sBAAsB,CAAC,CAAC;AAG3D,IAAO,SAAS,WAAW,oBAAoB,CAAC,CAAC;AAGjD,IAAI,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAItE,IAAM,IAAI;IAkFNA,SAlFEA,IAAIA,CAkFMA,GAAoBA,EAAEA,MAAeA;QAjFzCC,aAAQA,GAAcA,EAAEA,CAACA;QAIzBA,WAAMA,GAAUA,IAAIA,SAASA,EAAEA,CAACA;QA+EpCA,IAAIA,IAAIA,GAAGA,KAAKA,CAACA,SAASA,CAACA,KAAKA,CAACA,IAAIA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;QACpDA,GAAGA,GAAGA,MAAMA,GAAGA,IAAIA,CAACA;QACpBA,GAAGA,CAAAA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,IAAIA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAClCA,EAAEA,CAAAA,CAACA,OAAOA,IAAIA,CAACA,CAACA,CAACA,IAAIA,QAAQA,CAACA;gBAC1BA,GAAGA,GAAGA,IAAIA,CAACA,CAACA,CAACA,CAACA;YAClBA,IAAIA,CAACA,EAAEA,CAAAA,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AQA,CAACA,CAACA;IACzBA,CAACA;IAEDR;;;OAGGA;IACHA,oBAAKA,GAALA;QACIS,IAAIA,IAAIA,GAAGA,IAAIA,CAACA;QAChBA,MAAMA,CAACA,OAAOA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA;YAC3B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC;YACnC,IAAI,IAAI,GAAe,IAAI,CAAC,WAAW,CAAC;YACxC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC,CAACA,CAACA;IACPA,CAACA;IAEDT;;;;OAIGA;IACHA,sBAAOA,GAAPA;QACIU,MAAMA,CAACA,iBAAiBA,CAACA,wBAAwBA,CAACA,IAAIA,CAACA,CAACA;IAC5DA,CAACA;IACLV,WAACA;AAADA,CAACA,AApJD,IAoJC;AAtJD,iBAAS,IAAI,CAAC"} \ No newline at end of file diff --git a/lib/Core.ts b/lib/Core.ts index 8dfb067..369bb6f 100644 --- a/lib/Core.ts +++ b/lib/Core.ts @@ -1,10 +1,4 @@ -/// -/// -/// -/// -/// -/// - +/// import Promise = require('bluebird'); import MongoDB = require('mongodb'); import _ = require('lodash'); diff --git a/lib/General.js b/lib/General.js index 07146e8..41c4924 100644 --- a/lib/General.js +++ b/lib/General.js @@ -1 +1,2 @@ +/// //# sourceMappingURL=General.js.map \ No newline at end of file diff --git a/lib/General.js.map b/lib/General.js.map index 33baafa..45f2e6d 100644 --- a/lib/General.js.map +++ b/lib/General.js.map @@ -1 +1 @@ -{"version":3,"file":"General.js","sourceRoot":"","sources":["General.ts"],"names":[],"mappings":"AAmBC"} \ No newline at end of file +{"version":3,"file":"General.js","sourceRoot":"","sources":["General.ts"],"names":[],"mappings":"AACA,AADA,4CAA4C;AAoB3C"} \ No newline at end of file diff --git a/lib/General.ts b/lib/General.ts index 1086b1d..d6ce8df 100644 --- a/lib/General.ts +++ b/lib/General.ts @@ -1,3 +1,4 @@ +/// export interface Callback { (err: Error, object: T): void; } diff --git a/lib/Hooks.js b/lib/Hooks.js index 1072b7a..7496668 100644 --- a/lib/Hooks.js +++ b/lib/Hooks.js @@ -1,2 +1 @@ -/// //# sourceMappingURL=Hooks.js.map \ No newline at end of file diff --git a/lib/Hooks.js.map b/lib/Hooks.js.map index c71716d..c8ee2f0 100644 --- a/lib/Hooks.js.map +++ b/lib/Hooks.js.map @@ -1 +1 @@ -{"version":3,"file":"Hooks.js","sourceRoot":"","sources":["Hooks.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAUzD"} \ No newline at end of file +{"version":3,"file":"Hooks.js","sourceRoot":"","sources":["Hooks.ts"],"names":[],"mappings":"AASC"} \ No newline at end of file diff --git a/lib/Hooks.ts b/lib/Hooks.ts index 68521be..5ff82bc 100644 --- a/lib/Hooks.ts +++ b/lib/Hooks.ts @@ -1,5 +1,4 @@ -/// - +/// import instance = require('./Instance'); export interface IHooks { diff --git a/lib/Instance.js b/lib/Instance.js index 5edba26..62e77fe 100644 --- a/lib/Instance.js +++ b/lib/Instance.js @@ -1,9 +1,3 @@ -/// -/// -/// -/// -/// -/// var _ = require('lodash'); var Promise = require('bluebird'); var Instance = (function () { diff --git a/lib/Instance.js.map b/lib/Instance.js.map index 5ad9a90..418262e 100644 --- a/lib/Instance.js.map +++ b/lib/Instance.js.map @@ -1 +1 @@ -{"version":3,"file":"Instance.js","sourceRoot":"","sources":["Instance.ts"],"names":["Instance","Instance.constructor","Instance.document","Instance.save","Instance.update","Instance.refresh","Instance.delete","Instance.remove","Instance.first","Instance.select"],"mappings":"AAAA,kDAAkD;AAClD,wDAAwD;AACxD,sDAAsD;AACtD,0DAA0D;AAC1D,gCAAgC;AAChC,iCAAiC;AAKjC,IAAO,CAAC,WAAW,QAAQ,CAAC,CAAC;AAC7B,IAAO,OAAO,WAAW,UAAU,CAAC,CA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;QACLA,CAACA,CAACA,CAACA;QAEHA,MAAMA,CAACA,OAAOA,CAACA;IACnBA,CAACA;IACLT,eAACA;AAADA,CAACA,AA9PD,IA8PC;AAEiB,AAAlB,iBAAS,QAAQ,CAAC"} \ No newline at end of file +{"version":3,"file":"Instance.js","sourceRoot":"","sources":["Instance.ts"],"names":["Instance","Instance.constructor","Instance.document","Instance.save","Instance.update","Instance.refresh","Instance.delete","Instance.remove","Instance.first","Instance.select"],"mappings":"AAIA,IAAO,CAAC,WAAW,QAAQ,CAAC,CAAC;AAC7B,IAAO,OAAO,WAAW,UAAU,CAAC,CAAC;AAIrC,IAAM,QAAQ;IACVA;;;;;;;;;;;OAWGA;IACHA,SAbEA,QAAQA,CAaEA,KAAwCA,EAAEA,QAAmBA,EAAEA,KAAsBA,EAAEA,SAA0BA;QAbjIC,iBA8PCA;QAjP8EA,qBAAsBA,GAAtBA,aAAsBA;QAAEA,yBAA0BA,GAA1BA,iBAA0BA;QACzHA,IAAIA,CAACA,MAAMA,GAAGA,KAAKA,CAACA;QAEpBA,IAAIA,CAACA,MAAMA,GAAGA,CAACA,CAACA,KAAKA,CAACA;QACtBA,IAAIA,CAACA,UAAUA,GAAGA,SAASA,CAACA;QAC5BA,IAAIA,CAACA,SAASA,GAAGA,QAAQA,CAACA;QAC1BA,IAAIA,CAACA,SAASA,GAAGA,CAACA,CAACA,SAASA,CAACA,QAAQA,CAACA,CAACA;QAEvCA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,CAACA,OAAOA,EAACA,UAACA,MAAeA;YACtCA,EAAEA,CAACA,CAACA,MAAMA,CAACA,WAAWA,CAACA;gBAACA,MAAMA,CAACA,WAAWA,CAACA,KAAIA,EAAEA,KAAKA,CAACA,CAACA;QAC5DA,CAACA,CAACA,CAACA;IACPA,CAACA;IAWDD,sBAAIA,8BAAQA;QAHZA;;WAEGA;aACHA;YACIE,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA;QAC1BA,CAACA;;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AAEA,CAACA;QAErCA,CAACA,CAACA,IAAIA,CAACA,UAAUA,EAAEA,UAACA,KAAQA,EAAEA,GAAGA;YAC7BA,EAAEA,CAACA,CAACA,SAASA,CAACA,IAAIA,CAACA,KAAIA,EAAEA,KAAKA,EAAEA,GAAGA,CAACA,CAACA,CAACA,CAACA;gBACnCA,EAAEA,CAACA,CAACA,OAAOA,CAACA;oBAACA,OAAOA,CAACA,IAAIA,CAACA,KAAKA,CAACA,CAACA;gBACjCA,IAAIA;oBAACA,OAAOA,CAACA,GAAGA,CAACA,GAAGA,KAAKA,CAACA;YAC9BA,CAACA;QACLA,CAACA,CAACA,CAACA;QAEHA,MAAMA,CAACA,OAAOA,CAACA;IACnBA,CAACA;IACLT,eAACA;AAADA,CAACA,AA9PD,IA8PC;AAEiB,AAAlB,iBAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib/Instance.ts b/lib/Instance.ts index b568150..e14cb79 100644 --- a/lib/Instance.ts +++ b/lib/Instance.ts @@ -1,10 +1,4 @@ -/// -/// -/// -/// -/// -/// - +/// import iridium = require('./Core'); import model = require('./Model'); import IPlugin = require('./Plugins'); diff --git a/lib/Middleware.js.map b/lib/Middleware.js.map index 029f1dd..37631a3 100644 --- a/lib/Middleware.js.map +++ b/lib/Middleware.js.map @@ -1 +1 @@ -{"version":3,"file":"Middleware.js","sourceRoot":"","sources":["Middleware.ts"],"names":[],"mappings":"AAKC"} \ No newline at end of file +{"version":3,"file":"Middleware.js","sourceRoot":"","sources":["Middleware.ts"],"names":[],"mappings":"AAMC"} \ No newline at end of file diff --git a/lib/Middleware.ts b/lib/Middleware.ts index 02e4053..823b681 100644 --- a/lib/Middleware.ts +++ b/lib/Middleware.ts @@ -1,3 +1,4 @@ +/// import Core = require('./Core'); export = IMiddlewareFactory; diff --git a/lib/Model.js b/lib/Model.js index 6435f3c..10bbc6b 100644 --- a/lib/Model.js +++ b/lib/Model.js @@ -1,3 +1,4 @@ +/// var MongoDB = require('mongodb'); var Skmatc = require('skmatc'); var Concoction = require('concoction'); diff --git a/lib/Model.js.map b/lib/Model.js.map index 0ea4dc5..fb90f7f 100644 --- a/lib/Model.js.map +++ b/lib/Model.js.map @@ -1 +1 @@ -{"version":3,"file":"Model.js","sourceRoot":"","sources":["Model.ts"],"names":["Model","Model.constructor","Model.options","Model.helpers","Model.handlers","Model.schema","Model.core","Model.collection","Model.collectionName","Model.cacheDirector","Model.cache","Model.wrap","Model.find","Model.get","Model.findOne","Model.create","Model.insert","Model.update","Model.count","Model.remove","Model.ensureIndex","Model.ensureIndices","ModelSpecificInstance","ModelSpecificInstance.constructor","ModelSpecificInstance.build","ModelHelpers","ModelHelpers.constructor","ModelHelpers.transform","ModelHelpers.validate","ModelHelpers.selectOne","ModelHelpers.identifierField","ModelHelpers.selectOneDownstream","ModelHelpers.wrapDocument","ModelHelpers.diff","ModelHandlers","ModelHandlers.constructor","ModelHandlers.model","ModelHandlers.documentsReceived","ModelHandlers.creatingDocuments","ModelHandlers.savingDocument","ModelCache","ModelCache.constructor","ModelCache.model","ModelCache.set","ModelCache.get","ModelCache.clear"],"mappings":"AAAA,IAAO,OAAO,WAAW,SAAS,CAAC,CAAC;AACpC,IAAO,MAAM,WAAW,QAAQ,CAAC,CAAC;AAClC,IAAO,UAAU,WAAW,YAAY,CAAC,CAAC;AAC1C,IAAO,OAAO,WAAW,UAAU,CAAC,CAAC;AAErC,IAAO,CAAC,WAAW,QAAQ,CAAC,CAAC;AAE7B,IAAO,OAAO,WAAW,QAAQ,CAAC,CAAC;AAWnC,IAAO,iBAAiB,WAAW,+BAA+B,CAAC,CAAC;AAEpE,IAAO,KAAK,WAAW,eAAe,CAAC,CAAC;AAMxC,AAJA;;;GAGG;IACU,KAAK;IACdA;;;;;;;;OAQGA;IACHA,SAVSA,KAAKA,CAUFA,IAAaA,EAAEA,YAAYA,EAAEA,UAAkBA,EAAEA,MAAeA,EAAEA,OAAiDA;QAAjDC,uBAAiDA,GAAjDA,YAAiDA;QAG3HA,AADA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ACA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,CAAIA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA,CAACA;IACvFA,CAACA;IAEDJ,0BAAKA,GAALA,UAAMA,UAAeA;QACjBK,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,IAAIA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,CAACA,KAAKA,CAACA,UAAUA,CAACA,CAACA;YAACA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,KAAKA,CAACA,CAACA;QAC5GA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA,CAACA;IACtFA,CAACA;IACLL,iBAACA;AAADA,CAACA,AAxBD,IAwBC"} \ No newline at end of file +{"version":3,"file":"Model.js","sourceRoot":"","sources":["Model.ts"],"names":["Model","Model.constructor","Model.options","Model.helpers","Model.handlers","Model.schema","Model.core","Model.collection","Model.collectionName","Model.cacheDirector","Model.cache","Model.wrap","Model.find","Model.get","Model.findOne","Model.create","Model.insert","Model.update","Model.count","Model.remove","Model.ensureIndex","Model.ensureIndices","ModelSpecificInstance","ModelSpecificInstance.constructor","ModelSpecificInstance.build","ModelHelpers","ModelHelpers.constructor","ModelHelpers.transform","ModelHelpers.validate","ModelHelpers.selectOne","ModelHelpers.identifierField","ModelHelpers.selectOneDownstream","ModelHelpers.wrapDocument","ModelHelpers.diff","ModelHandlers","ModelHandlers.constructor","ModelHandlers.model","ModelHandlers.documentsReceived","ModelHandlers.creatingDocuments","ModelHandlers.savingDocument","ModelCache","ModelCache.constructor","ModelCache.model","ModelCache.set","ModelCache.get","ModelCache.clear"],"mappings":"AACA,AADA,4CAA4C;AAC5C,IAA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ACA;YAACA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,KAAKA,CAACA,CAACA;QAC5GA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,EAAEA,KAAKA,CAACA,CAACA;IAC3FA,CAACA;IAEDH,wBAAGA,GAAHA,UAAOA,UAAeA;QAClBI,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,IAAIA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,CAACA,KAAKA,CAACA,UAAUA,CAACA,CAACA;YAACA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAAIA,IAAIA,CAACA,CAACA;QAC9GA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,CAAIA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA,CAACA;IACvFA,CAACA;IAEDJ,0BAAKA,GAALA,UAAMA,UAAeA;QACjBK,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,IAAIA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,CAACA,KAAKA,CAACA,UAAUA,CAACA,CAACA;YAACA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,KAAKA,CAACA,CAACA;QAC5GA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA,CAACA;IACtFA,CAACA;IACLL,iBAACA;AAADA,CAACA,AAxBD,IAwBC"} \ No newline at end of file diff --git a/lib/Model.ts b/lib/Model.ts index d318605..7e8fd82 100644 --- a/lib/Model.ts +++ b/lib/Model.ts @@ -1 +1 @@ -import MongoDB = require('mongodb'); import Skmatc = require('skmatc'); import Concoction = require('concoction'); import Promise = require('bluebird'); import util = require('util'); import _ = require('lodash'); import Iridium = require('./Core'); import instance = require('./Instance'); import ISchema = require('./Schema'); import hooks = require('./Hooks'); import IPlugin = require('./Plugins'); import cache = require('./Cache'); import CacheDirector = require('./CacheDirector'); import general = require('./General'); import noOpCache = require('./caches/NoOpCache'); import memoryCache = require('./caches/MemoryCache'); import idCacheController = require('./cacheControllers/IDDirector'); import Omnom = require('./utils/Omnom'); /** * An Iridium Model which represents a structured MongoDB collection * @class */ export class Model implements IModel { /** * Creates a new Iridium model representing a given ISchema and backed by a collection whose name is specified * @param {Iridium} core The Iridium core that this model should use for database access * @param {String} collection The name of the collection within the database which should be used by this model * @param {schema} schema The schema defining the data validations to be performed on the model * @param {IModelOptions} options The options dictating the behaviour of the model * @returns {Model} * @constructor */ constructor(core: Iridium, instanceType, collection: string, schema: ISchema, options: IModelOptions = {}) { // Allow instantiation doing `require('iridium').Model(db, 'collection', {})` if (!(this instanceof Model)) return new Model(core, instanceType, collection, schema, options); if (!(core instanceof Iridium)) throw new Error("You failed to provide a valid Iridium core for this model"); if (typeof instanceType != 'function') throw new Error("You failed to provide a valid instance constructor for this model"); if (typeof collection != 'string' || !collection) throw new Error("You failed to provide a valid collection name for this model"); if (!_.isPlainObject(schema) || !_.keys(schema).length) throw new Error("You failed to provide a valid schema for this model"); options = options || {}; _.defaults(options, >{ hooks: {}, transforms: [ new Concoction.Rename({ _id: 'id' }), new Concoction.Convert({ id: { apply: function (value) { return (value && value.id) ? new MongoDB.ObjectID(value.id).toHexString() : value; }, reverse: function (value) { if (value === null || value === undefined) return undefined; if (value && /^[a-f0-9]{24}$/.test(value)) return MongoDB.ObjectID.createFromHexString(value); return value; } } }) ], cache: new idCacheController() }); this._core = core; this._collection = collection; this._schema = schema; this._options = options; core.plugins.forEach(function (plugin: IPlugin) { if (plugin.newModel) plugin.newModel(this); }); this._cache = new ModelCache(this); this._Instance = new ModelSpecificInstance(this, instanceType); this._helpers = new ModelHelpers(this); this._handlers = new ModelHandlers(this); } private _options: IModelOptions; /** * Gets the options provided when instantiating this model * @public * @returns {IModelOptions} * @description * This is intended to be consumed by plugins which require any configuration * options. Changes made to this object after the {plugin.newModel} hook are * called will not have any effect on this model. */ get options(): IModelOptions { return this._options; } private _helpers: ModelHelpers; /** * Provides helper methods used by Iridium for common tasks * @returns {ModelHelpers} */ get helpers(): ModelHelpers { return this._helpers; } private _handlers: ModelHandlers; /** * Provides helper methods used by Iridium for hook delegation and common processes * @returns {ModelHandlers} */ get handlers(): ModelHandlers { return this._handlers; } private _schema: ISchema; /** * Gets the ISchema dictating the data structure represented by this model * @public * @returns {schema} */ get schema(): ISchema { return this._schema; } private _core: Iridium; /** * Gets the Iridium core that this model is associated with * @public * @returns {Iridium} */ get core(): Iridium { return this._core; } private _collection: string; /** * Gets the underlying MongoDB collection from which this model's documents are retrieved * @public * @returns {Collection} */ get collection(): MongoDB.Collection { return this.core.connection.collection(this._collection); } /** * Gets the name of the underlying MongoDB collection from which this model's documents are retrieved * @public */ get collectionName(): string { return this._collection; } /** * Sets the name of the underlying MongoDB collection from which this model's documents are retrieved * @public */ set collectionName(value: string) { this._collection = value; } private _cacheDirector: CacheDirector; /** * Gets the cache controller which dictates which queries will be cached, and under which key * @public * @returns {CacheDirector} */ get cacheDirector(): CacheDirector { return this._cacheDirector; } private _cache: ModelCache; /** * Gets the cache responsible for storing objects for quick retrieval under certain conditions * @public * @returns {ModelCache} */ get cache(): ModelCache { return this._cache; } private _Instance: ModelSpecificInstance; /** * Wraps the given document using the instance constructor provided for this model * @public * @param {TDocument} document The document to wrap in an instance object * @param {Boolean} isNew Whether the document is present in the database or not * @param {Boolean} isPartial Whether the document contains all properties defined in the database * @returns {function(Object): Instance} * @constructor */ wrap(document: TDocument, isNew: boolean = true, isPartial: boolean = false): TInstance { return this._Instance.build(document, isNew, isPartial); } /** * Retrieves all documents in the collection and wraps them as instances * @param {function(Error, TInstance[])} callback An optional callback which will be triggered when results are available * @returns {Promise} */ find(callback?: general.Callback): Promise; /** * Returns all documents in the collection which match the conditions and wraps them as instances * @param {Object} conditions The MongoDB query dictating which documents to return * @param {function(Error, TInstance[])} callback An optional callback which will be triggered when results are available * @returns {Promise} */ find(conditions: any, callback?: general.Callback): Promise; /** * Returns all documents in the collection which match the conditions * @param {Object} conditions The MongoDB query dictating which documents to return * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance[])} callback An optional callback which will be triggered when results are available * @returns {Promise} */ find(conditions: any, options: QueryOptions, callback?: general.Callback): Promise; find(conditions?: any, options?: QueryOptions, callback?: general.Callback): Promise { if (typeof options == 'function') { callback = >options; options = {}; } if (typeof conditions == 'function') { callback = >conditions; conditions = {}; options = {}; } conditions = conditions || {}; options = options || {}; _.defaults(options, { }); return Promise.resolve().then(() => { if (options.fields) this.helpers.transform.reverse(options.fields); if (!_.isPlainObject(conditions)) conditions = this.helpers.selectOneDownstream(conditions); this.helpers.transform.reverse(conditions); var cursor = this.collection.find(conditions, { limit: options.limit, sort: options.sort, skip: options.skip, fields: options.fields }); return Promise.promisify((callback) => { cursor.toArray(callback); })(); }).then((results: TDocument[]) => { if (!results || !results.length) return Promise.resolve([]); return this.handlers.documentsReceived(conditions, results, this.helpers.wrapDocument, options); }).nodeify(callback); } /** * Retrieves a single document from the collection and wraps it as an instance * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(callback?: general.Callback): Promise; /** * Retrieves a single document from the collection with the given ID and wraps it as an instance * @param {any} id The document's unique _id field value in downstream format * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(id: any, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection which matches the conditions * @param {Object} conditions The MongoDB query dictating which document to return * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(conditions: { [key: string]: any }, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection with the given ID and wraps it as an instance * @param {any} id The document's unique _id field value in downstream format * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(id: any, options: QueryOptions, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection which matches the conditions * @param {Object} conditions The MongoDB query dictating which document to return * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(conditions: { [key: string]: any }, options: QueryOptions, callback?: general.Callback): Promise; get(...args: any[]): Promise { return this.get.apply(this, args); } /** * Retrieves a single document from the collection and wraps it as an instance * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(callback?: general.Callback): Promise; /** * Retrieves a single document from the collection with the given ID and wraps it as an instance * @param {any} id The document's unique _id field value in downstream format * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(id: any, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection which matches the conditions * @param {Object} conditions The MongoDB query dictating which document to return * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(conditions: { [key: string]: any }, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection with the given ID and wraps it as an instance * @param {any} id The document's unique _id field value in downstream format * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(id: any, options: QueryOptions, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection which matches the conditions * @param {Object} conditions The MongoDB query dictating which document to return * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(conditions: { [key: string]: any }, options: QueryOptions, callback?: general.Callback): Promise; findOne(...args: any[]): Promise { var conditions: { [key: string]: any } = null; var options: QueryOptions = null; var callback: general.Callback = null; for (var argI = 0; argI < args.length; argI++) { if (typeof args[argI] == 'function') callback = callback || args[argI]; else if (_.isPlainObject(args[argI])) { if (conditions) options = args[argI]; else conditions = args[argI]; } else conditions = this.helpers.selectOneDownstream(args[argI]); } _.defaults(options, { wrap: true, cache: true }); return Promise.resolve().bind(this).then(() => { this.helpers.transform.reverse(conditions); if (options.fields) this.helpers.transform.reverse(options.fields); return this.cache.get(conditions); }).then((cachedDocument: TDocument) => { if (cachedDocument) return cachedDocument; return null; }).then((document: TDocument) => { if (!document) return null; return this.handlers.documentsReceived(conditions, [document], this.helpers.wrapDocument, options).then(function (documents) { return documents[0]; }); }).nodeify(callback); } create(objects: TDocument, callback?: general.Callback): Promise; create(objects: TDocument, options: CreateOptions, callback?: general.Callback): Promise; create(objects: TDocument[], callback?: general.Callback): Promise; create(objects: TDocument[], options: CreateOptions, callback?: general.Callback): Promise; create(...args: any[]): Promise { return this.insert.apply(this, args); } insert(objects: TDocument, callback?: general.Callback): Promise; insert(objects: TDocument, options: CreateOptions, callback?: general.Callback): Promise; insert(objects: TDocument[], callback?: general.Callback): Promise; insert(objects: TDocument[], options: CreateOptions, callback?: general.Callback): Promise; insert(objs: TDocument | TDocument[], ...args: any[]): Promise { var objects: TDocument[]; var options: CreateOptions = {}; var callback: general.Callback = null; if (typeof args[0] == 'function') callback = args[0]; else { options = args[0]; callback = args[1]; } var returnArray: boolean = false; if (Array.isArray(objs)) objects = objs; else objects = [objs]; options = options || {}; _.defaults(options, { w: 1 }); return Promise.resolve().then(() => { var queryOptions = { w: options.w, upsert: options.upsert, new: true }; if (options.upsert) return this.handlers.creatingDocuments(objects).map((object: { _id: any; }) => { return new Promise((resolve, reject) => { this.collection.findAndModify({ _id: object._id }, ["_id"], object, queryOptions, (err, result) => { if (err) return reject(err); return resolve(result); }); }); }); else return this.handlers.creatingDocuments(objects).then((objects) => { return new Promise((resolve, reject) => { this.collection.insert(objects, queryOptions, (err, results) => { if (err) return reject(err); return resolve(results); }); }); }); }).then((inserted: any[]) => { return this.handlers.documentsReceived(null, inserted,(document, isNew?, isPartial?) => this.helpers.wrapDocument(document, isNew, isPartial), { cache: options.cache }); }).then((results: TInstance[]) => { if (Array.isArray(objs)) return results; return results[0]; }).nodeify(callback); } update(conditions: any, changes: any, callback?: general.Callback): Promise; update(conditions: any, changes: any, options: UpdateOptions, callback?: general.Callback): Promise; update(conditions: any, changes: any, options?: UpdateOptions, callback?: general.Callback): Promise { if (typeof options == 'function') { callback = >options; options = {}; } _.defaults(options, { w: 1, multi: true }); this.helpers.transform.reverse(conditions); return new Promise((resolve, reject) => { this.collection.update(conditions, changes, options, (err, changes) => { if (err) return reject(err); return resolve(changes); }); }).nodeify(callback); } count(callback?: general.Callback): Promise; count(conditions: any, callback?: general.Callback): Promise; count(conditions?: any, callback?: general.Callback): Promise { if (typeof conditions == 'function') { callback = >conditions; conditions = {}; } var $this = this; return new Promise((resolve, reject) => { $this.collection.count(conditions, (err, results) => { if (err) return reject(err); return resolve(results); }); }).nodeify(callback); } remove(callback?: general.Callback): Promise; remove(conditions: any, callback?: general.Callback): Promise; remove(conditions?: any, callback?: general.Callback): Promise { if (typeof conditions == 'function') { callback = >conditions; conditions = {}; } return new Promise((resolve, reject) => { this.collection.remove(conditions, (err, results) => { if (err) return reject(err); return resolve(results); }); }).then((count) => { return this.cache.clear(conditions).then(() => count); }).nodeify(callback); } ensureIndex(specification: IndexSpecification, callback?: general.Callback): Promise; ensureIndex(specification: IndexSpecification, options: MongoDB.IndexOptions, callback?: general.Callback): Promise; ensureIndex(specification: IndexSpecification, options?: MongoDB.IndexOptions, callback?: general.Callback): Promise { if (typeof options == 'function') { callback = >options; options = {}; } return new Promise((resolve, reject) => { this.collection.ensureIndex(specification, options, (err, name: any) => { if (err) return reject(err); return resolve(name); }); }).nodeify(callback); } ensureIndices(callback?: general.Callback): Promise { return Promise.resolve(this.options.indices).map((index: Index | IndexSpecification) => { return this.ensureIndex((index).spec || index,(index).options || {}); }).nodeify(callback); } } export interface IModelBase { collection: MongoDB.Collection; collectionName: string; core: Iridium; schema: ISchema; cache: ModelCache; cacheDirector: CacheDirector; } export interface IModelFactory { (core: Iridium): IModel; } export interface IModelOptions { hooks?: hooks.IHooks; validators?: SkmatcCore.IValidator[]; transforms?: Concoction.Ingredient[]; cache?: CacheDirector; indices?: (Index | IndexSpecification)[]; properties?: { [key: string]: (general.PropertyGetter | general.Property) }; } export interface IModel extends IModelBase { wrap(doc: TDocument, isNew?: boolean, isPartial?: boolean): TInstance; } export class ModelSpecificInstance { constructor(model: Model, instanceConstructor) { this.Constructor = function (document: TDocument, isNew?: boolean, isPartial?: boolean) { instanceConstructor.call(this, model, document, isNew, isPartial); }; _.each(model.schema, (property, key) => { Object.defineProperty(this.Constructor.prototype, key, { get: function () { return this._modified[key]; }, set: function (value) { this._modified[key] = value; }, enumerable: true }); }); } private Constructor: (document: TDocument, isNew?: boolean, isPartial?: boolean) => void; build(document: TDocument, isNew?: boolean, isPartial?: boolean): TInstance { return new this.Constructor(document, isNew, isPartial); } } export class ModelHelpers { constructor(model: Model) { this._model = model; this._validator = new Skmatc(model.schema); this._transform = new Concoction(model.options.transforms); } private _model: Model; private _transform: concoction; /** * Gets the Concoction transforms defined for this model * @returns {Concoction} */ get transform(): Concoction { return this._transform; } private _validator: Skmatc; /** * Validates a document to ensure that it matches the model's ISchema requirements * @param {any} document The document to validate against the ISchema * @returns {SkmatcCore.IResult} The result of the validation */ validate(document: TDocument): SkmatcCore.IResult { return this._validator.validate(document); } /** * Creates a selector based on the document's unique _id field * @param {object} document The document to render the unique selector for * @returns {{_id: any}} A database selector which can be used to return only this document */ selectOne(document: TDocument): { _id: any } { var testDoc: any = _.cloneDeep(document); this.transform.reverse(testDoc); return { _id: testDoc._id }; } /** * Gets the field used in the ISchema to represent the document _id */ get identifierField(): string { var id = new String(""); var testDoc = { _id: id }; this.transform.apply(testDoc); var idField = null; for (var k in testDoc) if (testDoc[k] === id) { idField = k; break; } return idField; } /** * Creates a selector based on the document's unique _id field in downstream format * @param {any} id The downstream identifier to use when creating the selector * @returns {object} A database selector which can be used to return only this document in downstream form */ selectOneDownstream(id: TDocument): any { var conditions = {}; conditions[this.identifierField] = id; return conditions; } /** * Wraps the given document in an instance wrapper for use throughout the application * @param {any} document The document to be wrapped as an instance * @param {Boolean} isNew Whether the instance originated from the database or was created by the application * @param {Boolean} isPartial Whether the document supplied contains all information present in the database * @returns {any} An instance which wraps this document */ wrapDocument(document: TDocument, isNew?: boolean, isPartial?: boolean): TInstance { return this._model.wrap(document, isNew, isPartial); } /** * Performs a diff operation between two documents and creates a MongoDB changes object to represent the differences * @param {any} original The original document prior to changes being made * @param {any} modified The document after changes were made */ diff(original: TDocument, modified: TDocument): any { var omnom = new Omnom(); omnom.diff(original, modified); return omnom.changes; } } export class ModelHandlers { constructor(model: Model) { this._model = model; } private _model: Model; get model(): Model { return this._model; } documentsReceived(conditions: any, results: TDocument[], wrapper: (document: TDocument, isNew?: boolean, isPartial?: boolean) => TInstance, options: QueryOptions = {}): Promise { _.defaults(options, { cache: true, partial: false }); return Promise.resolve(results).map((target: any) => { return >Promise.resolve().then(() => { // Trigger the received hook if (this.model.options.hooks.retrieved) return this.model.options.hooks.retrieved(target); }).then(() => { // Cache the document if caching is enabled if (this.model.core.cache && options.cache && !options.fields) { var cacheDoc = _.cloneDeep(target); return this.model.cache.set(conditions, cacheDoc); } }).then(() => { // Wrap the document and trigger the ready hook var wrapped: TInstance = wrapper(target, false, !!options.fields); if (this.model.options.hooks.ready) return Promise.resolve(this.model.options.hooks.ready(wrapped)).then(() => wrapped); return wrapped; }); }); } creatingDocuments(documents: TDocument[]): Promise { return Promise.all(documents.map((document: any) => { return Promise.resolve().then(() => { if (this.model.options.hooks.retrieved) return this.model.options.hooks.creating(document); }).then(() => { var validation: SkmatcCore.IResult = this.model.helpers.validate(document); if (validation.failed) return Promise.reject(validation.error); this.model.helpers.transform.reverse(document); return document; }); })); } savingDocument(instance: TInstance, changes: any): Promise { return Promise.resolve().then(() => { if (this.model.options.hooks.saving) return this.model.options.hooks.saving(instance, changes); }).then(() => instance); } } export interface QueryOptions { cache?: boolean; fields?: any; limit?: number; skip?: number; sort?: IndexSpecification; } export interface CreateOptions { w?: any; upsert?: boolean; cache?: boolean; } export interface UpdateOptions { w?: any; multi?: boolean; } export interface IndexSpecification { [key: string]: number; } export interface Index { spec: IndexSpecification; options?: MongoDB.IndexOptions; } class ModelCache { constructor(model: IModelBase) { this._model = model; } private _model: IModelBase; get model(): IModelBase { return this._model; } set(conditions: any, value: T): Promise { if (!this.model.cacheDirector || !this.model.cacheDirector.valid(conditions)) return Promise.resolve(value); return this.model.core.cache.set(this.model.cacheDirector.buildKey(conditions), value); } get(conditions: any): Promise { if (!this.model.cacheDirector || !this.model.cacheDirector.valid(conditions)) return Promise.resolve(null); return this.model.core.cache.get(this.model.cacheDirector.buildKey(conditions)); } clear(conditions: any): Promise { if (!this.model.cacheDirector || !this.model.cacheDirector.valid(conditions)) return Promise.resolve(false); return this.model.core.cache.clear(this.model.cacheDirector.buildKey(conditions)); } } +/// import MongoDB = require('mongodb'); import Skmatc = require('skmatc'); import Concoction = require('concoction'); import Promise = require('bluebird'); import util = require('util'); import _ = require('lodash'); import Iridium = require('./Core'); import instance = require('./Instance'); import ISchema = require('./Schema'); import hooks = require('./Hooks'); import IPlugin = require('./Plugins'); import cache = require('./Cache'); import CacheDirector = require('./CacheDirector'); import general = require('./General'); import noOpCache = require('./caches/NoOpCache'); import memoryCache = require('./caches/MemoryCache'); import idCacheController = require('./cacheControllers/IDDirector'); import Omnom = require('./utils/Omnom'); /** * An Iridium Model which represents a structured MongoDB collection * @class */ export class Model implements IModel { /** * Creates a new Iridium model representing a given ISchema and backed by a collection whose name is specified * @param {Iridium} core The Iridium core that this model should use for database access * @param {String} collection The name of the collection within the database which should be used by this model * @param {schema} schema The schema defining the data validations to be performed on the model * @param {IModelOptions} options The options dictating the behaviour of the model * @returns {Model} * @constructor */ constructor(core: Iridium, instanceType, collection: string, schema: ISchema, options: IModelOptions = {}) { // Allow instantiation doing `require('iridium').Model(db, 'collection', {})` if (!(this instanceof Model)) return new Model(core, instanceType, collection, schema, options); if (!(core instanceof Iridium)) throw new Error("You failed to provide a valid Iridium core for this model"); if (typeof instanceType != 'function') throw new Error("You failed to provide a valid instance constructor for this model"); if (typeof collection != 'string' || !collection) throw new Error("You failed to provide a valid collection name for this model"); if (!_.isPlainObject(schema) || !_.keys(schema).length) throw new Error("You failed to provide a valid schema for this model"); options = options || {}; _.defaults(options, >{ hooks: {}, transforms: [ new Concoction.Rename({ _id: 'id' }), new Concoction.Convert({ id: { apply: function (value) { return (value && value.id) ? new MongoDB.ObjectID(value.id).toHexString() : value; }, reverse: function (value) { if (value === null || value === undefined) return undefined; if (value && /^[a-f0-9]{24}$/.test(value)) return MongoDB.ObjectID.createFromHexString(value); return value; } } }) ], cache: new idCacheController() }); this._core = core; this._collection = collection; this._schema = schema; this._options = options; core.plugins.forEach(function (plugin: IPlugin) { if (plugin.newModel) plugin.newModel(this); }); this._cache = new ModelCache(this); this._Instance = new ModelSpecificInstance(this, instanceType); this._helpers = new ModelHelpers(this); this._handlers = new ModelHandlers(this); } private _options: IModelOptions; /** * Gets the options provided when instantiating this model * @public * @returns {IModelOptions} * @description * This is intended to be consumed by plugins which require any configuration * options. Changes made to this object after the {plugin.newModel} hook are * called will not have any effect on this model. */ get options(): IModelOptions { return this._options; } private _helpers: ModelHelpers; /** * Provides helper methods used by Iridium for common tasks * @returns {ModelHelpers} */ get helpers(): ModelHelpers { return this._helpers; } private _handlers: ModelHandlers; /** * Provides helper methods used by Iridium for hook delegation and common processes * @returns {ModelHandlers} */ get handlers(): ModelHandlers { return this._handlers; } private _schema: ISchema; /** * Gets the ISchema dictating the data structure represented by this model * @public * @returns {schema} */ get schema(): ISchema { return this._schema; } private _core: Iridium; /** * Gets the Iridium core that this model is associated with * @public * @returns {Iridium} */ get core(): Iridium { return this._core; } private _collection: string; /** * Gets the underlying MongoDB collection from which this model's documents are retrieved * @public * @returns {Collection} */ get collection(): MongoDB.Collection { return this.core.connection.collection(this._collection); } /** * Gets the name of the underlying MongoDB collection from which this model's documents are retrieved * @public */ get collectionName(): string { return this._collection; } /** * Sets the name of the underlying MongoDB collection from which this model's documents are retrieved * @public */ set collectionName(value: string) { this._collection = value; } private _cacheDirector: CacheDirector; /** * Gets the cache controller which dictates which queries will be cached, and under which key * @public * @returns {CacheDirector} */ get cacheDirector(): CacheDirector { return this._cacheDirector; } private _cache: ModelCache; /** * Gets the cache responsible for storing objects for quick retrieval under certain conditions * @public * @returns {ModelCache} */ get cache(): ModelCache { return this._cache; } private _Instance: ModelSpecificInstance; /** * Wraps the given document using the instance constructor provided for this model * @public * @param {TDocument} document The document to wrap in an instance object * @param {Boolean} isNew Whether the document is present in the database or not * @param {Boolean} isPartial Whether the document contains all properties defined in the database * @returns {function(Object): Instance} * @constructor */ wrap(document: TDocument, isNew: boolean = true, isPartial: boolean = false): TInstance { return this._Instance.build(document, isNew, isPartial); } /** * Retrieves all documents in the collection and wraps them as instances * @param {function(Error, TInstance[])} callback An optional callback which will be triggered when results are available * @returns {Promise} */ find(callback?: general.Callback): Promise; /** * Returns all documents in the collection which match the conditions and wraps them as instances * @param {Object} conditions The MongoDB query dictating which documents to return * @param {function(Error, TInstance[])} callback An optional callback which will be triggered when results are available * @returns {Promise} */ find(conditions: any, callback?: general.Callback): Promise; /** * Returns all documents in the collection which match the conditions * @param {Object} conditions The MongoDB query dictating which documents to return * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance[])} callback An optional callback which will be triggered when results are available * @returns {Promise} */ find(conditions: any, options: QueryOptions, callback?: general.Callback): Promise; find(conditions?: any, options?: QueryOptions, callback?: general.Callback): Promise { if (typeof options == 'function') { callback = >options; options = {}; } if (typeof conditions == 'function') { callback = >conditions; conditions = {}; options = {}; } conditions = conditions || {}; options = options || {}; _.defaults(options, { }); return Promise.resolve().then(() => { if (options.fields) this.helpers.transform.reverse(options.fields); if (!_.isPlainObject(conditions)) conditions = this.helpers.selectOneDownstream(conditions); this.helpers.transform.reverse(conditions); var cursor = this.collection.find(conditions, { limit: options.limit, sort: options.sort, skip: options.skip, fields: options.fields }); return Promise.promisify((callback) => { cursor.toArray(callback); })(); }).then((results: TDocument[]) => { if (!results || !results.length) return Promise.resolve([]); return this.handlers.documentsReceived(conditions, results, this.helpers.wrapDocument, options); }).nodeify(callback); } /** * Retrieves a single document from the collection and wraps it as an instance * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(callback?: general.Callback): Promise; /** * Retrieves a single document from the collection with the given ID and wraps it as an instance * @param {any} id The document's unique _id field value in downstream format * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(id: any, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection which matches the conditions * @param {Object} conditions The MongoDB query dictating which document to return * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(conditions: { [key: string]: any }, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection with the given ID and wraps it as an instance * @param {any} id The document's unique _id field value in downstream format * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(id: any, options: QueryOptions, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection which matches the conditions * @param {Object} conditions The MongoDB query dictating which document to return * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ get(conditions: { [key: string]: any }, options: QueryOptions, callback?: general.Callback): Promise; get(...args: any[]): Promise { return this.get.apply(this, args); } /** * Retrieves a single document from the collection and wraps it as an instance * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(callback?: general.Callback): Promise; /** * Retrieves a single document from the collection with the given ID and wraps it as an instance * @param {any} id The document's unique _id field value in downstream format * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(id: any, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection which matches the conditions * @param {Object} conditions The MongoDB query dictating which document to return * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(conditions: { [key: string]: any }, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection with the given ID and wraps it as an instance * @param {any} id The document's unique _id field value in downstream format * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(id: any, options: QueryOptions, callback?: general.Callback): Promise; /** * Retrieves a single document from the collection which matches the conditions * @param {Object} conditions The MongoDB query dictating which document to return * @param {QueryOptions} options The options dictating how this function behaves * @param {function(Error, TInstance)} callback An optional callback which will be triggered when a result is available * @returns {Promise} */ findOne(conditions: { [key: string]: any }, options: QueryOptions, callback?: general.Callback): Promise; findOne(...args: any[]): Promise { var conditions: { [key: string]: any } = null; var options: QueryOptions = null; var callback: general.Callback = null; for (var argI = 0; argI < args.length; argI++) { if (typeof args[argI] == 'function') callback = callback || args[argI]; else if (_.isPlainObject(args[argI])) { if (conditions) options = args[argI]; else conditions = args[argI]; } else conditions = this.helpers.selectOneDownstream(args[argI]); } _.defaults(options, { wrap: true, cache: true }); return Promise.resolve().bind(this).then(() => { this.helpers.transform.reverse(conditions); if (options.fields) this.helpers.transform.reverse(options.fields); return this.cache.get(conditions); }).then((cachedDocument: TDocument) => { if (cachedDocument) return cachedDocument; return null; }).then((document: TDocument) => { if (!document) return null; return this.handlers.documentsReceived(conditions, [document], this.helpers.wrapDocument, options).then(function (documents) { return documents[0]; }); }).nodeify(callback); } create(objects: TDocument, callback?: general.Callback): Promise; create(objects: TDocument, options: CreateOptions, callback?: general.Callback): Promise; create(objects: TDocument[], callback?: general.Callback): Promise; create(objects: TDocument[], options: CreateOptions, callback?: general.Callback): Promise; create(...args: any[]): Promise { return this.insert.apply(this, args); } insert(objects: TDocument, callback?: general.Callback): Promise; insert(objects: TDocument, options: CreateOptions, callback?: general.Callback): Promise; insert(objects: TDocument[], callback?: general.Callback): Promise; insert(objects: TDocument[], options: CreateOptions, callback?: general.Callback): Promise; insert(objs: TDocument | TDocument[], ...args: any[]): Promise { var objects: TDocument[]; var options: CreateOptions = {}; var callback: general.Callback = null; if (typeof args[0] == 'function') callback = args[0]; else { options = args[0]; callback = args[1]; } var returnArray: boolean = false; if (Array.isArray(objs)) objects = objs; else objects = [objs]; options = options || {}; _.defaults(options, { w: 1 }); return Promise.resolve().then(() => { var queryOptions = { w: options.w, upsert: options.upsert, new: true }; if (options.upsert) return this.handlers.creatingDocuments(objects).map((object: { _id: any; }) => { return new Promise((resolve, reject) => { this.collection.findAndModify({ _id: object._id }, ["_id"], object, queryOptions, (err, result) => { if (err) return reject(err); return resolve(result); }); }); }); else return this.handlers.creatingDocuments(objects).then((objects) => { return new Promise((resolve, reject) => { this.collection.insert(objects, queryOptions, (err, results) => { if (err) return reject(err); return resolve(results); }); }); }); }).then((inserted: any[]) => { return this.handlers.documentsReceived(null, inserted,(document, isNew?, isPartial?) => this.helpers.wrapDocument(document, isNew, isPartial), { cache: options.cache }); }).then((results: TInstance[]) => { if (Array.isArray(objs)) return results; return results[0]; }).nodeify(callback); } update(conditions: any, changes: any, callback?: general.Callback): Promise; update(conditions: any, changes: any, options: UpdateOptions, callback?: general.Callback): Promise; update(conditions: any, changes: any, options?: UpdateOptions, callback?: general.Callback): Promise { if (typeof options == 'function') { callback = >options; options = {}; } _.defaults(options, { w: 1, multi: true }); this.helpers.transform.reverse(conditions); return new Promise((resolve, reject) => { this.collection.update(conditions, changes, options, (err, changes) => { if (err) return reject(err); return resolve(changes); }); }).nodeify(callback); } count(callback?: general.Callback): Promise; count(conditions: any, callback?: general.Callback): Promise; count(conditions?: any, callback?: general.Callback): Promise { if (typeof conditions == 'function') { callback = >conditions; conditions = {}; } var $this = this; return new Promise((resolve, reject) => { $this.collection.count(conditions, (err, results) => { if (err) return reject(err); return resolve(results); }); }).nodeify(callback); } remove(callback?: general.Callback): Promise; remove(conditions: any, callback?: general.Callback): Promise; remove(conditions?: any, callback?: general.Callback): Promise { if (typeof conditions == 'function') { callback = >conditions; conditions = {}; } return new Promise((resolve, reject) => { this.collection.remove(conditions, (err, results) => { if (err) return reject(err); return resolve(results); }); }).then((count) => { return this.cache.clear(conditions).then(() => count); }).nodeify(callback); } ensureIndex(specification: IndexSpecification, callback?: general.Callback): Promise; ensureIndex(specification: IndexSpecification, options: MongoDB.IndexOptions, callback?: general.Callback): Promise; ensureIndex(specification: IndexSpecification, options?: MongoDB.IndexOptions, callback?: general.Callback): Promise { if (typeof options == 'function') { callback = >options; options = {}; } return new Promise((resolve, reject) => { this.collection.ensureIndex(specification, options, (err, name: any) => { if (err) return reject(err); return resolve(name); }); }).nodeify(callback); } ensureIndices(callback?: general.Callback): Promise { return Promise.resolve(this.options.indices).map((index: Index | IndexSpecification) => { return this.ensureIndex((index).spec || index,(index).options || {}); }).nodeify(callback); } } export interface IModelBase { collection: MongoDB.Collection; collectionName: string; core: Iridium; schema: ISchema; cache: ModelCache; cacheDirector: CacheDirector; } export interface IModelFactory { (core: Iridium): IModel; } export interface IModelOptions { hooks?: hooks.IHooks; validators?: SkmatcCore.IValidator[]; transforms?: Concoction.Ingredient[]; cache?: CacheDirector; indices?: (Index | IndexSpecification)[]; properties?: { [key: string]: (general.PropertyGetter | general.Property) }; } export interface IModel extends IModelBase { wrap(doc: TDocument, isNew?: boolean, isPartial?: boolean): TInstance; } export class ModelSpecificInstance { constructor(model: Model, instanceConstructor) { this.Constructor = function (document: TDocument, isNew?: boolean, isPartial?: boolean) { instanceConstructor.call(this, model, document, isNew, isPartial); }; _.each(model.schema, (property, key) => { Object.defineProperty(this.Constructor.prototype, key, { get: function () { return this._modified[key]; }, set: function (value) { this._modified[key] = value; }, enumerable: true }); }); } private Constructor: (document: TDocument, isNew?: boolean, isPartial?: boolean) => void; build(document: TDocument, isNew?: boolean, isPartial?: boolean): TInstance { return new this.Constructor(document, isNew, isPartial); } } export class ModelHelpers { constructor(model: Model) { this._model = model; this._validator = new Skmatc(model.schema); this._transform = new Concoction(model.options.transforms); } private _model: Model; private _transform: concoction; /** * Gets the Concoction transforms defined for this model * @returns {Concoction} */ get transform(): Concoction { return this._transform; } private _validator: Skmatc; /** * Validates a document to ensure that it matches the model's ISchema requirements * @param {any} document The document to validate against the ISchema * @returns {SkmatcCore.IResult} The result of the validation */ validate(document: TDocument): SkmatcCore.IResult { return this._validator.validate(document); } /** * Creates a selector based on the document's unique _id field * @param {object} document The document to render the unique selector for * @returns {{_id: any}} A database selector which can be used to return only this document */ selectOne(document: TDocument): { _id: any } { var testDoc: any = _.cloneDeep(document); this.transform.reverse(testDoc); return { _id: testDoc._id }; } /** * Gets the field used in the ISchema to represent the document _id */ get identifierField(): string { var id = new String(""); var testDoc = { _id: id }; this.transform.apply(testDoc); var idField = null; for (var k in testDoc) if (testDoc[k] === id) { idField = k; break; } return idField; } /** * Creates a selector based on the document's unique _id field in downstream format * @param {any} id The downstream identifier to use when creating the selector * @returns {object} A database selector which can be used to return only this document in downstream form */ selectOneDownstream(id: TDocument): any { var conditions = {}; conditions[this.identifierField] = id; return conditions; } /** * Wraps the given document in an instance wrapper for use throughout the application * @param {any} document The document to be wrapped as an instance * @param {Boolean} isNew Whether the instance originated from the database or was created by the application * @param {Boolean} isPartial Whether the document supplied contains all information present in the database * @returns {any} An instance which wraps this document */ wrapDocument(document: TDocument, isNew?: boolean, isPartial?: boolean): TInstance { return this._model.wrap(document, isNew, isPartial); } /** * Performs a diff operation between two documents and creates a MongoDB changes object to represent the differences * @param {any} original The original document prior to changes being made * @param {any} modified The document after changes were made */ diff(original: TDocument, modified: TDocument): any { var omnom = new Omnom(); omnom.diff(original, modified); return omnom.changes; } } export class ModelHandlers { constructor(model: Model) { this._model = model; } private _model: Model; get model(): Model { return this._model; } documentsReceived(conditions: any, results: TDocument[], wrapper: (document: TDocument, isNew?: boolean, isPartial?: boolean) => TInstance, options: QueryOptions = {}): Promise { _.defaults(options, { cache: true, partial: false }); return Promise.resolve(results).map((target: any) => { return >Promise.resolve().then(() => { // Trigger the received hook if (this.model.options.hooks.retrieved) return this.model.options.hooks.retrieved(target); }).then(() => { // Cache the document if caching is enabled if (this.model.core.cache && options.cache && !options.fields) { var cacheDoc = _.cloneDeep(target); return this.model.cache.set(conditions, cacheDoc); } }).then(() => { // Wrap the document and trigger the ready hook var wrapped: TInstance = wrapper(target, false, !!options.fields); if (this.model.options.hooks.ready) return Promise.resolve(this.model.options.hooks.ready(wrapped)).then(() => wrapped); return wrapped; }); }); } creatingDocuments(documents: TDocument[]): Promise { return Promise.all(documents.map((document: any) => { return Promise.resolve().then(() => { if (this.model.options.hooks.retrieved) return this.model.options.hooks.creating(document); }).then(() => { var validation: SkmatcCore.IResult = this.model.helpers.validate(document); if (validation.failed) return Promise.reject(validation.error); this.model.helpers.transform.reverse(document); return document; }); })); } savingDocument(instance: TInstance, changes: any): Promise { return Promise.resolve().then(() => { if (this.model.options.hooks.saving) return this.model.options.hooks.saving(instance, changes); }).then(() => instance); } } export interface QueryOptions { cache?: boolean; fields?: any; limit?: number; skip?: number; sort?: IndexSpecification; } export interface CreateOptions { w?: any; upsert?: boolean; cache?: boolean; } export interface UpdateOptions { w?: any; multi?: boolean; } export interface IndexSpecification { [key: string]: number; } export interface Index { spec: IndexSpecification; options?: MongoDB.IndexOptions; } class ModelCache { constructor(model: IModelBase) { this._model = model; } private _model: IModelBase; get model(): IModelBase { return this._model; } set(conditions: any, value: T): Promise { if (!this.model.cacheDirector || !this.model.cacheDirector.valid(conditions)) return Promise.resolve(value); return this.model.core.cache.set(this.model.cacheDirector.buildKey(conditions), value); } get(conditions: any): Promise { if (!this.model.cacheDirector || !this.model.cacheDirector.valid(conditions)) return Promise.resolve(null); return this.model.core.cache.get(this.model.cacheDirector.buildKey(conditions)); } clear(conditions: any): Promise { if (!this.model.cacheDirector || !this.model.cacheDirector.valid(conditions)) return Promise.resolve(false); return this.model.core.cache.clear(this.model.cacheDirector.buildKey(conditions)); } } diff --git a/lib/Plugins.js b/lib/Plugins.js index 03826e6..7982cf6 100644 --- a/lib/Plugins.js +++ b/lib/Plugins.js @@ -1,2 +1 @@ -/// //# sourceMappingURL=Plugins.js.map \ No newline at end of file diff --git a/lib/Plugins.js.map b/lib/Plugins.js.map index bf4e9fc..668ada2 100644 --- a/lib/Plugins.js.map +++ b/lib/Plugins.js.map @@ -1 +1 @@ -{"version":3,"file":"Plugins.js","sourceRoot":"","sources":["Plugins.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAYrD"} \ No newline at end of file +{"version":3,"file":"Plugins.js","sourceRoot":"","sources":["Plugins.ts"],"names":[],"mappings":"AAWC"} \ No newline at end of file diff --git a/lib/Plugins.ts b/lib/Plugins.ts index 02101e1..fb6f12b 100644 --- a/lib/Plugins.ts +++ b/lib/Plugins.ts @@ -1,5 +1,4 @@ -/// - +/// import core = require('./Core'); import model = require('./Model'); import instance = require('./Instance'); diff --git a/lib/Schema.js.map b/lib/Schema.js.map index eb24a90..1b1ae38 100644 --- a/lib/Schema.js.map +++ b/lib/Schema.js.map @@ -1 +1 @@ -{"version":3,"file":"Schema.js","sourceRoot":"","sources":["Schema.ts"],"names":[],"mappings":"AAIC"} \ No newline at end of file +{"version":3,"file":"Schema.js","sourceRoot":"","sources":["Schema.ts"],"names":[],"mappings":"AAKC"} \ No newline at end of file diff --git a/lib/Schema.ts b/lib/Schema.ts index 554e475..57ff300 100644 --- a/lib/Schema.ts +++ b/lib/Schema.ts @@ -1,3 +1,4 @@ +/// export = ISchema; interface ISchema { diff --git a/lib/cacheControllers/IDDirector.ts b/lib/cacheControllers/IDDirector.ts index 3168f14..3f12b11 100644 --- a/lib/cacheControllers/IDDirector.ts +++ b/lib/cacheControllers/IDDirector.ts @@ -1,3 +1,4 @@ +/// import cacheDirector = require('../CacheDirector'); export = IDCacheDirector; diff --git a/lib/caches/MemoryCache.ts b/lib/caches/MemoryCache.ts index 2344480..aed9fd1 100644 --- a/lib/caches/MemoryCache.ts +++ b/lib/caches/MemoryCache.ts @@ -1,4 +1,4 @@ -/// +/// import Promise = require('bluebird'); import cache = require('../Cache'); diff --git a/lib/caches/NoOpCache.ts b/lib/caches/NoOpCache.ts index d58e1c0..3111c07 100644 --- a/lib/caches/NoOpCache.ts +++ b/lib/caches/NoOpCache.ts @@ -1,4 +1,4 @@ -/// +/// import cache = require('../Cache'); import Promise = require('bluebird'); diff --git a/lib/middleware/Express.ts b/lib/middleware/Express.ts index 5ebc25e..6cdde84 100644 --- a/lib/middleware/Express.ts +++ b/lib/middleware/Express.ts @@ -1,3 +1,4 @@ +/// import http = require('http'); import Middleware = require('../Middleware'); import Core = require('../Core'); diff --git a/lib/utils/Omnom.ts b/lib/utils/Omnom.ts index 518a521..5f55bc7 100644 --- a/lib/utils/Omnom.ts +++ b/lib/utils/Omnom.ts @@ -1,7 +1,4 @@ -/// -/// -/// - +/// import _ = require('lodash'); import MongoDB = require('mongodb'); diff --git a/test/support/chai.js b/test/support/chai.js index b0445f6..ba94720 100644 --- a/test/support/chai.js +++ b/test/support/chai.js @@ -1,3 +1,4 @@ +/// var chai = require('chai'); var chaiAsPromised = require('chai-as-promised'); var chaiFuzzy = require('chai-fuzzy'); diff --git a/test/support/chai.js.map b/test/support/chai.js.map index d86f1b6..e0f2e5e 100644 --- a/test/support/chai.js.map +++ b/test/support/chai.js.map @@ -1 +1 @@ -{"version":3,"file":"chai.js","sourceRoot":"","sources":["chai.ts"],"names":[],"mappings":"AAAA,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAO,cAAc,WAAW,kBAAkB,CAAC,CAAC;AAEpD,IAAI,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEtC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACzB,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAEpB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;AACnB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC"} \ No newline at end of file +{"version":3,"file":"chai.js","sourceRoot":"","sources":["chai.ts"],"names":[],"mappings":"AACA,AADA,gDAAgD;AAChD,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAO,cAAc,WAAW,kBAAkB,CAAC,CAAC;AAEpD,IAAI,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEtC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACzB,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAEpB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;AACnB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC"} \ No newline at end of file diff --git a/test/support/chai.ts b/test/support/chai.ts index d707ca9..5498cc2 100644 --- a/test/support/chai.ts +++ b/test/support/chai.ts @@ -1,3 +1,4 @@ +/// import chai = require('chai'); import chaiAsPromised = require('chai-as-promised'); import Promise = require('bluebird'); diff --git a/test/support/config.ts b/test/support/config.ts index 04409ad..8ae1b23 100644 --- a/test/support/config.ts +++ b/test/support/config.ts @@ -1,2 +1,3 @@ +/// var config = module.require('./config.json'); global.config = config; \ No newline at end of file