Comparing version 0.0.31 to 0.0.32
{ | ||
"name": "o-m-m", | ||
"version": "0.0.31", | ||
"main": "src/omm.js", | ||
"typings": "src/omm.ts", | ||
"version": "0.0.32", | ||
"main": "build/src/omm.js", | ||
"typings": "build/src/omm.d.ts", | ||
"scripts":{ | ||
@@ -7,0 +7,0 @@ "test": "./node_modules/jasmine/bin/jasmine.js" |
@@ -8,5 +8,2 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
/** | ||
@@ -16,3 +13,2 @@ * Created by bert on 04.05.15. | ||
var omm = require("../../src/omm"); | ||
var Tests = require("./Tests"); | ||
var TestAddress = (function () { | ||
@@ -28,8 +24,6 @@ function TestAddress(street, person) { | ||
omm.AsForeignKey, | ||
omm.Type("TestPerson"), | ||
__metadata('design:type', Tests.TestPerson) | ||
omm.Type("TestPerson") | ||
], TestAddress.prototype, "person", void 0); | ||
TestAddress = __decorate([ | ||
omm.Entity, | ||
__metadata('design:paramtypes', [String, Tests.TestPerson]) | ||
omm.Entity | ||
], TestAddress); | ||
@@ -36,0 +30,0 @@ return TestAddress; |
@@ -8,7 +8,3 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
var Tests = require("./Tests"); | ||
var TestCar = (function () { | ||
@@ -19,16 +15,12 @@ function TestCar() { | ||
__decorate([ | ||
omm.Type("TestWheelBanzai"), | ||
__metadata('design:type', Tests.TestWheel) | ||
omm.Type("TestWheelBanzai") | ||
], TestCar.prototype, "wheel", void 0); | ||
__decorate([ | ||
omm.ArrayOrMap("TestWheelBanzai"), | ||
__metadata('design:type', Array) | ||
omm.ArrayOrMap("TestWheelBanzai") | ||
], TestCar.prototype, "wheels", void 0); | ||
__decorate([ | ||
omm.Ignore, | ||
__metadata('design:type', String) | ||
omm.Ignore | ||
], TestCar.prototype, "temperature", void 0); | ||
TestCar = __decorate([ | ||
omm.Entity, | ||
__metadata('design:paramtypes', []) | ||
omm.Entity | ||
], TestCar); | ||
@@ -35,0 +27,0 @@ return TestCar; |
@@ -13,5 +13,2 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
@@ -28,8 +25,6 @@ var Tests = require("./Tests"); | ||
__decorate([ | ||
omm.Type("TestInheritanceOther"), | ||
__metadata('design:type', Tests.TestInheritanceOther) | ||
omm.Type("TestInheritanceOther") | ||
], TestInheritanceChild.prototype, "childOther", void 0); | ||
TestInheritanceChild = __decorate([ | ||
omm.Entity, | ||
__metadata('design:paramtypes', []) | ||
omm.Entity | ||
], TestInheritanceChild); | ||
@@ -36,0 +31,0 @@ return TestInheritanceChild; |
@@ -8,5 +8,2 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
@@ -20,4 +17,3 @@ var TestInheritanceOther = (function () { | ||
TestInheritanceOther = __decorate([ | ||
omm.Entity, | ||
__metadata('design:paramtypes', []) | ||
omm.Entity | ||
], TestInheritanceOther); | ||
@@ -24,0 +20,0 @@ return TestInheritanceOther; |
@@ -8,7 +8,3 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
var Tests = require("./Tests"); | ||
var TestInheritanceParent = (function () { | ||
@@ -18,13 +14,10 @@ function TestInheritanceParent() { | ||
__decorate([ | ||
omm.Type("TestInheritanceOther"), | ||
__metadata('design:type', Tests.TestInheritanceOther) | ||
omm.Type("TestInheritanceOther") | ||
], TestInheritanceParent.prototype, "parentOther", void 0); | ||
__decorate([ | ||
omm.Type("TestPerson"), | ||
omm.AsForeignKey, | ||
__metadata('design:type', Tests.TestPerson) | ||
omm.AsForeignKey | ||
], TestInheritanceParent.prototype, "person", void 0); | ||
__decorate([ | ||
omm.Ignore, | ||
__metadata('design:type', Tests.TestInheritanceOther) | ||
omm.Ignore | ||
], TestInheritanceParent.prototype, "ignoredOther", void 0); | ||
@@ -31,0 +24,0 @@ return TestInheritanceParent; |
@@ -11,7 +11,3 @@ /** | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
var Tests = require("./Tests"); | ||
var TestLeaf = (function () { | ||
@@ -37,18 +33,12 @@ function TestLeaf(id, parent) { | ||
__decorate([ | ||
omm.DocumentName("greenIndex"), | ||
__metadata('design:type', Number) | ||
omm.DocumentName("greenIndex") | ||
], TestLeaf.prototype, "greenNess", void 0); | ||
__decorate([ | ||
omm.Parent, | ||
__metadata('design:type', Tests.TestTree) | ||
omm.Parent | ||
], TestLeaf.prototype, "parent", void 0); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', []), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestLeaf.prototype, "flutter", null); | ||
TestLeaf = __decorate([ | ||
omm.Entity, | ||
__metadata('design:paramtypes', [String, Tests.TestTree]) | ||
omm.Entity | ||
], TestLeaf); | ||
@@ -55,0 +45,0 @@ return TestLeaf; |
@@ -8,8 +8,3 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
///<reference path="./references.d.ts"/> | ||
var omm = require("../../src/omm"); | ||
var Tests = require("./Tests"); | ||
var TestPerson = (function () { | ||
@@ -100,117 +95,72 @@ function TestPerson(id, name) { | ||
__decorate([ | ||
omm.Type("TestPhoneNumber"), | ||
__metadata('design:type', Tests.TestPhoneNumber) | ||
omm.Type("TestPhoneNumber") | ||
], TestPerson.prototype, "phoneNumber", void 0); | ||
__decorate([ | ||
omm.ArrayOrMap("TestAddress"), | ||
__metadata('design:type', Array) | ||
omm.ArrayOrMap("TestAddress") | ||
], TestPerson.prototype, "addresses", void 0); | ||
__decorate([ | ||
omm.Type("TestTree"), | ||
omm.AsForeignKeys, | ||
__metadata('design:type', Tests.TestTree) | ||
omm.AsForeignKeys | ||
], TestPerson.prototype, "tree", void 0); | ||
__decorate([ | ||
omm.Type("TestLeaf"), | ||
omm.AsForeignKeys, | ||
__metadata('design:type', Tests.TestLeaf) | ||
omm.AsForeignKeys | ||
], TestPerson.prototype, "leaf", void 0); | ||
__decorate([ | ||
omm.ArrayOrMap("TestLeaf"), | ||
omm.AsForeignKeys, | ||
__metadata('design:type', Array) | ||
omm.AsForeignKeys | ||
], TestPerson.prototype, "trees", void 0); | ||
__decorate([ | ||
omm.ArrayOrMap("TestPhoneNumber"), | ||
__metadata('design:type', Object) | ||
omm.ArrayOrMap("TestPhoneNumber") | ||
], TestPerson.prototype, "phoneBook", void 0); | ||
__decorate([ | ||
omm.ArrayOrMap("TestTree"), | ||
omm.AsForeignKeys, | ||
__metadata('design:type', Object) | ||
omm.AsForeignKeys | ||
], TestPerson.prototype, "wood", void 0); | ||
__decorate([ | ||
omm.ArrayOrMap("TestPerson"), | ||
omm.AsForeignKeys, | ||
__metadata('design:type', Object) | ||
omm.AsForeignKeys | ||
], TestPerson.prototype, "family", void 0); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', []), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestPerson.prototype, "collectLeaf", null); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Tests.TestTree]), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestPerson.prototype, "chooseTree", null); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Tests.TestLeaf]), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestPerson.prototype, "chooseLeaf", null); | ||
__decorate([ | ||
omm.CollectionUpdate, | ||
omm.MeteorMethod, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String]), | ||
__metadata('design:returntype', String) | ||
omm.MeteorMethod | ||
], TestPerson.prototype, "rename", null); | ||
__decorate([ | ||
omm.CollectionUpdate, | ||
omm.MeteorMethod, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String]), | ||
__metadata('design:returntype', String) | ||
omm.MeteorMethod | ||
], TestPerson.prototype, "collectionUpdateRename", null); | ||
__decorate([ | ||
omm.CollectionUpdate, | ||
omm.MeteorMethod({ parameterTypes: ["TestAddress"], replaceWithCall: true }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Tests.TestAddress]), | ||
__metadata('design:returntype', Tests.TestAddress) | ||
omm.MeteorMethod({ parameterTypes: ["TestAddress"], replaceWithCall: true }) | ||
], TestPerson.prototype, "addAddress", null); | ||
__decorate([ | ||
omm.CollectionUpdate, | ||
omm.MeteorMethod({ parameterTypes: ["TestAddress"], replaceWithCall: true }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Array]), | ||
__metadata('design:returntype', Array) | ||
omm.MeteorMethod({ parameterTypes: ["TestAddress"], replaceWithCall: true }) | ||
], TestPerson.prototype, "addAddresses", null); | ||
__decorate([ | ||
omm.MeteorMethod({ parameterTypes: ["callback"], replaceWithCall: true, serverOnly: true }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ parameterTypes: ["callback"], replaceWithCall: true, serverOnly: true }) | ||
], TestPerson.prototype, "fromServer", null); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Tests.TestTree, String]), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestPerson.prototype, "addToWood", null); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String, Tests.TestPerson]), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestPerson.prototype, "addFamilyRelation", null); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String, Tests.TestPhoneNumber]), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestPerson.prototype, "addPhoneNumber", null); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', []), | ||
__metadata('design:returntype', Number) | ||
omm.Wrap | ||
], TestPerson.prototype, "tendToGarden", null); | ||
TestPerson = __decorate([ | ||
omm.Entity, | ||
__metadata('design:paramtypes', [String, String]) | ||
omm.Entity | ||
], TestPerson); | ||
@@ -217,0 +167,0 @@ return TestPerson; |
@@ -1,2 +0,2 @@ | ||
///<reference path="./references.d.ts"/> | ||
import * as omm from "../../src/omm" | ||
@@ -3,0 +3,0 @@ import * as Tests from "./Tests" |
@@ -13,5 +13,2 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
@@ -82,42 +79,21 @@ var Tests = require("./Tests"); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestPersonCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["string", "callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String, Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestPersonCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["string", "callback"] }) | ||
], TestPersonCollection.prototype, "newPerson", null); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestPersonCollection' }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String]), | ||
__metadata('design:returntype', Tests.TestPerson) | ||
omm.MeteorMethod({ object: 'TestPersonCollection' }) | ||
], TestPersonCollection.prototype, "insertPerson", null); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestPersonCollection', replaceWithCall: true, parameterTypes: ["TestPerson", "TestPerson", "callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Tests.TestPerson, Tests.TestPerson, Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestPersonCollection', replaceWithCall: true, parameterTypes: ["TestPerson", "TestPerson", "callback"] }) | ||
], TestPersonCollection.prototype, "haveBaby", null); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestPersonCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["string", "callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String, Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestPersonCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["string", "callback"] }) | ||
], TestPersonCollection.prototype, "removePerson", null); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestPersonCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestPersonCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["callback"] }) | ||
], TestPersonCollection.prototype, "removeAllPersons", null); | ||
__decorate([ | ||
omm.StaticMeteorMethod, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String]), | ||
__metadata('design:returntype', Tests.TestPerson) | ||
omm.StaticMeteorMethod | ||
], TestPersonCollection, "staticInsertPerson", null); | ||
__decorate([ | ||
omm.StaticMeteorMethod('helloWorld', { parameterTypes: ['string'] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String]), | ||
__metadata('design:returntype', Tests.TestPerson) | ||
omm.StaticMeteorMethod('helloWorld', { parameterTypes: ['string'] }) | ||
], TestPersonCollection, "staticInsertPerson2", null); | ||
@@ -124,0 +100,0 @@ return TestPersonCollection; |
@@ -8,5 +8,2 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
@@ -46,10 +43,6 @@ var TestPhoneNumber = (function () { | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', []), | ||
__metadata('design:returntype', String) | ||
omm.Wrap | ||
], TestPhoneNumber.prototype, "callNumber", null); | ||
TestPhoneNumber = __decorate([ | ||
omm.Entity, | ||
__metadata('design:paramtypes', [String]) | ||
omm.Entity | ||
], TestPhoneNumber); | ||
@@ -56,0 +49,0 @@ return TestPhoneNumber; |
@@ -8,6 +8,2 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
///<reference path="./references.d.ts"/> | ||
var omm = require("../../src/omm"); | ||
@@ -52,43 +48,27 @@ var Tests = require("./Tests"); | ||
__decorate([ | ||
omm.Id, | ||
__metadata('design:type', String) | ||
omm.Id | ||
], TestTree.prototype, "treeId", void 0); | ||
__decorate([ | ||
omm.ArrayType("TestLeaf"), | ||
omm.DocumentName('thoseGreenThings'), | ||
__metadata('design:type', Array) | ||
omm.DocumentName('thoseGreenThings') | ||
], TestTree.prototype, "leaves", void 0); | ||
__decorate([ | ||
omm.Type("TestAddress"), | ||
omm.AsForeignKey, | ||
__metadata('design:type', Tests.TestAddress) | ||
omm.AsForeignKey | ||
], TestTree.prototype, "address", void 0); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', []), | ||
__metadata('design:returntype', String) | ||
omm.Wrap | ||
], TestTree.prototype, "grow", null); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', []), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestTree.prototype, "wither", null); | ||
__decorate([ | ||
omm.Wrap, | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', []), | ||
__metadata('design:returntype', void 0) | ||
omm.Wrap | ||
], TestTree.prototype, "thisThrowsAnError", null); | ||
__decorate([ | ||
omm.CollectionUpdate, | ||
omm.MeteorMethod({ replaceWithCall: true, resultType: "TestLeaf" }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', []), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ replaceWithCall: true, resultType: "TestLeaf" }) | ||
], TestTree.prototype, "growAndReturnLeaves", null); | ||
TestTree = __decorate([ | ||
omm.Entity, | ||
__metadata('design:paramtypes', [Number]) | ||
omm.Entity | ||
], TestTree); | ||
@@ -95,0 +75,0 @@ return TestTree; |
@@ -1,2 +0,1 @@ | ||
///<reference path="./references.d.ts"/> | ||
import * as omm from "../../src/omm" | ||
@@ -58,3 +57,3 @@ import * as Tests from "./Tests" | ||
@omm.MeteorMethod({replaceWithCall:true, resultType:"TestLeaf"}) | ||
growAndReturnLeaves(){ | ||
growAndReturnLeaves():Array<Tests.TestLeaf>{ | ||
this.grow(); | ||
@@ -61,0 +60,0 @@ return this.leaves; |
@@ -16,5 +16,2 @@ /** | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
@@ -74,30 +71,15 @@ var Tests = require("./Tests"); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["number", "callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Number, Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["number", "callback"] }) | ||
], TestTreeCollection.prototype, "newTree", null); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["number", "callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Number, Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, serverOnly: true, parameterTypes: ["number", "callback"] }) | ||
], TestTreeCollection.prototype, "errorMethod", null); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, parameterTypes: ["string", "callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String, Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, parameterTypes: ["string", "callback"] }) | ||
], TestTreeCollection.prototype, "deleteTree", null); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, parameterTypes: ["string", "TestTree", "number", "callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [String, Tests.TestTree, Number, Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, parameterTypes: ["string", "TestTree", "number", "callback"] }) | ||
], TestTreeCollection.prototype, "serverFunction", null); | ||
__decorate([ | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, parameterTypes: ["callback"] }), | ||
__metadata('design:type', Function), | ||
__metadata('design:paramtypes', [Function]), | ||
__metadata('design:returntype', void 0) | ||
omm.MeteorMethod({ object: 'TestTreeCollection', replaceWithCall: true, parameterTypes: ["callback"] }) | ||
], TestTreeCollection.prototype, "removeAllTrees", null); | ||
@@ -104,0 +86,0 @@ return TestTreeCollection; |
@@ -8,7 +8,3 @@ "use strict"; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var omm = require("../../src/omm"); | ||
var Tests = require("./Tests"); | ||
var TestWheel = (function () { | ||
@@ -19,8 +15,6 @@ function TestWheel() { | ||
omm.Type("TestCar"), | ||
omm.AsForeignKey, | ||
__metadata('design:type', Tests.TestCar) | ||
omm.AsForeignKey | ||
], TestWheel.prototype, "car", void 0); | ||
TestWheel = __decorate([ | ||
omm.Entity("TestWheelBanzai"), | ||
__metadata('design:paramtypes', []) | ||
omm.Entity("TestWheelBanzai") | ||
], TestWheel); | ||
@@ -27,0 +21,0 @@ return TestWheel; |
@@ -184,3 +184,3 @@ ///<reference path="../typings/jasmine/jasmine.d.ts"/> | ||
it("knows static meteor method annotations that have parameters", function () { | ||
var m:IMethodOptions = omm.PersistenceAnnotation.getMethodOptions('helloWorld'); | ||
var m:omm.IMethodOptions = omm.PersistenceAnnotation.getMethodOptions('helloWorld'); | ||
expect(m).toBeDefined(); | ||
@@ -195,3 +195,3 @@ expect(m.name).toBe("helloWorld"); | ||
it("knows static meteor method annotations ", function () { | ||
var m:IMethodOptions = omm.PersistenceAnnotation.getMethodOptions('staticInsertPerson'); | ||
var m:omm.IMethodOptions = omm.PersistenceAnnotation.getMethodOptions('staticInsertPerson'); | ||
expect(m).toBeDefined(); | ||
@@ -198,0 +198,0 @@ expect(m.name).toBe("staticInsertPerson"); |
@@ -53,2 +53,8 @@ "use strict"; | ||
}); | ||
fit("can clone stuff", function () { | ||
var t1 = new Tests.TestTree(10); | ||
t1.grow(); | ||
var clone = omm.clone(t1); | ||
expect(clone instanceof Tests.TestTree).toBeTruthy(); | ||
}); | ||
it("updates the collection", function (done) { | ||
@@ -55,0 +61,0 @@ personCollection.newPerson('bert', function (err, e) { |
@@ -62,2 +62,9 @@ /** | ||
fit("can clone stuff", function () { | ||
var t1:Tests.TestTree = new Tests.TestTree(10); | ||
t1.grow(); | ||
var clone = omm.clone(t1); | ||
expect( clone instanceof Tests.TestTree ).toBeTruthy(); | ||
}); | ||
it("updates the collection", function (done) { | ||
@@ -64,0 +71,0 @@ personCollection.newPerson('bert', function (err, e:Tests.TestPerson) { |
@@ -6,2 +6,4 @@ "use strict"; | ||
this.object = o; | ||
if (o) | ||
this.objectId = getId(o); | ||
this.collection = coll; | ||
@@ -568,2 +570,5 @@ } | ||
exports.entityClasses = data.entityClasses; | ||
if (!data.environmentReferences) | ||
data.environmentReferences = {}; | ||
exports.environmentReferences = data.environmentReferences; | ||
if (!data.registeredObjects) | ||
@@ -570,0 +575,0 @@ data.registeredObjects = {}; |
@@ -30,2 +30,3 @@ | ||
object:T; | ||
objectId:string; | ||
collection:any; //omm.Collection<T>; | ||
@@ -40,2 +41,4 @@ rootObject:any; | ||
this.object = o; | ||
if( o ) | ||
this.objectId = getId(o); | ||
this.collection = coll; | ||
@@ -62,2 +65,6 @@ } | ||
export var environmentReferences:{ | ||
meteorReference:any, | ||
mongoReference:any | ||
}; | ||
@@ -651,2 +658,7 @@ export function setNonEnumerableProperty(obj:Object, propertyName:string, value:any):void { | ||
entityClasses = data.entityClasses; | ||
if(!data.environmentReferences) | ||
data.environmentReferences = {}; | ||
environmentReferences = data.environmentReferences; | ||
if(!data.registeredObjects) | ||
@@ -653,0 +665,0 @@ data.registeredObjects = {}; |
@@ -20,2 +20,3 @@ /** | ||
__export(require("./omm/Config")); | ||
__export(require("./serializer/Cloner")); | ||
var ConstantObjectRetriever_1 = require("./serializer/ConstantObjectRetriever"); | ||
@@ -22,0 +23,0 @@ exports.ConstantObjectRetriever = ConstantObjectRetriever_1.default; |
@@ -16,2 +16,3 @@ /** | ||
export * from "./omm/Config" | ||
export * from "./serializer/Cloner" | ||
@@ -18,0 +19,0 @@ export { default as ConstantObjectRetriever } from "./serializer/ConstantObjectRetriever" |
@@ -143,3 +143,4 @@ "use strict"; | ||
Collection.prototype.remove = function (id, cb) { | ||
var ctx = new omm.EventContext(o, this); | ||
var ctx = new omm.EventContext(undefined, this); | ||
ctx.objectId = id; | ||
ctx.methodContext = Status_1.default.methodContext; | ||
@@ -146,0 +147,0 @@ this.emitNow("willRemove", ctx); |
@@ -183,3 +183,4 @@ | ||
{ | ||
var ctx = new omm.EventContext( o, this ); | ||
var ctx = new omm.EventContext( undefined, this ); | ||
ctx.objectId = id; | ||
ctx.methodContext = Status.methodContext; | ||
@@ -186,0 +187,0 @@ this.emitNow( "willRemove", ctx ); |
@@ -5,14 +5,13 @@ /** | ||
"use strict"; | ||
var meteorReference; | ||
var mongoReference; | ||
var PersistenceAnnotation_1 = require("../annotations/PersistenceAnnotation"); | ||
function config(options) { | ||
if (options.Meteor) | ||
meteorReference = options.Meteor; | ||
PersistenceAnnotation_1.environmentReferences.meteorReference = options.Meteor; | ||
else | ||
meteorReference = Meteor; | ||
PersistenceAnnotation_1.environmentReferences.meteorReference = Meteor; | ||
if (options.Mongo) { | ||
mongoReference = options.Mongo; | ||
PersistenceAnnotation_1.environmentReferences.mongoReference = options.Mongo; | ||
} | ||
else { | ||
mongoReference = Mongo; | ||
PersistenceAnnotation_1.environmentReferences.mongoReference = Mongo; | ||
} | ||
@@ -22,9 +21,9 @@ } | ||
function getMeteor() { | ||
return meteorReference; | ||
return PersistenceAnnotation_1.environmentReferences.meteorReference; | ||
} | ||
exports.getMeteor = getMeteor; | ||
function getMongo() { | ||
return mongoReference; | ||
return PersistenceAnnotation_1.environmentReferences.mongoReference; | ||
} | ||
exports.getMongo = getMongo; | ||
//# sourceMappingURL=Config.js.map |
@@ -20,6 +20,6 @@ /** | ||
interface ObjectIDStatic { | ||
export interface ObjectIDStatic { | ||
new(hexString?: string): ObjectID; | ||
} | ||
interface ObjectID { | ||
export interface ObjectID { | ||
_str?:string; | ||
@@ -46,17 +46,15 @@ } | ||
var meteorReference:MeteorInterface; | ||
var mongoReference:MongoInterface; | ||
declare var Meteor:any; | ||
declare var Mongo:any; | ||
import {environmentReferences} from "../annotations/PersistenceAnnotation" | ||
export function config( options:{ Meteor? : MeteorInterface, Mongo?: MongoInterface } ) { | ||
if( options.Meteor ) | ||
meteorReference = options.Meteor; | ||
environmentReferences.meteorReference = options.Meteor; | ||
else | ||
meteorReference = <any>Meteor; | ||
environmentReferences.meteorReference = <any>Meteor; | ||
if( options.Mongo ) { | ||
mongoReference = options.Mongo; | ||
environmentReferences.mongoReference = options.Mongo; | ||
} else{ | ||
mongoReference = <any>Mongo; | ||
environmentReferences.mongoReference = <any>Mongo; | ||
} | ||
@@ -66,7 +64,7 @@ } | ||
export function getMeteor():MeteorInterface{ | ||
return meteorReference; | ||
return environmentReferences.meteorReference; | ||
} | ||
export function getMongo():MongoInterface{ | ||
return mongoReference; | ||
return environmentReferences.mongoReference; | ||
} |
@@ -10,2 +10,3 @@ /** | ||
export default MeteorPersistable | ||
export default MeteorPersistable | ||
@@ -26,2 +26,4 @@ "use strict"; | ||
function callHelper(o, callback) { | ||
if (!MeteorPersistence.isInitialized()) | ||
throw new Error("omm is not initialized."); | ||
var helper = {}; | ||
@@ -67,2 +69,4 @@ var c = omm_annotation.PersistenceAnnotation.getClass(o); | ||
function staticCallHelper(tc, callback) { | ||
if (!MeteorPersistence.isInitialized()) | ||
throw new Error("omm is not initialized."); | ||
// static functions | ||
@@ -110,2 +114,4 @@ var helper = {}; | ||
} | ||
if (!MeteorPersistence.isInitialized()) | ||
throw new Error("omm is not initialized."); | ||
for (var i in args) { | ||
@@ -151,2 +157,5 @@ if (args[i]._serializationPath) { | ||
}; | ||
MeteorPersistence.isInitialized = function () { | ||
return MeteorPersistence.initialized; | ||
}; | ||
// TODO new name | ||
@@ -153,0 +162,0 @@ MeteorPersistence.objectsClassName = function (o) { |
@@ -33,2 +33,4 @@ | ||
export function callHelper<O extends Object>(o:O, callback?:( err:any, result?:any)=>void ):O { | ||
if( !MeteorPersistence.isInitialized() ) | ||
throw new Error("omm is not initialized."); | ||
var helper:any = {}; | ||
@@ -70,2 +72,5 @@ var c = omm_annotation.PersistenceAnnotation.getClass(o); | ||
export function staticCallHelper<O extends Object>( tc:O, callback?:( err:any, result?:any)=>void ):O{ | ||
if( !MeteorPersistence.isInitialized() ) | ||
throw new Error("omm is not initialized."); | ||
// static functions | ||
@@ -105,3 +110,6 @@ var helper:any = {}; | ||
export function call( meteorMethodName:string, ...args:any[] ){ | ||
for (var i in args) { | ||
if( !MeteorPersistence.isInitialized() ) | ||
throw new Error("omm is not initialized."); | ||
for (var i in args) { | ||
if (args[i]._serializationPath) { | ||
@@ -154,2 +162,6 @@ args[i] = args[i]._serializationPath.toString(); | ||
static isInitialized():boolean{ | ||
return MeteorPersistence.initialized; | ||
} | ||
// TODO new name | ||
@@ -448,2 +460,3 @@ static objectsClassName(o:any):string { | ||
export function init(){ | ||
@@ -450,0 +463,0 @@ MeteorPersistence.init(); |
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
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
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 too big to display
1255673
266
23233