raml-definition-system
Advanced tools
Comparing version 0.0.34 to 0.0.35
@@ -25,2 +25,3 @@ "use strict"; | ||
exports.SOURCE_EXTRA = exports.rt.SOURCE_EXTRA; | ||
exports.tsInterfaces = exports.rt.tsInterfaces; | ||
// export function instanceOfHasExtra(instance : any) : instance is rt.IHasExtra { | ||
@@ -60,2 +61,6 @@ // return rt.instanceOfHasExtra(instance); | ||
exports.SourceProvider = SourceProvider; | ||
function isSourceProvider(object) { | ||
return object.getSource && typeof (object.getSource) == "function"; | ||
} | ||
exports.isSourceProvider = isSourceProvider; | ||
var EnumType = (function (_super) { | ||
@@ -163,5 +168,5 @@ __extends(EnumType, _super); | ||
if (rs.length == 0) { | ||
var up = new UserDefinedProp("value"); | ||
var node = this.getAdapter(RAMLService).getDeclaringNode(); | ||
var up = new UserDefinedProp("value", node); | ||
up.withDomain(this); | ||
up._node = this.getAdapter(RAMLService).getDeclaringNode(); | ||
up.withCanBeValue(); | ||
@@ -171,3 +176,3 @@ up.withRequired(false); | ||
rs = []; | ||
up.withRange(up._node.asElement().definition().universe().type("string")); | ||
up.withRange(up.node().asElement().definition().universe().type("string")); | ||
rs.push(up); | ||
@@ -538,4 +543,5 @@ } | ||
__extends(UserDefinedProp, _super); | ||
function UserDefinedProp() { | ||
_super.apply(this, arguments); | ||
function UserDefinedProp(name, source) { | ||
_super.call(this, name); | ||
this._node = source; | ||
} | ||
@@ -549,4 +555,10 @@ UserDefinedProp.prototype.withDisplayName = function (name) { | ||
UserDefinedProp.prototype.node = function () { | ||
if (!this._node && this.sourceProvider != null) { | ||
this._node = this.sourceProvider.getSource(); | ||
} | ||
return this._node; | ||
}; | ||
UserDefinedProp.prototype.setSourceProvider = function (sourceProvider) { | ||
this.sourceProvider = sourceProvider; | ||
}; | ||
return UserDefinedProp; | ||
@@ -553,0 +565,0 @@ }(Property)); |
{ | ||
"name": "raml-definition-system", | ||
"version": "0.0.34", | ||
"version": "0.0.35", | ||
"main": "dist/definitionSystem.js", | ||
@@ -17,3 +17,3 @@ "scripts": { | ||
"know-your-http-well": "^0.2.0", | ||
"raml-typesystem": "0.0.40", | ||
"raml-typesystem": "0.0.41", | ||
"ts-structure-parser": "0.0.10", | ||
@@ -20,0 +20,0 @@ "underscore": "^1.8.3" |
@@ -240,2 +240,8 @@ import MetaModel = require("../metamodel") | ||
$isAnnotation = [ MetaModel.description("Whether the type represents annotation") ] | ||
parametrizedProperties:TypeInstance | ||
$parametrizedProperties = [ | ||
MetaModel.customHandling(), | ||
MetaModel.description("For types defined in traits or resource types returns object representation of parametrized properties") | ||
] | ||
} | ||
@@ -339,7 +345,5 @@ export class XMLFacetInfo extends Annotable{ | ||
additionalProperties:TypeDeclaration; | ||
additionalProperties:boolean; | ||
$additionalProperties=[ | ||
MetaModel.description("JSON schema style syntax for declaring maps"), | ||
MetaModel.markdownDescription("JSON schema style syntax for declaring maps. See [[raml-10-spec-map-types|Map Types]]."), | ||
MetaModel.valueDescription("Inline type declaration or typename") | ||
MetaModel.description("A Boolean that indicates if an object instance has additional properties.") | ||
] | ||
@@ -346,0 +350,0 @@ |
@@ -103,2 +103,8 @@ import MetaModel = require("../metamodel") | ||
parametrizedProperties:DataModel.TypeInstance | ||
$parametrizedProperties = [ | ||
MetaModel.customHandling(), | ||
MetaModel.description("For types defined in resource types returns object representation of parametrized properties") | ||
] | ||
} | ||
@@ -105,0 +111,0 @@ |
@@ -26,2 +26,4 @@ export import rt=require("raml-typesystem") | ||
export var tsInterfaces = rt.tsInterfaces; | ||
// export function instanceOfHasExtra(instance : any) : instance is rt.IHasExtra { | ||
@@ -57,2 +59,6 @@ // return rt.instanceOfHasExtra(instance); | ||
export function isSourceProvider(object : any) : object is SourceProvider { | ||
return object.getSource && typeof(object.getSource) == "function"; | ||
} | ||
export class EnumType extends ValueType{ | ||
@@ -161,5 +167,5 @@ values:string[]=[]; | ||
if (rs.length==0){ | ||
var up=new UserDefinedProp("value"); | ||
var node = this.getAdapter(RAMLService).getDeclaringNode(); | ||
var up=new UserDefinedProp("value", node); | ||
up.withDomain(this); | ||
up._node=this.getAdapter(RAMLService).getDeclaringNode(); | ||
up.withCanBeValue(); | ||
@@ -169,3 +175,3 @@ up.withRequired(false); | ||
rs=[]; | ||
up.withRange(up._node.asElement().definition().universe().type("string")); | ||
up.withRange(up.node().asElement().definition().universe().type("string")); | ||
rs.push(up); | ||
@@ -600,6 +606,12 @@ | ||
_node: IParseResult; | ||
private _node: IParseResult; | ||
private sourceProvider; | ||
_displayName:string | ||
constructor(name : string, source : IParseResult) { | ||
super(name) | ||
this._node = source; | ||
} | ||
withDisplayName(name:string){ | ||
@@ -613,4 +625,12 @@ this._displayName=name; | ||
node(){ | ||
if(!this._node && this.sourceProvider != null) { | ||
this._node = this.sourceProvider.getSource(); | ||
} | ||
return this._node; | ||
} | ||
setSourceProvider(sourceProvider : SourceProvider) : void { | ||
this.sourceProvider = sourceProvider; | ||
} | ||
} | ||
@@ -617,0 +637,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
Sorry, the diff of this file is too big to display
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
1648596
47529
+ Addedraml-typesystem@0.0.41(transitive)
- Removedraml-typesystem@0.0.40(transitive)
Updatedraml-typesystem@0.0.41