Comparing version 0.1.36 to 0.1.37
{ | ||
"name": "reob", | ||
"description": "Remote objects - Create backends for one page web apps with ease. Uses mongo and express.", | ||
"version": "0.1.36", | ||
"version": "0.1.37", | ||
"repository": "https://github.com/bvanheukelom/reob", | ||
"license": "MIT", | ||
"main": "dist/src/reob.js", | ||
"typings": "dist/src/reob.d.ts", | ||
"main": "src/reob.js", | ||
"typings": "src/reob.ts", | ||
"scripts": { | ||
"test": "jasmine", | ||
"test": "node $NODE_DEBUG_OPTION ./node_modules/jasmine/bin/jasmine.js", | ||
"clean-m": "find s*/ -type f -name '*.js' -delete && find s*/ -type f -name '*.d.ts' -delete && find s*/ -type f -name '*.js.map' -delete && rm -rf dist", | ||
@@ -24,3 +24,3 @@ "clean": "npm run clean-m && rm -rf node_modules && rm -rf .tscache", | ||
"@types/jasmine": "^2.5.53", | ||
"@types/mongodb": "^2.2.11", | ||
"@types/mongodb": "^3.1.4", | ||
"@types/node": "^8.0.9", | ||
@@ -37,7 +37,7 @@ "@types/node-fetch": "^1.6.7", | ||
"dependencies": { | ||
"express": "^4.16.2", | ||
"compression": "^1.6.2", | ||
"eventemitter2": "^2.1.0", | ||
"express": "^4.16.2", | ||
"jsondiffpatch": "^0.1.43", | ||
"mongodb": "^2.2.26", | ||
"mongodb": "^3.1.3", | ||
"uuid": "^3.1.0", | ||
@@ -44,0 +44,0 @@ "web-methods": "*" |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./dist/src/serverModule")); | ||
__export(require("./src/serverModule")); | ||
//# sourceMappingURL=server.js.map |
@@ -1,1 +0,1 @@ | ||
export * from "./dist/src/serverModule" | ||
export * from "./src/serverModule" |
@@ -34,3 +34,2 @@ import * as reob from "../../src/reob" | ||
//console.log("Tree is growing to new heights: ", this.height+" on the "+(omm.getMeteor().isServer?"server":"client")); | ||
debugger; | ||
this.leaves.push(new Tests.TestLeaf("leaf" + this.getHeight(), this)); | ||
@@ -37,0 +36,0 @@ this.leaves.forEach(function (l:Tests.TestLeaf) { |
{ | ||
"spec_dir": ".", | ||
"spec_files": [ | ||
"./dist/**/*[sS]pec.js" | ||
"./spec/**/*[sS]pec.js" | ||
], | ||
@@ -6,0 +6,0 @@ "helpers": [ |
@@ -186,13 +186,8 @@ /** | ||
it("can run collection updates from within another method", function (done) { | ||
var t1:Tests.TestTree = new Tests.TestTree(15); | ||
treeCollection.insert(t1).then( (id:string)=> { | ||
debugger; | ||
return clientTreeService.growTree( id ).then( ()=>id ); | ||
}).then((id)=>{ | ||
return treeCollection.getByIdOrFail(id); | ||
}).then((t)=>{ | ||
expect( t.getLeaves().length ).toBe(1); | ||
done(); | ||
}); | ||
it("can run collection updates from within another method", async function () { | ||
let t1:Tests.TestTree = new Tests.TestTree(15); | ||
let id = await treeCollection.insert(t1); | ||
await clientTreeService.growTree( id ); | ||
let t = await treeCollection.getByIdOrFail(id); | ||
expect( t.getLeaves().length ).toBe(1); | ||
}); | ||
@@ -212,3 +207,2 @@ | ||
treeCollection.insert(t1).then( (id:string)=> { | ||
debugger; | ||
return clientTreeService.growTree( id ).then( ()=>id ); | ||
@@ -245,3 +239,2 @@ }).then((id)=>{ | ||
var i; | ||
debugger; | ||
Promise.all([treeCollection.insert(t1), personCollection.newPerson("norbert")]).then((arr)=>{ | ||
@@ -302,3 +295,2 @@ return clientTreeService.aTreeAndAPerson(arr[0],arr[1].getId()); | ||
var doc = new reob.Serializer().toDocument(t1); | ||
debugger; | ||
var t2 = new reob.Serializer().toObject(doc, treeCollection, Tests.TestTree, new reob.SerializationPath(treeCollection.getName(), "tree1") ); | ||
@@ -539,3 +531,2 @@ var sp = reob.SerializationPath.getObjectContext(t2).serializationPath; | ||
parent.parentOther.otherness = 84; | ||
debugger; | ||
var doc:any = s.toDocument(parent, true); | ||
@@ -788,3 +779,2 @@ console.log(doc); | ||
var serializer = new reob.Serializer(); | ||
debugger; | ||
var doc:any = serializer.toDocument(tree); | ||
@@ -791,0 +781,0 @@ expect( tree.someArray.length ).toBe(0); |
@@ -6,2 +6,3 @@ | ||
import * as uuid from "uuid" | ||
import {Db} from "mongodb"; | ||
@@ -182,3 +183,3 @@ /** | ||
setMongoCollection( db:any ){ | ||
setMongoCollection( db:Db ){ | ||
// if( omm.isVerbose() )console.log("set mongo collection for collection ", this ); | ||
@@ -385,3 +386,3 @@ this.mongoCollection = db.collection( this.name ); | ||
return this.getMongoCollection().updateOne({ | ||
return this.getMongoCollection().replaceOne({ | ||
_id: reob.getId(rootObject), | ||
@@ -388,0 +389,0 @@ serial: currentSerial |
@@ -13,2 +13,3 @@ /** | ||
import * as compression from "compression" | ||
import {MongoClient} from "mongodb"; | ||
@@ -66,12 +67,12 @@ export declare type LoadingCheck = (id:string, request:reob.Request, obj:any ) => boolean|Promise<void>; | ||
async connectToMongoDb(){ | ||
async connectToMongoDb():Promise<void>{ | ||
if( !this.mongoDb ) { | ||
this.mongoDb = await <any>mongo.MongoClient.connect(this.mongoUrl).then((db: mongo.Db) => { | ||
for (var i in this.collections) { | ||
var c: reob.Collection<any> = this.collections[i]; | ||
c.setMongoCollection(db); | ||
} | ||
return db; | ||
}); | ||
//let client = new MongoClient(this.mongoUrl); | ||
let client:MongoClient = await MongoClient.connect(this.mongoUrl); | ||
this.mongoDb = client.db(); | ||
} | ||
for (var i in this.collections) { | ||
var c: reob.Collection<any> = this.collections[i]; | ||
c.setMongoCollection(this.mongoDb); | ||
} | ||
} | ||
@@ -78,0 +79,0 @@ |
@@ -13,4 +13,3 @@ { | ||
"declaration": true, | ||
"moduleResolution": "node", | ||
"outDir": "dist" | ||
"moduleResolution": "node" | ||
}, | ||
@@ -17,0 +16,0 @@ "include": [ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
623816
175
8929
2
+ Addedbl@2.2.1(transitive)
+ Addedbson@1.1.6(transitive)
+ Addeddenque@1.5.1(transitive)
+ Addedmemory-pager@1.5.0(transitive)
+ Addedmongodb@3.7.4(transitive)
+ Addedoptional-require@1.1.8(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedrequire-at@1.0.6(transitive)
+ Addedsaslprep@1.0.3(transitive)
+ Addedsparse-bitfield@3.0.3(transitive)
+ Addedstring_decoder@1.1.1(transitive)
- Removedbson@1.0.9(transitive)
- Removedbuffer-shims@1.0.0(transitive)
- Removedes6-promise@3.2.1(transitive)
- Removedmongodb@2.2.36(transitive)
- Removedmongodb-core@2.1.20(transitive)
- Removedprocess-nextick-args@1.0.7(transitive)
- Removedreadable-stream@2.2.7(transitive)
- Removedrequire_optional@1.0.1(transitive)
- Removedresolve-from@2.0.0(transitive)
- Removedsemver@5.7.2(transitive)
- Removedstring_decoder@1.0.3(transitive)
Updatedmongodb@^3.1.3