raml-definition-system
Advanced tools
Comparing version 0.0.22-rc2 to 0.0.23
@@ -24,2 +24,3 @@ "use strict"; | ||
exports.USER_DEFINED_EXTRA = exports.rt.USER_DEFINED_EXTRA; | ||
exports.SOURCE_EXTRA = exports.rt.SOURCE_EXTRA; | ||
// export function instanceOfHasExtra(instance : any) : instance is rt.IHasExtra { | ||
@@ -50,2 +51,11 @@ // return rt.instanceOfHasExtra(instance); | ||
exports.ValueType = ValueType; | ||
var SourceProvider = (function () { | ||
function SourceProvider() { | ||
} | ||
SourceProvider.prototype.getSource = function () { | ||
return null; | ||
}; | ||
return SourceProvider; | ||
}()); | ||
exports.SourceProvider = SourceProvider; | ||
var EnumType = (function (_super) { | ||
@@ -887,3 +897,19 @@ __extends(EnumType, _super); | ||
RAMLService.prototype.getDeclaringNode = function () { | ||
return this._node; | ||
if (this._node) | ||
return this._node; | ||
else if (this._type) { | ||
//if this service have no source registered, | ||
//checking if the type has source contributed via extras | ||
var sourceNode = this._type.getExtra(exports.SOURCE_EXTRA); | ||
if (!sourceNode) | ||
return null; | ||
if (sourceNode instanceof SourceProvider || | ||
(sourceNode.getSource && typeof (sourceNode.getSource) == "function")) { | ||
return sourceNode.getSource(); | ||
} | ||
else { | ||
return sourceNode; | ||
} | ||
} | ||
return null; | ||
}; | ||
@@ -890,0 +916,0 @@ RAMLService.prototype.registerSupertypes = function (classNames) { |
{ | ||
"name": "raml-definition-system", | ||
"version": "0.0.22-rc2", | ||
"version": "0.0.23", | ||
"main": "dist/definitionSystem.js", | ||
@@ -17,3 +17,3 @@ "scripts": { | ||
"know-your-http-well": "^0.2.0", | ||
"raml-typesystem": "beta", | ||
"raml-typesystem": "^0.0.30", | ||
"ts-structure-parser": "^0.0.9", | ||
@@ -20,0 +20,0 @@ "underscore": "^1.8.3" |
@@ -92,3 +92,3 @@ import MetaModel = require("../metamodel") | ||
MetaModel.extraMetaKey("methods"), | ||
MetaModel.oneOf(["get","put","post","delete","options","head","patch","trace","connect"]), | ||
MetaModel.oneOf(["get","put","post","delete","options","head","patch"]), | ||
MetaModel.description("Method that can be called"), | ||
@@ -95,0 +95,0 @@ MetaModel.hide() |
@@ -62,3 +62,3 @@ import MetaModel = require("../metamodel") | ||
MetaModel.markdownDescription("The methods available on this resource."), | ||
MetaModel.documentationTableLabel("get?<br>patch?<br>put?<br>post?<br>delete?<br>options?<br>head?<br>trace?<br>connect?"), | ||
MetaModel.documentationTableLabel("get?<br>patch?<br>put?<br>post?<br>delete?<br>options?<br>head?"), | ||
MetaModel.valueDescription("Object describing the method") | ||
@@ -65,0 +65,0 @@ ] |
@@ -24,2 +24,3 @@ export import rt=require("raml-typesystem") | ||
export var USER_DEFINED_EXTRA = rt.USER_DEFINED_EXTRA; | ||
export var SOURCE_EXTRA = rt.SOURCE_EXTRA; | ||
@@ -49,2 +50,9 @@ // export function instanceOfHasExtra(instance : any) : instance is rt.IHasExtra { | ||
export class ValueType extends typeSystem.ValueType implements IType{} | ||
export class SourceProvider { | ||
getSource() : any { | ||
return null; | ||
} | ||
} | ||
export class EnumType extends ValueType{ | ||
@@ -1052,3 +1060,18 @@ values:string[]=[]; | ||
getDeclaringNode():any{ | ||
return this._node; | ||
if (this._node) return this._node; | ||
else if (this._type) { | ||
//if this service have no source registered, | ||
//checking if the type has source contributed via extras | ||
var sourceNode = this._type.getExtra(SOURCE_EXTRA); | ||
if (!sourceNode) return null; | ||
if (sourceNode instanceof SourceProvider || | ||
(sourceNode.getSource && typeof(sourceNode.getSource) == "function")) { | ||
return (<SourceProvider>sourceNode).getSource(); | ||
} else { | ||
return sourceNode; | ||
} | ||
} | ||
return null; | ||
} | ||
@@ -1055,0 +1078,0 @@ |
@@ -6,3 +6,2 @@ { | ||
"gitUrl" : "https://github.com/raml-org/raml-js-parser-2.git", | ||
"gitBranch" : "rc2", | ||
"installTypings" : true | ||
@@ -13,3 +12,2 @@ }, | ||
"gitUrl" : "https://github.com/raml-org/raml-definition-system.git", | ||
"gitBranch" : "develop", | ||
"installTypings" : true | ||
@@ -21,3 +19,2 @@ }, | ||
"gitUrl" : "https://github.com/raml-org/typesystem-ts.git", | ||
"gitBranch" : "rc2", | ||
"installTypings" : true | ||
@@ -24,0 +21,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1640173
47312
+ Addedraml-typesystem@0.0.30(transitive)
- Removedraml-typesystem@0.0.29-rc2(transitive)
Updatedraml-typesystem@^0.0.30