Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

swagger-ui

Package Overview
Dependencies
Maintainers
1
Versions
394
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-ui - npm Package Compare versions

Comparing version 2.1.0-alpha.3 to 2.1.0-alpha.4

main.js

129

dist/lib/swagger-client.js

@@ -90,11 +90,16 @@ // swagger-client.js

else {
for(name in authorizations) {
for (key in this.authz) {
if(key == name) {
value = this.authz[key];
result = value.apply(obj, authorizations);
if (result === true)
status = true;
if(Array.isArray(authorizations)) {
var i;
for(i = 0; i < authorizations.length; i++) {
var auth = authorizations[i];
log(auth);
for (key in this.authz) {
var value = this.authz[key];
if(typeof value !== 'undefined') {
result = value.apply(obj, authorizations);
if (result === true)
status = true;
}
}
}
}
}

@@ -386,4 +391,7 @@ }

this.produces = response.produces;
this.authSchemes = response.authorizations;
this.securityDefinitions = response.securityDefinitions;
// legacy support
this.authSchemes = response.securityDefinitions;
var location = this.parseUri(this.url);

@@ -417,53 +425,58 @@ if(typeof this.schemes === 'undefined' || this.schemes.length === 0) {

for(path in response.paths) {
var httpMethod;
for(httpMethod in response.paths[path]) {
var operation = response.paths[path][httpMethod];
var tags = operation.tags;
if(typeof tags === 'undefined') {
operation.tags = [ 'default' ];
tags = operation.tags;
}
var operationId = this.idFromOp(path, httpMethod, operation);
var operationObject = new Operation (
this,
operationId,
httpMethod,
path,
operation,
this.definitions
);
// bind this operation's execute command to the api
if(tags.length > 0) {
var i;
for(i = 0; i < tags.length; i++) {
var tag = this.tagFromLabel(tags[i]);
var operationGroup = this[tag];
if(typeof operationGroup === 'undefined') {
this[tag] = [];
operationGroup = this[tag];
operationGroup.label = tag;
operationGroup.apis = [];
this[tag].help = this.help.bind(operationGroup);
this.apisArray.push(new OperationGroup(tag, operationObject));
}
operationGroup[operationId] = operationObject.execute.bind(operationObject);
operationGroup[operationId].help = operationObject.help.bind(operationObject);
operationGroup.apis.push(operationObject);
if(typeof response.paths[path] === 'object') {
var httpMethod;
for(httpMethod in response.paths[path]) {
if(['delete', 'get', 'head', 'options', 'patch', 'post', 'put'].indexOf(httpMethod) === -1) {
continue;
}
var operation = response.paths[path][httpMethod];
var tags = operation.tags;
if(typeof tags === 'undefined') {
operation.tags = [ 'default' ];
tags = operation.tags;
}
var operationId = this.idFromOp(path, httpMethod, operation);
var operationObject = new Operation (
this,
operationId,
httpMethod,
path,
operation,
this.definitions
);
// bind this operation's execute command to the api
if(tags.length > 0) {
var i;
for(i = 0; i < tags.length; i++) {
var tag = this.tagFromLabel(tags[i]);
var operationGroup = this[tag];
if(typeof operationGroup === 'undefined') {
this[tag] = [];
operationGroup = this[tag];
operationGroup.label = tag;
operationGroup.apis = [];
this[tag].help = this.help.bind(operationGroup);
this.apisArray.push(new OperationGroup(tag, operationObject));
}
operationGroup[operationId] = operationObject.execute.bind(operationObject);
operationGroup[operationId].help = operationObject.help.bind(operationObject);
operationGroup.apis.push(operationObject);
// legacy UI feature
var j;
var api;
for(j = 0; j < this.apisArray.length; j++) {
if(this.apisArray[j].tag === tag) {
api = this.apisArray[j];
// legacy UI feature
var j;
var api;
for(j = 0; j < this.apisArray.length; j++) {
if(this.apisArray[j].tag === tag) {
api = this.apisArray[j];
}
}
if(api) {
api.operationsArray.push(operationObject);
}
}
if(api) {
api.operationsArray.push(operationObject);
}
}
else {
log('no group to bind to');
}
}
else {
log('no group to bind to');
}
}

@@ -544,2 +557,3 @@ }

this.security = args.security;
this.authorizations = args.security;
this.description = args.description;

@@ -555,3 +569,3 @@

var innerType = this.getType(param);
if(innerType.toString().toLowerCase() === 'boolean') {
if(innerType && innerType.toString().toLowerCase() === 'boolean') {
param.allowableValues = {};

@@ -1112,2 +1126,3 @@ param.isList = true;

this.optional = true;
this.default = obj.default || null;
this.example = obj.example || null;

@@ -1145,2 +1160,4 @@ }

output = this.example;
else if(this.default)
output = this.default;
else if(type === 'date-time')

@@ -1147,0 +1164,0 @@ output = new Date().toISOString();

@@ -10,6 +10,25 @@ var appName;

if(window.swaggerUi.api.authSchemes
&& window.swaggerUi.api.authSchemes.oauth2
&& window.swaggerUi.api.authSchemes.oauth2.scopes) {
scopes = window.swaggerUi.api.authSchemes.oauth2.scopes;
var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
if(auths) {
var key;
var defs = auths;
for(key in defs) {
var auth = defs[key];
if(auth.type === 'oauth2' && auth.scopes) {
var scope;
if(Array.isArray(auth.scopes)) {
// 1.2 support
var i;
for(i = 0; i < auth.scopes.length; i++) {
scopes.push(auth.scopes[i]);
}
}
else {
// 2.0 support
for(scope in auth.scopes) {
scopes.push({scope: scope, description: auth.scopes[scope]});
}
}
}
}
}

@@ -22,32 +41,28 @@

if(popupDialog.length > 0)
popupDialog = popupDialog.last();
else {
popupDialog = $(
[
'<div class="api-popup-dialog">',
'<div class="api-popup-title">Select OAuth2.0 Scopes</div>',
'<div class="api-popup-content">',
'<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.',
'<a href="#">Learn how to use</a>',
'</p>',
'<p><strong>' + appName + '</strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>',
'<ul class="api-popup-scopes">',
'</ul>',
'<p class="error-msg"></p>',
'<div class="api-popup-actions"><button class="api-popup-authbtn api-button green" type="button">Authorize</button><button class="api-popup-cancel api-button gray" type="button">Cancel</button></div>',
'</div>',
'</div>'].join(''));
$(document.body).append(popupDialog);
popupDialog = $(
[
'<div class="api-popup-dialog">',
'<div class="api-popup-title">Select OAuth2.0 Scopes</div>',
'<div class="api-popup-content">',
'<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.',
'<a href="#">Learn how to use</a>',
'</p>',
'<p><strong>' + appName + '</strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>',
'<ul class="api-popup-scopes">',
'</ul>',
'<p class="error-msg"></p>',
'<div class="api-popup-actions"><button class="api-popup-authbtn api-button green" type="button">Authorize</button><button class="api-popup-cancel api-button gray" type="button">Cancel</button></div>',
'</div>',
'</div>'].join(''));
$(document.body).append(popupDialog);
popup = popupDialog.find('ul.api-popup-scopes').empty();
for (i = 0; i < scopes.length; i ++) {
scope = scopes[i];
str = '<li><input type="checkbox" id="scope_' + i + '" scope="' + scope.scope + '"/>' + '<label for="scope_' + i + '">' + scope.scope;
if (scope.description) {
str += '<br/><span class="api-scope-desc">' + scope.description + '</span>';
}
str += '</label></li>';
popup.append(str);
popup = popupDialog.find('ul.api-popup-scopes').empty();
for (i = 0; i < scopes.length; i ++) {
scope = scopes[i];
str = '<li><input type="checkbox" id="scope_' + i + '" scope="' + scope.scope + '"/>' + '<label for="scope_' + i + '">' + scope.scope;
if (scope.description) {
str += '<br/><span class="api-scope-desc">' + scope.description + '</span>';
}
str += '</label></li>';
popup.append(str);
}

@@ -72,3 +87,6 @@

popupDialog.hide();
popupDialog.empty();
popupDialog = [];
});
popupDialog.find('button.api-popup-authbtn').click(function() {

@@ -81,3 +99,3 @@ popupMask.hide();

var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
var redirectUrl = host.protocol + '//' + host.host + pathname + "/o2c.html";
var redirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
var url = null;

@@ -87,8 +105,17 @@

if (authSchemes.hasOwnProperty(key)) {
var o = authSchemes[key].grantTypes;
for(var t in o) {
if(o.hasOwnProperty(t) && t === 'implicit') {
var dets = o[t];
url = dets.loginEndpoint.url + "?response_type=token";
window.swaggerUi.tokenName = dets.tokenName;
if(authSchemes[key].type === 'oauth2' && authSchemes[key].flow === 'implicit') {
var dets = authSchemes[key];
url = dets.authorizationUrl + '?response_type=token';
window.swaggerUi.tokenName = dets.tokenUrl || 'access_token';
}
else if(authSchemes[key].grantTypes) {
// 1.2 support
var o = authSchemes[key].grantTypes;
for(var t in o) {
if(o.hasOwnProperty(t) && t === 'implicit') {
var dets = o[t];
var ep = dets.loginEndpoint.url;
url = dets.loginEndpoint.url + '?response_type=token';
window.swaggerUi.tokenName = dets.tokenName;
}
}

@@ -102,3 +129,3 @@ }

for(k =0; k < o.length; k++) {
scopes.push($(o[k]).attr("scope"));
scopes.push($(o[k]).attr('scope'));
}

@@ -139,10 +166,10 @@

appName = (o.appName||errors.push("missing appName"));
appName = (o.appName||errors.push('missing appName'));
popupMask = (o.popupMask||$('#api-common-mask'));
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
clientId = (o.clientId||errors.push("missing client id"));
realm = (o.realm||errors.push("missing realm"));
clientId = (o.clientId||errors.push('missing client id'));
realm = (o.realm||errors.push('missing realm'));
if(errors.length > 0){
log("auth unable initialize oauth: " + errors);
log('auth unable initialize oauth: ' + errors);
return;

@@ -213,4 +240,3 @@ }

});
window.authorizations.add("oauth2", new ApiKeyAuthorization("Authorization", "Bearer " + b, "header"));
window.authorizations.add('oauth2', new ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
}

@@ -217,0 +243,0 @@ }

// swagger.js
// version 2.0.34
// version 2.0.42
var __bind = function(fn, me){
return function(){
return fn.apply(me, arguments);
(function () {
var __bind = function (fn, me) {
return function () {
return fn.apply(me, arguments);
};
};
};
log = function(){
log.history = log.history || [];
log.history.push(arguments);
if(this.console){
console.log( Array.prototype.slice.call(arguments)[0] );
var log = function () {
log.history = log.history || [];
log.history.push(arguments);
if (this.console) {
console.log(Array.prototype.slice.call(arguments)[0]);
}
};
// if you want to apply conditional formatting of parameter values
var parameterMacro = function (value) {
return value;
}
};
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
if (this[i] === obj) { return i; }
// if you want to apply conditional formatting of model property values
var modelPropertyMacro = function (value) {
return value;
}
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
if (this[i] === obj) { return i; }
}
return -1;
}
return -1;
}
}
if (!('filter' in Array.prototype)) {
Array.prototype.filter= function(filter, that /*opt*/) {
var other= [], v;
for (var i=0, n= this.length; i<n; i++)
if (i in this && filter.call(that, v= this[i], i, this))
other.push(v);
return other;
};
}
if (!('filter' in Array.prototype)) {
Array.prototype.filter = function (filter, that /*opt*/) {
var other = [], v;
for (var i = 0, n = this.length; i < n; i++)
if (i in this && filter.call(that, v = this[i], i, this))
other.push(v);
return other;
};
}
if (!('map' in Array.prototype)) {
Array.prototype.map= function(mapper, that /*opt*/) {
var other= new Array(this.length);
for (var i= 0, n= this.length; i<n; i++)
if (i in this)
other[i]= mapper.call(that, this[i], i, this);
return other;
};
}
if (!('map' in Array.prototype)) {
Array.prototype.map = function (mapper, that /*opt*/) {
var other = new Array(this.length);
for (var i = 0, n = this.length; i < n; i++)
if (i in this)
other[i] = mapper.call(that, this[i], i, this);
return other;
};
}
Object.keys = Object.keys || (function () {
Object.keys = Object.keys || (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
DontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
],
DontEnumsLength = DontEnums.length;
hasDontEnumBug = !{ toString: null }.propertyIsEnumerable("toString"),
DontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
],
DontEnumsLength = DontEnums.length;
return function (o) {
if (typeof o != "object" && typeof o != "function" || o === null)
throw new TypeError("Object.keys called on a non-object");
if (typeof o != "object" && typeof o != "function" || o === null)
throw new TypeError("Object.keys called on a non-object");
var result = [];
for (var name in o) {
if (hasOwnProperty.call(o, name))
result.push(name);
}
var result = [];
for (var name in o) {
if (hasOwnProperty.call(o, name))
result.push(name);
}
if (hasDontEnumBug) {
for (var i = 0; i < DontEnumsLength; i++) {
if (hasOwnProperty.call(o, DontEnums[i]))
result.push(DontEnums[i]);
}
if (hasDontEnumBug) {
for (var i = 0; i < DontEnumsLength; i++) {
if (hasOwnProperty.call(o, DontEnums[i]))
result.push(DontEnums[i]);
}
}
return result;
return result;
};
})();
})();
var SwaggerApi = function (url, options) {
this.isBuilt = false;
this.url = null;
this.debug = false;
this.basePath = null;
this.authorizations = null;
this.authorizationScheme = null;
this.info = null;
this.useJQuery = false;
this.modelsArray = [];
this.isValid;
var SwaggerApi = function(url, options) {
this.url = null;
this.debug = false;
this.basePath = null;
this.authorizations = null;
this.authorizationScheme = null;
this.info = null;
this.useJQuery = false;
options = (options||{});
if (url)
if (url.url)
options = (options || {});
if (url)
if (url.url)
options = url;
else
this.url = url;
else
options = url;
else
this.url = url;
else
options = url;
if (options.url != null)
this.url = options.url;
if (options.url != null)
this.url = options.url;
if (options.success != null)
this.success = options.success;
if (options.success != null)
this.success = options.success;
if (typeof options.useJQuery === 'boolean')
this.useJQuery = options.useJQuery;
if (typeof options.useJQuery === 'boolean')
this.useJQuery = options.useJQuery;
this.failure = options.failure != null ? options.failure : function() {};
this.progress = options.progress != null ? options.progress : function() {};
if (options.success != null)
this.build();
}
this.failure = options.failure != null ? options.failure : function () { };
this.progress = options.progress != null ? options.progress : function () { };
if (options.success != null) {
this.build();
this.isBuilt = true;
}
}
SwaggerApi.prototype.build = function() {
var _this = this;
this.progress('fetching resource list: ' + this.url);
var obj = {
useJQuery: this.useJQuery,
url: this.url,
method: "get",
headers: {
accept: "application/json"
},
on: {
error: function(response) {
if (_this.url.substring(0, 4) !== 'http') {
return _this.fail('Please specify the protocol for ' + _this.url);
} else if (response.status === 0) {
return _this.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.');
} else if (response.status === 404) {
return _this.fail('Can\'t read swagger JSON from ' + _this.url);
} else {
return _this.fail(response.status + ' : ' + response.statusText + ' ' + _this.url);
}
SwaggerApi.prototype.build = function () {
if (this.isBuilt)
return this;
var _this = this;
this.progress('fetching resource list: ' + this.url);
var obj = {
useJQuery: this.useJQuery,
url: this.url,
method: "get",
headers: {
accept: "application/json,application/json;charset=\"utf-8\",*/*"
},
response: function(resp) {
var responseObj = resp.obj || JSON.parse(resp.data);
_this.swaggerVersion = responseObj.swaggerVersion;
if (_this.swaggerVersion === "1.2") {
return _this.buildFromSpec(responseObj);
} else {
return _this.buildFrom1_1Spec(responseObj);
on: {
error: function (response) {
if (_this.url.substring(0, 4) !== 'http') {
return _this.fail('Please specify the protocol for ' + _this.url);
} else if (response.status === 0) {
return _this.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.');
} else if (response.status === 404) {
return _this.fail('Can\'t read swagger JSON from ' + _this.url);
} else {
return _this.fail(response.status + ' : ' + response.statusText + ' ' + _this.url);
}
},
response: function (resp) {
var responseObj = resp.obj || JSON.parse(resp.data);
_this.swaggerVersion = responseObj.swaggerVersion;
if (_this.swaggerVersion === "1.2") {
return _this.buildFromSpec(responseObj);
} else {
return _this.buildFrom1_1Spec(responseObj);
}
}
}
}
};
var e = (typeof window !== 'undefined' ? window : exports);
e.authorizations.apply(obj);
new SwaggerHttp().execute(obj);
return this;
};
var e = (typeof window !== 'undefined' ? window : exports);
e.authorizations.apply(obj);
new SwaggerHttp().execute(obj);
return this;
};
SwaggerApi.prototype.buildFromSpec = function(response) {
if (response.apiVersion != null) {
this.apiVersion = response.apiVersion;
}
this.apis = {};
this.apisArray = [];
this.produces = response.produces;
this.authSchemes = response.authorizations;
if (response.info != null) {
this.info = response.info;
}
var isApi = false;
var i;
for (i = 0; i < response.apis.length; i++) {
var api = response.apis[i];
if (api.operations) {
var j;
for (j = 0; j < api.operations.length; j++) {
operation = api.operations[j];
isApi = true;
SwaggerApi.prototype.buildFromSpec = function (response) {
if (response.apiVersion != null) {
this.apiVersion = response.apiVersion;
}
this.apis = {};
this.apisArray = [];
this.consumes = response.consumes;
this.produces = response.produces;
this.authSchemes = response.authorizations;
if (response.info != null) {
this.info = response.info;
}
var isApi = false;
var i;
for (i = 0; i < response.apis.length; i++) {
var api = response.apis[i];
if (api.operations) {
var j;
for (j = 0; j < api.operations.length; j++) {
operation = api.operations[j];
isApi = true;
}
}
}
}
if (response.basePath) {
this.basePath = response.basePath;
} else if (this.url.indexOf('?') > 0) {
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
} else {
this.basePath = this.url;
}
if (isApi) {
var newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
var k;
for (k = 0; k < response.apis.length; k++) {
var resource = response.apis[k];
res = new SwaggerResource(resource, this);
this.apis[res.name] = res;
if (response.basePath)
this.basePath = response.basePath;
else if (this.url.indexOf('?') > 0)
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
else
this.basePath = this.url;
if (isApi) {
var newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
var res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
var k;
for (k = 0; k < response.apis.length; k++) {
var resource = response.apis[k];
var res = new SwaggerResource(resource, this);
this.apis[res.name] = res;
this.apisArray.push(res);
}
}
}
if (this.success) {
this.success();
}
return this;
};
this.isValid = true;
if (this.success) {
this.success();
}
return this;
};
SwaggerApi.prototype.buildFrom1_1Spec = function(response) {
log("This API is using a deprecated version of Swagger! Please see http://github.com/wordnik/swagger-core/wiki for more info");
if (response.apiVersion != null)
this.apiVersion = response.apiVersion;
this.apis = {};
this.apisArray = [];
this.produces = response.produces;
if (response.info != null) {
this.info = response.info;
}
var isApi = false;
for (var i = 0; i < response.apis.length; i++) {
var api = response.apis[i];
if (api.operations) {
for (var j = 0; j < api.operations.length; j++) {
operation = api.operations[j];
isApi = true;
SwaggerApi.prototype.buildFrom1_1Spec = function (response) {
log("This API is using a deprecated version of Swagger! Please see http://github.com/wordnik/swagger-core/wiki for more info");
if (response.apiVersion != null)
this.apiVersion = response.apiVersion;
this.apis = {};
this.apisArray = [];
this.produces = response.produces;
if (response.info != null) {
this.info = response.info;
}
var isApi = false;
for (var i = 0; i < response.apis.length; i++) {
var api = response.apis[i];
if (api.operations) {
for (var j = 0; j < api.operations.length; j++) {
operation = api.operations[j];
isApi = true;
}
}
}
}
if (response.basePath) {
this.basePath = response.basePath;
} else if (this.url.indexOf('?') > 0) {
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
} else {
this.basePath = this.url;
}
if (isApi) {
var newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
var res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
for (k = 0; k < response.apis.length; k++) {
resource = response.apis[k];
res = new SwaggerResource(resource, this);
this.apis[res.name] = res;
if (response.basePath) {
this.basePath = response.basePath;
} else if (this.url.indexOf('?') > 0) {
this.basePath = this.url.substring(0, this.url.lastIndexOf('?'));
} else {
this.basePath = this.url;
}
if (isApi) {
var newName = response.resourcePath.replace(/\//g, '');
this.resourcePath = response.resourcePath;
var res = new SwaggerResource(response, this);
this.apis[newName] = res;
this.apisArray.push(res);
} else {
for (k = 0; k < response.apis.length; k++) {
resource = response.apis[k];
var res = new SwaggerResource(resource, this);
this.apis[res.name] = res;
this.apisArray.push(res);
}
}
}
if (this.success) {
this.success();
}
return this;
};
this.isValid = true;
if (this.success) {
this.success();
}
return this;
};
SwaggerApi.prototype.selfReflect = function() {
var resource, resource_name, _ref;
if (this.apis == null) {
return false;
}
_ref = this.apis;
for (resource_name in _ref) {
resource = _ref[resource_name];
if (resource.ready == null) {
SwaggerApi.prototype.selfReflect = function () {
var resource, resource_name, _ref;
if (this.apis == null) {
return false;
}
}
this.setConsolidatedModels();
this.ready = true;
if (this.success != null) {
return this.success();
}
};
_ref = this.apis;
for (resource_name in _ref) {
resource = _ref[resource_name];
if (resource.ready == null) {
return false;
}
}
this.setConsolidatedModels();
this.ready = true;
if (this.success != null) {
return this.success();
}
};
SwaggerApi.prototype.fail = function(message) {
this.failure(message);
throw message;
};
SwaggerApi.prototype.fail = function (message) {
this.failure(message);
throw message;
};
SwaggerApi.prototype.setConsolidatedModels = function() {
var model, modelName, resource, resource_name, _i, _len, _ref, _ref1, _results;
this.modelsArray = [];
this.models = {};
_ref = this.apis;
for (resource_name in _ref) {
resource = _ref[resource_name];
for (modelName in resource.models) {
if (this.models[modelName] == null) {
this.models[modelName] = resource.models[modelName];
this.modelsArray.push(resource.models[modelName]);
SwaggerApi.prototype.setConsolidatedModels = function () {
var model, modelName, resource, resource_name, _i, _len, _ref, _ref1, _results;
this.models = {};
_ref = this.apis;
for (resource_name in _ref) {
resource = _ref[resource_name];
for (modelName in resource.models) {
if (this.models[modelName] == null) {
this.models[modelName] = resource.models[modelName];
this.modelsArray.push(resource.models[modelName]);
}
}
}
}
_ref1 = this.modelsArray;
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
model = _ref1[_i];
_results.push(model.setReferencedModels(this.models));
}
return _results;
};
_ref1 = this.modelsArray;
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
model = _ref1[_i];
_results.push(model.setReferencedModels(this.models));
}
return _results;
};
SwaggerApi.prototype.help = function() {
var operation, operation_name, parameter, resource, resource_name, _i, _len, _ref, _ref1, _ref2;
_ref = this.apis;
for (resource_name in _ref) {
resource = _ref[resource_name];
log(resource_name);
_ref1 = resource.operations;
for (operation_name in _ref1) {
operation = _ref1[operation_name];
log(" " + operation.nickname);
_ref2 = operation.parameters;
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
parameter = _ref2[_i];
log(" " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description);
SwaggerApi.prototype.help = function () {
var operation, operation_name, parameter, resource, resource_name, _i, _len, _ref, _ref1, _ref2;
_ref = this.apis;
for (resource_name in _ref) {
resource = _ref[resource_name];
log(resource_name);
_ref1 = resource.operations;
for (operation_name in _ref1) {
operation = _ref1[operation_name];
log(" " + operation.nickname);
_ref2 = operation.parameters;
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
parameter = _ref2[_i];
log(" " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description);
}
}
}
}
return this;
};
return this;
};
var SwaggerResource = function(resourceObj, api) {
var _this = this;
this.api = api;
this.api = this.api;
produces = [];
consumes = [];
this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
this.description = resourceObj.description;
var SwaggerResource = function (resourceObj, api) {
var _this = this;
this.api = api;
this.api = this.api;
var consumes = (this.consumes | []);
var produces = (this.produces | []);
this.path = this.api.resourcePath != null ? this.api.resourcePath : resourceObj.path;
this.description = resourceObj.description;
var parts = this.path.split("/");
this.name = parts[parts.length - 1].replace('.{format}', '');
this.basePath = this.api.basePath;
this.operations = {};
this.operationsArray = [];
this.modelsArray = [];
this.models = {};
this.rawModels = {};
this.useJQuery = (typeof api.useJQuery !== 'undefined' ? api.useJQuery : null);
var parts = this.path.split("/");
this.name = parts[parts.length - 1].replace('.{format}', '');
this.basePath = this.api.basePath;
this.operations = {};
this.operationsArray = [];
this.modelsArray = [];
this.models = {};
this.rawModels = {};
this.useJQuery = (typeof api.useJQuery !== 'undefined' ? api.useJQuery : null);
if ((resourceObj.apis != null) && (this.api.resourcePath != null)) {
this.addApiDeclaration(resourceObj);
} else {
if (this.path == null) {
this.api.fail("SwaggerResources must have a path.");
}
if (this.path.substring(0, 4) === 'http') {
this.url = this.path.replace('{format}', 'json');
if ((resourceObj.apis != null) && (this.api.resourcePath != null)) {
this.addApiDeclaration(resourceObj);
} else {
this.url = this.api.basePath + this.path.replace('{format}', 'json');
}
this.api.progress('fetching resource ' + this.name + ': ' + this.url);
obj = {
url: this.url,
method: "get",
useJQuery: this.useJQuery,
headers: {
accept: "application/json"
},
on: {
response: function(resp) {
var responseObj = resp.obj || JSON.parse(resp.data);
return _this.addApiDeclaration(responseObj);
if (this.path == null) {
this.api.fail("SwaggerResources must have a path.");
}
if (this.path.substring(0, 4) === 'http') {
this.url = this.path.replace('{format}', 'json');
} else {
this.url = this.api.basePath + this.path.replace('{format}', 'json');
}
this.api.progress('fetching resource ' + this.name + ': ' + this.url);
var obj = {
url: this.url,
method: "get",
useJQuery: this.useJQuery,
headers: {
accept: "application/json,application/json;charset=\"utf-8\",*/*"
},
error: function(response) {
return _this.api.fail("Unable to read api '" +
_this.name + "' from path " + _this.url + " (server returned " + response.statusText + ")");
on: {
response: function (resp) {
var responseObj = resp.obj || JSON.parse(resp.data);
return _this.addApiDeclaration(responseObj);
},
error: function (response) {
return _this.api.fail("Unable to read api '" +
_this.name + "' from path " + _this.url + " (server returned " + response.statusText + ")");
}
}
}
};
var e = typeof window !== 'undefined' ? window : exports;
e.authorizations.apply(obj);
new SwaggerHttp().execute(obj);
};
var e = typeof window !== 'undefined' ? window : exports;
e.authorizations.apply(obj);
new SwaggerHttp().execute(obj);
}
}
}
SwaggerResource.prototype.getAbsoluteBasePath = function (relativeBasePath) {
var pos, url;
url = this.api.basePath;
pos = url.lastIndexOf(relativeBasePath);
var parts = url.split("/");
var rootUrl = parts[0] + "//" + parts[2];
SwaggerResource.prototype.getAbsoluteBasePath = function (relativeBasePath) {
var pos, url;
url = this.api.basePath;
pos = url.lastIndexOf(relativeBasePath);
var parts = url.split("/");
var rootUrl = parts[0] + "//" + parts[2];
if(relativeBasePath.indexOf("http") === 0)
return relativeBasePath;
if(relativeBasePath === "/")
return rootUrl;
if(relativeBasePath.substring(0, 1) == "/") {
// use root + relative
return rootUrl + relativeBasePath;
}
else {
var pos = this.basePath.lastIndexOf("/");
var base = this.basePath.substring(0, pos);
if(base.substring(base.length - 1) == "/")
return base + relativeBasePath;
else
return base + "/" + relativeBasePath;
}
};
if (relativeBasePath.indexOf("http") === 0)
return relativeBasePath;
if (relativeBasePath === "/")
return rootUrl;
if (relativeBasePath.substring(0, 1) == "/") {
// use root + relative
return rootUrl + relativeBasePath;
}
else {
var pos = this.basePath.lastIndexOf("/");
var base = this.basePath.substring(0, pos);
if (base.substring(base.length - 1) == "/")
return base + relativeBasePath;
else
return base + "/" + relativeBasePath;
}
};
SwaggerResource.prototype.addApiDeclaration = function(response) {
if (response.produces != null)
this.produces = response.produces;
if (response.consumes != null)
this.consumes = response.consumes;
if ((response.basePath != null) && response.basePath.replace(/\s/g, '').length > 0)
this.basePath = response.basePath.indexOf("http") === -1 ? this.getAbsoluteBasePath(response.basePath) : response.basePath;
SwaggerResource.prototype.addApiDeclaration = function (response) {
if (response.produces != null)
this.produces = response.produces;
if (response.consumes != null)
this.consumes = response.consumes;
if ((response.basePath != null) && response.basePath.replace(/\s/g, '').length > 0)
this.basePath = response.basePath.indexOf("http") === -1 ? this.getAbsoluteBasePath(response.basePath) : response.basePath;
this.addModels(response.models);
if (response.apis) {
for (var i = 0 ; i < response.apis.length; i++) {
var endpoint = response.apis[i];
this.addOperations(endpoint.path, endpoint.operations, response.consumes, response.produces);
this.addModels(response.models);
if (response.apis) {
for (var i = 0 ; i < response.apis.length; i++) {
var endpoint = response.apis[i];
this.addOperations(endpoint.path, endpoint.operations, response.consumes, response.produces);
}
}
}
this.api[this.name] = this;
this.ready = true;
return this.api.selfReflect();
};
this.api[this.name] = this;
this.ready = true;
return this.api.selfReflect();
};
SwaggerResource.prototype.addModels = function(models) {
if (models != null) {
var modelName;
for (modelName in models) {
if (this.models[modelName] == null) {
var swaggerModel = new SwaggerModel(modelName, models[modelName]);
this.modelsArray.push(swaggerModel);
this.models[modelName] = swaggerModel;
this.rawModels[modelName] = models[modelName];
SwaggerResource.prototype.addModels = function (models) {
if (models != null) {
var modelName;
for (modelName in models) {
if (this.models[modelName] == null) {
var swaggerModel = new SwaggerModel(modelName, models[modelName]);
this.modelsArray.push(swaggerModel);
this.models[modelName] = swaggerModel;
this.rawModels[modelName] = models[modelName];
}
}
var output = [];
for (var i = 0; i < this.modelsArray.length; i++) {
var model = this.modelsArray[i];
output.push(model.setReferencedModels(this.models));
}
return output;
}
var output = [];
for (var i = 0; i < this.modelsArray.length; i++) {
model = this.modelsArray[i];
output.push(model.setReferencedModels(this.models));
}
return output;
}
};
};
SwaggerResource.prototype.addOperations = function(resource_path, ops, consumes, produces) {
if (ops) {
output = [];
for (var i = 0; i < ops.length; i++) {
o = ops[i];
consumes = this.consumes;
produces = this.produces;
if (o.consumes != null)
consumes = o.consumes;
else
SwaggerResource.prototype.addOperations = function (resource_path, ops, consumes, produces) {
if (ops) {
var output = [];
for (var i = 0; i < ops.length; i++) {
var o = ops[i];
consumes = this.consumes;
if (o.produces != null)
produces = o.produces;
else
produces = this.produces;
type = (o.type||o.responseClass);
if (o.consumes != null)
consumes = o.consumes;
else
consumes = this.consumes;
if (type === "array") {
ref = null;
if (o.items)
ref = o.items["type"] || o.items["$ref"];
type = "array[" + ref + "]";
}
responseMessages = o.responseMessages;
method = o.method;
if (o.httpMethod) {
method = o.httpMethod;
}
if (o.supportedContentTypes) {
consumes = o.supportedContentTypes;
}
if (o.errorResponses) {
responseMessages = o.errorResponses;
for (var j = 0; j < responseMessages.length; j++) {
r = responseMessages[j];
r.message = r.reason;
r.reason = null;
if (o.produces != null)
produces = o.produces;
else
produces = this.produces;
var type = (o.type || o.responseClass);
if (type === "array") {
ref = null;
if (o.items)
ref = o.items["type"] || o.items["$ref"];
type = "array[" + ref + "]";
}
var responseMessages = o.responseMessages;
var method = o.method;
if (o.httpMethod) {
method = o.httpMethod;
}
if (o.supportedContentTypes) {
consumes = o.supportedContentTypes;
}
if (o.errorResponses) {
responseMessages = o.errorResponses;
for (var j = 0; j < responseMessages.length; j++) {
r = responseMessages[j];
r.message = r.reason;
r.reason = null;
}
}
o.nickname = this.sanitize(o.nickname);
var op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces, o.authorizations, o.deprecated);
this.operations[op.nickname] = op;
output.push(this.operationsArray.push(op));
}
o.nickname = this.sanitize(o.nickname);
op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces, o.authorizations);
this.operations[op.nickname] = op;
output.push(this.operationsArray.push(op));
return output;
}
return output;
}
};
};
SwaggerResource.prototype.sanitize = function(nickname) {
var op;
op = nickname.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_');
op = op.replace(/((_){2,})/g, '_');
op = op.replace(/^(_)*/g, '');
op = op.replace(/([_])*$/g, '');
return op;
};
SwaggerResource.prototype.sanitize = function (nickname) {
var op;
op = nickname.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_');
op = op.replace(/((_){2,})/g, '_');
op = op.replace(/^(_)*/g, '');
op = op.replace(/([_])*$/g, '');
return op;
};
SwaggerResource.prototype.help = function() {
var op = this.operations;
var output = [];
var operation_name;
for (operation_name in op) {
operation = op[operation_name];
var msg = " " + operation.nickname;
for (var i = 0; i < operation.parameters; i++) {
parameter = operation.parameters[i];
msg.concat(" " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description);
SwaggerResource.prototype.help = function () {
var op = this.operations;
var output = [];
var operation_name;
for (operation_name in op) {
operation = op[operation_name];
var msg = " " + operation.nickname;
for (var i = 0; i < operation.parameters; i++) {
parameter = operation.parameters[i];
msg.concat(" " + parameter.name + (parameter.required ? ' (required)' : '') + " - " + parameter.description);
}
output.push(msg);
}
output.push(msg);
}
return output;
};
return output;
};
var SwaggerModel = function(modelName, obj) {
this.name = obj.id != null ? obj.id : modelName;
this.properties = [];
var propertyName;
for (propertyName in obj.properties) {
if (obj.required != null) {
var value;
for (value in obj.required) {
if (propertyName === obj.required[value]) {
obj.properties[propertyName].required = true;
var SwaggerModel = function (modelName, obj) {
this.name = obj.id != null ? obj.id : modelName;
this.properties = [];
var propertyName;
for (propertyName in obj.properties) {
if (obj.required != null) {
var value;
for (value in obj.required) {
if (propertyName === obj.required[value]) {
obj.properties[propertyName].required = true;
}
}
}
var prop = new SwaggerModelProperty(propertyName, obj.properties[propertyName]);
this.properties.push(prop);
}
prop = new SwaggerModelProperty(propertyName, obj.properties[propertyName]);
this.properties.push(prop);
}
}
SwaggerModel.prototype.setReferencedModels = function(allModels) {
var results = [];
for (var i = 0; i < this.properties.length; i++) {
var property = this.properties[i];
var type = property.type || property.dataType;
if (allModels[type] != null)
results.push(property.refModel = allModels[type]);
else if ((property.refDataType != null) && (allModels[property.refDataType] != null))
results.push(property.refModel = allModels[property.refDataType]);
else
results.push(void 0);
}
return results;
};
SwaggerModel.prototype.setReferencedModels = function (allModels) {
var results = [];
for (var i = 0; i < this.properties.length; i++) {
var property = this.properties[i];
var type = property.type || property.dataType;
if (allModels[type] != null)
results.push(property.refModel = allModels[type]);
else if ((property.refDataType != null) && (allModels[property.refDataType] != null))
results.push(property.refModel = allModels[property.refDataType]);
else
results.push(void 0);
}
return results;
};
SwaggerModel.prototype.getMockSignature = function(modelsToIgnore) {
var propertiesStr = [];
for (var i = 0; i < this.properties.length; i++) {
prop = this.properties[i];
propertiesStr.push(prop.toString());
}
var strong = '<span class="strong">';
var stronger = '<span class="stronger">';
var strongClose = '</span>';
var classOpen = strong + this.name + ' {' + strongClose;
var classClose = strong + '}' + strongClose;
var returnVal = classOpen + '<div>' + propertiesStr.join(',</div><div>') + '</div>' + classClose;
if (!modelsToIgnore)
modelsToIgnore = [];
modelsToIgnore.push(this.name);
for (var i = 0; i < this.properties.length; i++) {
prop = this.properties[i];
if ((prop.refModel != null) && modelsToIgnore.indexOf(prop.refModel.name) === -1) {
returnVal = returnVal + ('<br>' + prop.refModel.getMockSignature(modelsToIgnore));
SwaggerModel.prototype.getMockSignature = function (modelsToIgnore) {
var propertiesStr = [];
for (var i = 0; i < this.properties.length; i++) {
var prop = this.properties[i];
propertiesStr.push(prop.toString());
}
}
return returnVal;
};
SwaggerModel.prototype.createJSONSample = function(modelsToIgnore) {
if(sampleModels[this.name]) {
return sampleModels[this.name];
}
else {
var result = {};
var modelsToIgnore = (modelsToIgnore||[])
var strong = '<span class="strong">';
var stronger = '<span class="stronger">';
var strongClose = '</span>';
var classOpen = strong + this.name + ' {' + strongClose;
var classClose = strong + '}' + strongClose;
var returnVal = classOpen + '<div>' + propertiesStr.join(',</div><div>') + '</div>' + classClose;
if (!modelsToIgnore)
modelsToIgnore = [];
modelsToIgnore.push(this.name);
for (var i = 0; i < this.properties.length; i++) {
prop = this.properties[i];
result[prop.name] = prop.getSampleValue(modelsToIgnore);
var prop = this.properties[i];
if ((prop.refModel != null) && modelsToIgnore.indexOf(prop.refModel.name) === -1) {
returnVal = returnVal + ('<br>' + prop.refModel.getMockSignature(modelsToIgnore));
}
}
modelsToIgnore.pop(this.name);
return result;
}
};
return returnVal;
};
var SwaggerModelProperty = function(name, obj) {
this.name = name;
this.dataType = obj.type || obj.dataType || obj["$ref"];
this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
this.descr = obj.description;
this.required = obj.required;
if (obj.items != null) {
if (obj.items.type != null) {
this.refDataType = obj.items.type;
SwaggerModel.prototype.createJSONSample = function (modelsToIgnore) {
if (sampleModels[this.name]) {
return sampleModels[this.name];
}
if (obj.items.$ref != null) {
this.refDataType = obj.items.$ref;
else {
var result = {};
var modelsToIgnore = (modelsToIgnore || [])
modelsToIgnore.push(this.name);
for (var i = 0; i < this.properties.length; i++) {
var prop = this.properties[i];
result[prop.name] = prop.getSampleValue(modelsToIgnore);
}
modelsToIgnore.pop(this.name);
return result;
}
}
this.dataTypeWithRef = this.refDataType != null ? (this.dataType + '[' + this.refDataType + ']') : this.dataType;
if (obj.allowableValues != null) {
this.valueType = obj.allowableValues.valueType;
this.values = obj.allowableValues.values;
if (this.values != null) {
this.valuesString = "'" + this.values.join("' or '") + "'";
};
var SwaggerModelProperty = function (name, obj) {
this.name = name;
this.dataType = obj.type || obj.dataType || obj["$ref"];
this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
this.descr = obj.description;
this.required = obj.required;
this.defaultValue = modelPropertyMacro(obj.defaultValue);
if (obj.items != null) {
if (obj.items.type != null) {
this.refDataType = obj.items.type;
}
if (obj.items.$ref != null) {
this.refDataType = obj.items.$ref;
}
}
}
if (obj["enum"] != null) {
this.valueType = "string";
this.values = obj["enum"];
if (this.values != null) {
this.valueString = "'" + this.values.join("' or '") + "'";
this.dataTypeWithRef = this.refDataType != null ? (this.dataType + '[' + this.refDataType + ']') : this.dataType;
if (obj.allowableValues != null) {
this.valueType = obj.allowableValues.valueType;
this.values = obj.allowableValues.values;
if (this.values != null) {
this.valuesString = "'" + this.values.join("' or '") + "'";
}
}
if (obj["enum"] != null) {
this.valueType = "string";
this.values = obj["enum"];
if (this.values != null) {
this.valueString = "'" + this.values.join("' or '") + "'";
}
}
}
}
SwaggerModelProperty.prototype.getSampleValue = function(modelsToIgnore) {
var result;
if ((this.refModel != null) && (modelsToIgnore.indexOf(prop.refModel.name) === -1)) {
result = this.refModel.createJSONSample(modelsToIgnore);
} else {
SwaggerModelProperty.prototype.getSampleValue = function (modelsToIgnore) {
var result;
if ((this.refModel != null) && (modelsToIgnore.indexOf(this.refModel.name) === -1)) {
result = this.refModel.createJSONSample(modelsToIgnore);
} else {
if (this.isCollection) {
result = this.toSampleValue(this.refDataType);
} else {
result = this.toSampleValue(this.dataType);
}
}
if (this.isCollection) {
result = this.toSampleValue(this.refDataType);
return [result];
} else {
result = this.toSampleValue(this.dataType);
return result;
}
}
if (this.isCollection) {
return [result];
} else {
};
SwaggerModelProperty.prototype.toSampleValue = function (value) {
var result;
if ((typeof this.defaultValue !== 'undefined') && this.defaultValue !== null) {
result = this.defaultValue;
} else if (value === "integer") {
result = 0;
} else if (value === "boolean") {
result = false;
} else if (value === "double" || value === "number") {
result = 0.0;
} else if (value === "string") {
result = "";
} else {
result = value;
}
return result;
}
};
};
SwaggerModelProperty.prototype.toSampleValue = function(value) {
var result;
if (value === "integer") {
result = 0;
} else if (value === "boolean") {
result = false;
} else if (value === "double" || value === "number") {
result = 0.0;
} else if (value === "string") {
result = "";
} else {
result = value;
}
return result;
};
SwaggerModelProperty.prototype.toString = function () {
var req = this.required ? 'propReq' : 'propOpt';
var str = '<span class="propName ' + req + '">' + this.name + '</span> (<span class="propType">' + this.dataTypeWithRef + '</span>';
if (!this.required) {
str += ', <span class="propOptKey">optional</span>';
}
str += ')';
if (this.values != null) {
str += " = <span class='propVals'>['" + this.values.join("' or '") + "']</span>";
}
if (this.descr != null) {
str += ': <span class="propDesc">' + this.descr + '</span>';
}
return str;
};
SwaggerModelProperty.prototype.toString = function() {
var req = this.required ? 'propReq' : 'propOpt';
var str = '<span class="propName ' + req + '">' + this.name + '</span> (<span class="propType">' + this.dataTypeWithRef + '</span>';
if (!this.required) {
str += ', <span class="propOptKey">optional</span>';
}
str += ')';
if (this.values != null) {
str += " = <span class='propVals'>['" + this.values.join("' or '") + "']</span>";
}
if (this.descr != null) {
str += ': <span class="propDesc">' + this.descr + '</span>';
}
return str;
};
var SwaggerOperation = function (nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces, authorizations, deprecated) {
var _this = this;
var SwaggerOperation = function(nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces, authorizations) {
var _this = this;
var errors = [];
this.nickname = (nickname || errors.push("SwaggerOperations must have a nickname."));
this.path = (path || errors.push("SwaggerOperation " + nickname + " is missing path."));
this.method = (method || errors.push("SwaggerOperation " + nickname + " is missing method."));
this.parameters = parameters != null ? parameters : [];
this.summary = summary;
this.notes = notes;
this.type = type;
this.responseMessages = (responseMessages || []);
this.resource = (resource || errors.push("Resource is required"));
this.consumes = consumes;
this.produces = produces;
this.authorizations = authorizations;
this.deprecated = deprecated;
this["do"] = __bind(this["do"], this);
var errors = [];
this.nickname = (nickname||errors.push("SwaggerOperations must have a nickname."));
this.path = (path||errors.push("SwaggerOperation " + nickname + " is missing path."));
this.method = (method||errors.push("SwaggerOperation " + nickname + " is missing method."));
this.parameters = parameters != null ? parameters : [];
this.summary = summary;
this.notes = notes;
this.type = type;
this.responseMessages = (responseMessages||[]);
this.resource = (resource||errors.push("Resource is required"));
this.consumes = consumes;
this.produces = produces;
this.authorizations = authorizations;
this["do"] = __bind(this["do"], this);
if (errors.length > 0) {
console.error('SwaggerOperation errors', errors, arguments);
this.resource.api.fail(errors);
}
if (errors.length > 0)
this.resource.api.fail(errors);
this.path = this.path.replace('{format}', 'json');
this.method = this.method.toLowerCase();
this.isGetMethod = this.method === "get";
this.path = this.path.replace('{format}', 'json');
this.method = this.method.toLowerCase();
this.isGetMethod = this.method === "get";
this.resourceName = this.resource.name;
if (typeof this.type !== 'undefined' && this.type === 'void')
this.type = null;
else {
this.responseClassSignature = this.getSignature(this.type, this.resource.models);
this.responseSampleJSON = this.getSampleJSON(this.type, this.resource.models);
}
this.resourceName = this.resource.name;
if(typeof this.type !== 'undefined' && this.type === 'void')
this.type = null;
else {
this.responseClassSignature = this.getSignature(this.type, this.resource.models);
this.responseSampleJSON = this.getSampleJSON(this.type, this.resource.models);
}
for (var i = 0; i < this.parameters.length; i++) {
var param = this.parameters[i];
// might take this away
param.name = param.name || param.type || param.dataType;
for(var i = 0; i < this.parameters.length; i ++) {
var param = this.parameters[i];
// might take this away
param.name = param.name || param.type || param.dataType;
// for 1.1 compatibility
var type = param.type || param.dataType;
if (type === 'array') {
type = 'array[' + (param.items.$ref ? param.items.$ref : param.items.type) + ']';
}
param.type = type;
// for 1.1 compatibility
var type = param.type || param.dataType;
if(type === 'array') {
type = 'array[' + (param.items.$ref ? param.items.$ref : param.items.type) + ']';
}
param.type = type;
if (type && type.toLowerCase() === 'boolean') {
param.allowableValues = {};
param.allowableValues.values = ["true", "false"];
}
param.signature = this.getSignature(type, this.resource.models);
param.sampleJSON = this.getSampleJSON(type, this.resource.models);
if(type.toLowerCase() === 'boolean') {
param.allowableValues = {};
param.allowableValues.values = ["true", "false"];
}
param.signature = this.getSignature(type, this.resource.models);
param.sampleJSON = this.getSampleJSON(type, this.resource.models);
var enumValue = param["enum"];
if (enumValue != null) {
param.isList = true;
param.allowableValues = {};
param.allowableValues.descriptiveValues = [];
var enumValue = param["enum"];
if(enumValue != null) {
param.isList = true;
param.allowableValues = {};
param.allowableValues.descriptiveValues = [];
for(var j = 0; j < enumValue.length; j++) {
var v = enumValue[j];
if(param.defaultValue != null) {
param.allowableValues.descriptiveValues.push ({
value: String(v),
isDefault: (v === param.defaultValue)
});
for (var j = 0; j < enumValue.length; j++) {
var v = enumValue[j];
if (param.defaultValue != null) {
param.allowableValues.descriptiveValues.push({
value: String(v),
isDefault: (v === param.defaultValue)
});
}
else {
param.allowableValues.descriptiveValues.push({
value: String(v),
isDefault: false
});
}
}
else {
param.allowableValues.descriptiveValues.push ({
value: String(v),
isDefault: false
});
}
}
}
else if(param.allowableValues != null) {
if(param.allowableValues.valueType === "RANGE")
param.isRange = true;
else
param.isList = true;
if(param.allowableValues != null) {
param.allowableValues.descriptiveValues = [];
if(param.allowableValues.values) {
for(var j = 0; j < param.allowableValues.values.length; j++){
var v = param.allowableValues.values[j];
if(param.defaultValue != null) {
param.allowableValues.descriptiveValues.push ({
value: String(v),
isDefault: (v === param.defaultValue)
});
else if (param.allowableValues != null) {
if (param.allowableValues.valueType === "RANGE")
param.isRange = true;
else
param.isList = true;
if (param.allowableValues != null) {
param.allowableValues.descriptiveValues = [];
if (param.allowableValues.values) {
for (var j = 0; j < param.allowableValues.values.length; j++) {
var v = param.allowableValues.values[j];
if (param.defaultValue != null) {
param.allowableValues.descriptiveValues.push({
value: String(v),
isDefault: (v === param.defaultValue)
});
}
else {
param.allowableValues.descriptiveValues.push({
value: String(v),
isDefault: false
});
}
}
else {
param.allowableValues.descriptiveValues.push ({
value: String(v),
isDefault: false
});
}
}
}
}
param.defaultValue = parameterMacro(param.defaultValue);
}
this.resource[this.nickname] = function (args, callback, error) {
return _this["do"](args, callback, error);
};
this.resource[this.nickname].help = function () {
return _this.help();
};
}
this.resource[this.nickname] = function(args, callback, error) {
return _this["do"](args, callback, error);
SwaggerOperation.prototype.isListType = function (type) {
if (type && type.indexOf('[') >= 0) {
return type.substring(type.indexOf('[') + 1, type.indexOf(']'));
} else {
return void 0;
}
};
this.resource[this.nickname].help = function() {
return _this.help();
};
}
SwaggerOperation.prototype.isListType = function(type) {
if (type && type.indexOf('[') >= 0) {
return type.substring(type.indexOf('[') + 1, type.indexOf(']'));
} else {
return void 0;
}
};
SwaggerOperation.prototype.getSignature = function(type, models) {
var isPrimitive, listType;
listType = this.isListType(type);
isPrimitive = ((listType != null) && models[listType]) || (models[type] != null) ? false : true;
if (isPrimitive) {
return type;
} else {
if (listType != null) {
return models[listType].getMockSignature();
SwaggerOperation.prototype.getSignature = function (type, models) {
var isPrimitive, listType;
listType = this.isListType(type);
isPrimitive = ((listType != null) && models[listType]) || (models[type] != null) ? false : true;
if (isPrimitive) {
return type;
} else {
return models[type].getMockSignature();
if (listType != null) {
return models[listType].getMockSignature();
} else {
return models[type].getMockSignature();
}
}
}
};
};
SwaggerOperation.prototype.getSampleJSON = function(type, models) {
var isPrimitive, listType, val;
listType = this.isListType(type);
isPrimitive = ((listType != null) && models[listType]) || (models[type] != null) ? false : true;
val = isPrimitive ? void 0 : (listType != null ? models[listType].createJSONSample() : models[type].createJSONSample());
if (val) {
val = listType ? [val] : val;
if(typeof val == "string")
return val;
else if(typeof val === "object") {
var t = val;
if(val instanceof Array && val.length > 0) {
t = val[0];
SwaggerOperation.prototype.getSampleJSON = function (type, models) {
var isPrimitive, listType, val;
listType = this.isListType(type);
isPrimitive = ((listType != null) && models[listType]) || (models[type] != null) ? false : true;
val = isPrimitive ? void 0 : (listType != null ? models[listType].createJSONSample() : models[type].createJSONSample());
if (val) {
val = listType ? [val] : val;
if (typeof val == "string")
return val;
else if (typeof val === "object") {
var t = val;
if (val instanceof Array && val.length > 0) {
t = val[0];
}
if (t.nodeName) {
var xmlString = new XMLSerializer().serializeToString(t);
return this.formatXml(xmlString);
}
else
return JSON.stringify(val, null, 2);
}
if(t.nodeName) {
var xmlString = new XMLSerializer().serializeToString(t);
return this.formatXml(xmlString);
}
else
return JSON.stringify(val, null, 2);
return val;
}
else
return val;
}
};
};
SwaggerOperation.prototype["do"] = function(args, opts, callback, error) {
var key, param, params, possibleParams, req, requestContentType, responseContentType, value, _i, _len, _ref;
if (args == null) {
args = {};
}
if (opts == null) {
opts = {};
}
requestContentType = null;
responseContentType = null;
if ((typeof args) === "function") {
error = opts;
callback = args;
args = {};
}
if ((typeof opts) === "function") {
error = callback;
callback = opts;
}
if (error == null) {
error = function(xhr, textStatus, error) {
return log(xhr, textStatus, error);
};
}
if (callback == null) {
callback = function(response) {
var content;
content = null;
if (response != null) {
content = response.data;
} else {
content = "no data";
SwaggerOperation.prototype["do"] = function (args, opts, callback, error) {
var key, param, params, possibleParams, req, requestContentType, responseContentType, value, _i, _len, _ref;
if (args == null) {
args = {};
}
if (opts == null) {
opts = {};
}
requestContentType = null;
responseContentType = null;
if ((typeof args) === "function") {
error = opts;
callback = args;
args = {};
}
if ((typeof opts) === "function") {
error = callback;
callback = opts;
}
if (error == null) {
error = function (xhr, textStatus, error) {
return log(xhr, textStatus, error);
};
}
if (callback == null) {
callback = function (response) {
var content;
content = null;
if (response != null) {
content = response.data;
} else {
content = "no data";
}
return log("default callback: " + content);
};
}
params = {};
params.headers = [];
if (args.headers != null) {
params.headers = args.headers;
delete args.headers;
}
var possibleParams = [];
for (var i = 0; i < this.parameters.length; i++) {
var param = this.parameters[i];
if (param.paramType === 'header') {
if (args[param.name])
params.headers[param.name] = args[param.name];
}
return log("default callback: " + content);
};
}
params = {};
params.headers = [];
if (args.headers != null) {
params.headers = args.headers;
delete args.headers;
}
else if (param.paramType === 'form' || param.paramType.toLowerCase() === 'file')
possibleParams.push(param);
}
var possibleParams = [];
for(var i = 0; i < this.parameters.length; i++) {
var param = this.parameters[i];
if(param.paramType === 'header') {
if(args[param.name])
params.headers[param.name] = args[param.name];
if (args.body != null) {
params.body = args.body;
delete args.body;
}
else if(param.paramType === 'form' || param.paramType.toLowerCase() === 'file')
possibleParams.push(param);
}
if (args.body != null) {
params.body = args.body;
delete args.body;
}
if (possibleParams) {
var key;
for (key in possibleParams) {
value = possibleParams[key];
if (args[value.name]) {
params[value.name] = args[value.name];
if (possibleParams) {
var key;
for (key in possibleParams) {
var value = possibleParams[key];
if (args[value.name]) {
params[value.name] = args[value.name];
}
}
}
}
req = new SwaggerRequest(this.method, this.urlify(args), params, opts, callback, error, this);
if (opts.mock != null) {
return req;
} else {
return true;
}
};
req = new SwaggerRequest(this.method, this.urlify(args), params, opts, callback, error, this);
if (opts.mock != null) {
return req;
} else {
return true;
}
};
SwaggerOperation.prototype.pathJson = function() {
return this.path.replace("{format}", "json");
};
SwaggerOperation.prototype.pathJson = function () {
return this.path.replace("{format}", "json");
};
SwaggerOperation.prototype.pathXml = function() {
return this.path.replace("{format}", "xml");
};
SwaggerOperation.prototype.pathXml = function () {
return this.path.replace("{format}", "xml");
};
SwaggerOperation.prototype.encodePathParam = function(pathParam) {
var encParts, part, parts, _i, _len;
pathParam = pathParam.toString();
if (pathParam.indexOf("/") === -1) {
return encodeURIComponent(pathParam);
} else {
parts = pathParam.split("/");
encParts = [];
for (_i = 0, _len = parts.length; _i < _len; _i++) {
part = parts[_i];
encParts.push(encodeURIComponent(part));
SwaggerOperation.prototype.encodePathParam = function (pathParam) {
var encParts, part, parts, _i, _len;
pathParam = pathParam.toString();
if (pathParam.indexOf("/") === -1) {
return encodeURIComponent(pathParam);
} else {
parts = pathParam.split("/");
encParts = [];
for (_i = 0, _len = parts.length; _i < _len; _i++) {
part = parts[_i];
encParts.push(encodeURIComponent(part));
}
return encParts.join("/");
}
return encParts.join("/");
}
};
};
SwaggerOperation.prototype.urlify = function(args) {
var url = this.resource.basePath + this.pathJson();
var params = this.parameters;
for(var i = 0; i < params.length; i ++){
var param = params[i];
if (param.paramType === 'path') {
if(args[param.name]) {
// apply path params and remove from args
var reg = new RegExp('\{' + param.name + '[^\}]*\}', 'gi');
url = url.replace(reg, this.encodePathParam(args[param.name]));
delete args[param.name];
SwaggerOperation.prototype.urlify = function (args) {
var url = this.resource.basePath + this.pathJson();
var params = this.parameters;
for (var i = 0; i < params.length; i++) {
var param = params[i];
if (param.paramType === 'path') {
if (args[param.name]) {
// apply path params and remove from args
var reg = new RegExp('\\{\\s*?' + param.name + '.*?\\}(?=\\s*?(\\/|$))', 'gi');
url = url.replace(reg, this.encodePathParam(args[param.name]));
delete args[param.name];
}
else
throw "" + param.name + " is a required path param.";
}
else
throw "" + param.name + " is a required path param.";
}
}
var queryParams = "";
for(var i = 0; i < params.length; i ++){
var param = params[i];
if(param.paramType === 'query') {
if (args[param.name] !== undefined) {
if (queryParams !== '')
queryParams += "&";
queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]);
var queryParams = "";
for (var i = 0; i < params.length; i++) {
var param = params[i];
if (queryParams !== '')
queryParams += '&';
if (Array.isArray(param)) {
var j;
var output = '';
for(j = 0; j < param.length; j++) {
if(j > 0)
output += ',';
output += encodeURIComponent(param[j]);
}
queryParams += encodeURIComponent(param.name) + '=' + output;
}
else {
queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]);
}
}
}
if ((queryParams != null) && queryParams.length > 0)
url += '?' + queryParams;
return url;
};
return url;
};
SwaggerOperation.prototype.supportHeaderParams = function() {
return this.resource.api.supportHeaderParams;
};
SwaggerOperation.prototype.supportHeaderParams = function () {
return this.resource.api.supportHeaderParams;
};
SwaggerOperation.prototype.supportedSubmitMethods = function() {
return this.resource.api.supportedSubmitMethods;
};
SwaggerOperation.prototype.supportedSubmitMethods = function () {
return this.resource.api.supportedSubmitMethods;
};
SwaggerOperation.prototype.getQueryParams = function(args) {
return this.getMatchingParams(['query'], args);
};
SwaggerOperation.prototype.getQueryParams = function (args) {
return this.getMatchingParams(['query'], args);
};
SwaggerOperation.prototype.getHeaderParams = function(args) {
return this.getMatchingParams(['header'], args);
};
SwaggerOperation.prototype.getHeaderParams = function (args) {
return this.getMatchingParams(['header'], args);
};
SwaggerOperation.prototype.getMatchingParams = function(paramTypes, args) {
var matchingParams = {};
var params = this.parameters;
for (var i = 0; i < params.length; i++) {
param = params[i];
if (args && args[param.name])
matchingParams[param.name] = args[param.name];
}
var headers = this.resource.api.headers;
var name;
for (name in headers) {
var value = headers[name];
matchingParams[name] = value;
}
return matchingParams;
};
SwaggerOperation.prototype.getMatchingParams = function (paramTypes, args) {
var matchingParams = {};
var params = this.parameters;
for (var i = 0; i < params.length; i++) {
param = params[i];
if (args && args[param.name])
matchingParams[param.name] = args[param.name];
}
var headers = this.resource.api.headers;
var name;
for (name in headers) {
var value = headers[name];
matchingParams[name] = value;
}
return matchingParams;
};
SwaggerOperation.prototype.help = function() {
var msg = "";
var params = this.parameters;
for (var i = 0; i < params.length; i++) {
var param = params[i];
if (msg !== "")
msg += "\n";
msg += "* " + param.name + (param.required ? ' (required)' : '') + " - " + param.description;
}
return msg;
};
SwaggerOperation.prototype.help = function () {
var msg = "";
var params = this.parameters;
for (var i = 0; i < params.length; i++) {
var param = params[i];
if (msg !== "")
msg += "\n";
msg += "* " + param.name + (param.required ? ' (required)' : '') + " - " + param.description;
}
return msg;
};
SwaggerOperation.prototype.formatXml = function(xml) {
var contexp, formatted, indent, lastType, lines, ln, pad, reg, transitions, wsexp, _fn, _i, _len;
reg = /(>)(<)(\/*)/g;
wsexp = /[ ]*(.*)[ ]+\n/g;
contexp = /(<.+>)(.+\n)/g;
xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
pad = 0;
formatted = '';
lines = xml.split('\n');
indent = 0;
lastType = 'other';
transitions = {
'single->single': 0,
'single->closing': -1,
'single->opening': 0,
'single->other': 0,
'closing->single': 0,
'closing->closing': -1,
'closing->opening': 0,
'closing->other': 0,
'opening->single': 1,
'opening->closing': 0,
'opening->opening': 1,
'opening->other': 1,
'other->single': 0,
'other->closing': -1,
'other->opening': 0,
'other->other': 0
};
_fn = function(ln) {
var fromTo, j, key, padding, type, types, value;
types = {
single: Boolean(ln.match(/<.+\/>/)),
closing: Boolean(ln.match(/<\/.+>/)),
opening: Boolean(ln.match(/<[^!?].*>/))
SwaggerOperation.prototype.formatXml = function (xml) {
var contexp, formatted, indent, lastType, lines, ln, pad, reg, transitions, wsexp, _fn, _i, _len;
reg = /(>)(<)(\/*)/g;
wsexp = /[ ]*(.*)[ ]+\n/g;
contexp = /(<.+>)(.+\n)/g;
xml = xml.replace(reg, '$1\n$2$3').replace(wsexp, '$1\n').replace(contexp, '$1\n$2');
pad = 0;
formatted = '';
lines = xml.split('\n');
indent = 0;
lastType = 'other';
transitions = {
'single->single': 0,
'single->closing': -1,
'single->opening': 0,
'single->other': 0,
'closing->single': 0,
'closing->closing': -1,
'closing->opening': 0,
'closing->other': 0,
'opening->single': 1,
'opening->closing': 0,
'opening->opening': 1,
'opening->other': 1,
'other->single': 0,
'other->closing': -1,
'other->opening': 0,
'other->other': 0
};
type = ((function() {
var _results;
_results = [];
for (key in types) {
value = types[key];
if (value) {
_results.push(key);
_fn = function (ln) {
var fromTo, j, key, padding, type, types, value;
types = {
single: Boolean(ln.match(/<.+\/>/)),
closing: Boolean(ln.match(/<\/.+>/)),
opening: Boolean(ln.match(/<[^!?].*>/))
};
type = ((function () {
var _results;
_results = [];
for (key in types) {
value = types[key];
if (value) {
_results.push(key);
}
}
return _results;
})())[0];
type = type === void 0 ? 'other' : type;
fromTo = lastType + '->' + type;
lastType = type;
padding = '';
indent += transitions[fromTo];
padding = ((function () {
var _j, _ref5, _results;
_results = [];
for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) {
_results.push(' ');
}
return _results;
})()).join('');
if (fromTo === 'opening->closing') {
return formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
} else {
return formatted += padding + ln + '\n';
}
return _results;
})())[0];
type = type === void 0 ? 'other' : type;
fromTo = lastType + '->' + type;
lastType = type;
padding = '';
indent += transitions[fromTo];
padding = ((function() {
var _j, _ref5, _results;
_results = [];
for (j = _j = 0, _ref5 = indent; 0 <= _ref5 ? _j < _ref5 : _j > _ref5; j = 0 <= _ref5 ? ++_j : --_j) {
_results.push(' ');
}
return _results;
})()).join('');
if (fromTo === 'opening->closing') {
return formatted = formatted.substr(0, formatted.length - 1) + ln + '\n';
} else {
return formatted += padding + ln + '\n';
};
for (_i = 0, _len = lines.length; _i < _len; _i++) {
ln = lines[_i];
_fn(ln);
}
return formatted;
};
for (_i = 0, _len = lines.length; _i < _len; _i++) {
ln = lines[_i];
_fn(ln);
}
return formatted;
};
var SwaggerRequest = function(type, url, params, opts, successCallback, errorCallback, operation, execution) {
var _this = this;
var errors = [];
this.useJQuery = (typeof operation.resource.useJQuery !== 'undefined' ? operation.resource.useJQuery : null);
this.type = (type||errors.push("SwaggerRequest type is required (get/post/put/delete/patch/options)."));
this.url = (url||errors.push("SwaggerRequest url is required."));
this.params = params;
this.opts = opts;
this.successCallback = (successCallback||errors.push("SwaggerRequest successCallback is required."));
this.errorCallback = (errorCallback||errors.push("SwaggerRequest error callback is required."));
this.operation = (operation||errors.push("SwaggerRequest operation is required."));
this.execution = execution;
this.headers = (params.headers||{});
var SwaggerRequest = function (type, url, params, opts, successCallback, errorCallback, operation, execution) {
var _this = this;
var errors = [];
this.useJQuery = (typeof operation.resource.useJQuery !== 'undefined' ? operation.resource.useJQuery : null);
this.type = (type || errors.push("SwaggerRequest type is required (get/post/put/delete/patch/options)."));
this.url = (url || errors.push("SwaggerRequest url is required."));
this.params = params;
this.opts = opts;
this.successCallback = (successCallback || errors.push("SwaggerRequest successCallback is required."));
this.errorCallback = (errorCallback || errors.push("SwaggerRequest error callback is required."));
this.operation = (operation || errors.push("SwaggerRequest operation is required."));
this.execution = execution;
this.headers = (params.headers || {});
if(errors.length > 0) {
throw errors;
}
if (errors.length > 0) {
throw errors;
}
this.type = this.type.toUpperCase();
this.type = this.type.toUpperCase();
// set request, response content type headers
var headers = this.setHeaders(params, this.operation);
var body = params.body;
// set request, response content type headers
var headers = this.setHeaders(params, this.operation);
var body = params.body;
// encode the body for form submits
if (headers["Accept"] && headers["Accept"].indexOf("application/x-www-form-urlencoded") === 0) {
var fields = {};
var possibleParams = {};
var values = {};
var key;
for(key in formParams){
var param = formParams[key];
values[param.name] = param;
}
// encode the body for form submits
if (headers["Content-Type"]) {
var values = {};
var i;
var operationParams = this.operation.parameters;
for (i = 0; i < operationParams.length; i++) {
var param = operationParams[i];
if (param.paramType === "form")
values[param.name] = param;
}
var encoded = "";
var key;
for(key in values) {
value = this.params[key];
if(typeof value !== 'undefined'){
if(encoded !== "")
encoded += "&";
encoded += encodeURIComponent(key) + '=' + encodeURIComponent(value);
if (headers["Content-Type"].indexOf("application/x-www-form-urlencoded") === 0) {
var encoded = "";
var key, value;
for (key in values) {
value = this.params[key];
if (typeof value !== 'undefined') {
if (encoded !== "")
encoded += "&";
encoded += encodeURIComponent(key) + '=' + encodeURIComponent(value);
}
}
body = encoded;
}
else if (headers["Content-Type"].indexOf("multipart/form-data") === 0) {
// encode the body for form submits
var data = "";
var boundary = "----SwaggerFormBoundary" + Date.now();
var key, value;
for (key in values) {
value = this.params[key];
if (typeof value !== 'undefined') {
data += '--' + boundary + '\n';
data += 'Content-Disposition: form-data; name="' + key + '"';
data += '\n\n';
data += value + "\n";
}
}
data += "--" + boundary + "--\n";
headers["Content-Type"] = "multipart/form-data; boundary=" + boundary;
body = data;
}
}
body = encoded;
}
if (!((this.headers != null) && (this.headers.mock != null))) {
obj = {
url: this.url,
method: this.type,
headers: headers,
body: body,
useJQuery: this.useJQuery,
on: {
error: function(response) {
return _this.errorCallback(response, _this.opts.parent);
},
redirect: function(response) {
return _this.successCallback(response, _this.opts.parent);
},
307: function(response) {
return _this.successCallback(response, _this.opts.parent);
},
response: function(response) {
return _this.successCallback(response, _this.opts.parent);
var obj;
if (!((this.headers != null) && (this.headers.mock != null))) {
obj = {
url: this.url,
method: this.type,
headers: headers,
body: body,
useJQuery: this.useJQuery,
on: {
error: function (response) {
return _this.errorCallback(response, _this.opts.parent);
},
redirect: function (response) {
return _this.successCallback(response, _this.opts.parent);
},
307: function (response) {
return _this.successCallback(response, _this.opts.parent);
},
response: function (response) {
return _this.successCallback(response, _this.opts.parent);
}
}
};
var e;
if (typeof window !== 'undefined') {
e = window;
} else {
e = exports;
}
};
var e;
if (typeof window !== 'undefined') {
e = window;
} else {
e = exports;
}
status = e.authorizations.apply(obj, this.operation.authorizations);
if (opts.mock == null) {
if (status !== false) {
new SwaggerHttp().execute(obj);
var status = e.authorizations.apply(obj, this.operation.authorizations);
if (opts.mock == null) {
if (status !== false) {
new SwaggerHttp().execute(obj);
} else {
obj.canceled = true;
}
} else {
obj.canceled = true;
return obj;
}
} else {
return obj;
}
}
};
return obj;
};
SwaggerRequest.prototype.setHeaders = function(params, operation) {
// default type
var accepts = "application/json";
var contentType = null;
SwaggerRequest.prototype.setHeaders = function (params, operation) {
// default type
var accepts = "application/json";
var consumes = "application/json";
var allDefinedParams = this.operation.parameters;
var definedFormParams = [];
var definedFileParams = [];
var body = params.body;
var headers = {};
var allDefinedParams = this.operation.parameters;
var definedFormParams = [];
var definedFileParams = [];
var body = params.body;
var headers = {};
// get params from the operation and set them in definedFileParams, definedFormParams, headers
var i;
for(i = 0; i < allDefinedParams.length; i++) {
var param = allDefinedParams[i];
if(param.paramType === "form")
definedFormParams.push(param);
else if(param.paramType === "file")
definedFileParams.push(param);
else if(param.paramType === "header" && this.params.headers) {
var key = param.name;
var headerValue = this.params.headers[param.name];
if(typeof this.params.headers[param.name] !== 'undefined')
headers[key] = headerValue;
// get params from the operation and set them in definedFileParams, definedFormParams, headers
var i;
for (i = 0; i < allDefinedParams.length; i++) {
var param = allDefinedParams[i];
if (param.paramType === "form")
definedFormParams.push(param);
else if (param.paramType === "file")
definedFileParams.push(param);
else if (param.paramType === "header" && this.params.headers) {
var key = param.name;
var headerValue = this.params.headers[param.name];
if (typeof this.params.headers[param.name] !== 'undefined')
headers[key] = headerValue;
}
}
}
// if there's a body, need to set the accepts header via requestContentType
if (body && (this.type === "POST" || this.type === "PUT" || this.type === "PATCH" || this.type === "DELETE")) {
if (this.opts.requestContentType)
accepts = this.opts.requestContentType;
} else {
// if any form params, content type must be set
if(definedFormParams.length > 0) {
if(definedFileParams.length > 0)
accepts = "multipart/form-data";
else
accepts = "application/x-www-form-urlencoded";
// if there's a body, need to set the accepts header via requestContentType
if (body && (this.type === "POST" || this.type === "PUT" || this.type === "PATCH" || this.type === "DELETE")) {
if (this.opts.requestContentType)
consumes = this.opts.requestContentType;
} else {
// if any form params, content type must be set
if (definedFormParams.length > 0) {
if (definedFileParams.length > 0)
consumes = "multipart/form-data";
else
consumes = "application/x-www-form-urlencoded";
}
else if (this.type === "DELETE")
body = "{}";
else if (this.type != "DELETE")
accepts = null;
}
else if (this.type == "DELETE")
body = "{}";
else if (this.type != "DELETE")
accepts = null;
}
if (contentType && this.operation.consumes) {
if (this.operation.consumes.indexOf(contentType) === -1) {
log("server doesn't consume " + contentType + ", try " + JSON.stringify(this.operation.consumes));
contentType = this.operation.consumes[0];
if (consumes && this.operation.consumes) {
if (this.operation.consumes.indexOf(consumes) === -1) {
log("server doesn't consume " + consumes + ", try " + JSON.stringify(this.operation.consumes));
consumes = this.operation.consumes[0];
}
}
}
if (this.opts.responseContentType) {
accepts = this.opts.responseContentType;
} else {
accepts = "application/json";
}
if (accepts && this.operation.produces) {
if (this.operation.produces.indexOf(accepts) === -1) {
log("server can't produce " + accepts);
accepts = this.operation.produces[0];
if (this.opts.responseContentType) {
accepts = this.opts.responseContentType;
} else {
accepts = "application/json";
}
}
if (contentType && contentType.indexOf("application/x-www-form-urlencoded") === 0) {
var fields = {};
var possibleParams = {};
var values = {};
var key;
for(key in formParams){
var param = formParams[key];
values[param.name] = param;
if (accepts && this.operation.produces) {
if (this.operation.produces.indexOf(accepts) === -1) {
log("server can't produce " + accepts);
accepts = this.operation.produces[0];
}
}
var encoded = "";
var key;
for(key in values) {
value = this.params[key];
if(typeof value !== 'undefined'){
if(encoded !== "")
encoded += "&";
encoded += encodeURIComponent(key) + '=' + encodeURIComponent(value);
}
}
body = encoded;
if ((consumes && body !== "") || (consumes === "application/x-www-form-urlencoded"))
headers["Content-Type"] = consumes;
if (accepts)
headers["Accept"] = accepts;
return headers;
}
if ((contentType && body !== "") || (contentType === "application/x-www-form-urlencoded"))
headers["Content-Type"] = contentType;
if (accepts)
headers["Accept"] = accepts;
return headers;
}
SwaggerRequest.prototype.asCurl = function() {
var results = [];
if(this.headers) {
var key;
for(key in this.headers) {
results.push("--header \"" + key + ": " + this.headers[v] + "\"");
SwaggerRequest.prototype.asCurl = function () {
var results = [];
if (this.headers) {
var key;
for (key in this.headers) {
results.push("--header \"" + key + ": " + this.headers[v] + "\"");
}
}
}
return "curl " + (results.join(" ")) + " " + this.url;
};
return "curl " + (results.join(" ")) + " " + this.url;
};
/**
* SwaggerHttp is a wrapper for executing requests
*/
var SwaggerHttp = function() {};
/**
* SwaggerHttp is a wrapper for executing requests
*/
var SwaggerHttp = function () { };
SwaggerHttp.prototype.execute = function(obj) {
if(obj && (typeof obj.useJQuery === 'boolean'))
this.useJQuery = obj.useJQuery;
else
this.useJQuery = this.isIE8();
SwaggerHttp.prototype.execute = function (obj) {
if (obj && (typeof obj.useJQuery === 'boolean'))
this.useJQuery = obj.useJQuery;
else
this.useJQuery = this.isIE8();
if(this.useJQuery)
return new JQueryHttpClient().execute(obj);
else
return new ShredHttpClient().execute(obj);
}
if (this.useJQuery)
return new JQueryHttpClient().execute(obj);
else
return new ShredHttpClient().execute(obj);
}
SwaggerHttp.prototype.isIE8 = function() {
var detectedIE = false;
if (typeof navigator !== 'undefined' && navigator.userAgent) {
nav = navigator.userAgent.toLowerCase();
if (nav.indexOf('msie') !== -1) {
var version = parseInt(nav.split('msie')[1]);
if (version <= 8) {
detectedIE = true;
SwaggerHttp.prototype.isIE8 = function () {
var detectedIE = false;
if (typeof navigator !== 'undefined' && navigator.userAgent) {
nav = navigator.userAgent.toLowerCase();
if (nav.indexOf('msie') !== -1) {
var version = parseInt(nav.split('msie')[1]);
if (version <= 8) {
detectedIE = true;
}
}
}
}
return detectedIE;
};
return detectedIE;
};
/*
* JQueryHttpClient lets a browser take advantage of JQuery's cross-browser magic.
* NOTE: when jQuery is available it will export both '$' and 'jQuery' to the global space.
* Since we are using closures here we need to alias it for internal use.
*/
var JQueryHttpClient = function(options) {
"use strict";
if(!jQuery){
var jQuery = window.jQuery;
/*
* JQueryHttpClient lets a browser take advantage of JQuery's cross-browser magic.
* NOTE: when jQuery is available it will export both '$' and 'jQuery' to the global space.
* Since we are using closures here we need to alias it for internal use.
*/
var JQueryHttpClient = function (options) {
"use strict";
if (!jQuery) {
var jQuery = window.jQuery;
}
}
}
JQueryHttpClient.prototype.execute = function(obj) {
var cb = obj.on;
var request = obj;
JQueryHttpClient.prototype.execute = function (obj) {
var cb = obj.on;
var request = obj;
obj.type = obj.method;
obj.cache = false;
obj.type = obj.method;
obj.cache = false;
obj.beforeSend = function(xhr) {
var key, results;
if (obj.headers) {
results = [];
var key;
for (key in obj.headers) {
if (key.toLowerCase() === "content-type") {
results.push(obj.contentType = obj.headers[key]);
} else if (key.toLowerCase() === "accept") {
results.push(obj.accepts = obj.headers[key]);
} else {
results.push(xhr.setRequestHeader(key, obj.headers[key]));
obj.beforeSend = function (xhr) {
var key, results;
if (obj.headers) {
results = [];
var key;
for (key in obj.headers) {
if (key.toLowerCase() === "content-type") {
results.push(obj.contentType = obj.headers[key]);
} else if (key.toLowerCase() === "accept") {
results.push(obj.accepts = obj.headers[key]);
} else {
results.push(xhr.setRequestHeader(key, obj.headers[key]));
}
}
return results;
}
return results;
}
};
};
obj.data = obj.body;
obj.complete = function(response, textStatus, opts) {
var headers = {},
obj.data = obj.body;
obj.complete = function (response, textStatus, opts) {
var headers = {},
headerArray = response.getAllResponseHeaders().split("\n");
for(var i = 0; i < headerArray.length; i++) {
var toSplit = headerArray[i].trim();
if(toSplit.length === 0)
continue;
var separator = toSplit.indexOf(":");
if(separator === -1) {
// Name but no value in the header
headers[toSplit] = null;
continue;
for (var i = 0; i < headerArray.length; i++) {
var toSplit = headerArray[i].trim();
if (toSplit.length === 0)
continue;
var separator = toSplit.indexOf(":");
if (separator === -1) {
// Name but no value in the header
headers[toSplit] = null;
continue;
}
var name = toSplit.substring(0, separator).trim(),
value = toSplit.substring(separator + 1).trim();
headers[name] = value;
}
var name = toSplit.substring(0, separator).trim(),
value = toSplit.substring(separator + 1).trim();
headers[name] = value;
}
var out = {
url: request.url,
method: request.method,
status: response.status,
data: response.responseText,
headers: headers
};
var out = {
url: request.url,
method: request.method,
status: response.status,
data: response.responseText,
headers: headers
};
var contentType = (headers["content-type"]||headers["Content-Type"]||null)
var contentType = (headers["content-type"] || headers["Content-Type"] || null)
if(contentType != null) {
if(contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
if(response.responseText && response.responseText !== "")
out.obj = JSON.parse(response.responseText);
else
out.obj = {}
if (contentType != null) {
if (contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
if (response.responseText && response.responseText !== "")
out.obj = JSON.parse(response.responseText);
else
out.obj = {}
}
}
}
if(response.status >= 200 && response.status < 300)
cb.response(out);
else if(response.status === 0 || (response.status >= 400 && response.status < 599))
cb.error(out);
else
return cb.response(out);
};
if (response.status >= 200 && response.status < 300)
cb.response(out);
else if (response.status === 0 || (response.status >= 400 && response.status < 599))
cb.error(out);
else
return cb.response(out);
};
jQuery.support.cors = true;
return jQuery.ajax(obj);
}
jQuery.support.cors = true;
return jQuery.ajax(obj);
}
/*
* ShredHttpClient is a light-weight, node or browser HTTP client
*/
var ShredHttpClient = function(options) {
this.options = (options||{});
this.isInitialized = false;
/*
* ShredHttpClient is a light-weight, node or browser HTTP client
*/
var ShredHttpClient = function (options) {
this.options = (options || {});
this.isInitialized = false;
var identity, toString;
var identity, toString;
if (typeof window !== 'undefined') {
this.Shred = require("./shred");
this.content = require("./shred/content");
if (typeof window !== 'undefined') {
this.Shred = require("./shred");
this.content = require("./shred/content");
}
else
this.Shred = require("shred");
this.shred = new this.Shred();
}
else
this.Shred = require("shred");
this.shred = new this.Shred();
}
ShredHttpClient.prototype.initShred = function () {
this.isInitialized = true;
this.registerProcessors(this.shred);
}
ShredHttpClient.prototype.initShred = function () {
this.isInitialized = true;
this.registerProcessors(this.shred);
}
ShredHttpClient.prototype.registerProcessors = function(shred) {
var identity = function(x) {
return x;
};
var toString = function(x) {
return x.toString();
};
ShredHttpClient.prototype.registerProcessors = function (shred) {
var identity = function (x) {
return x;
};
var toString = function (x) {
return x.toString();
};
if (typeof window !== 'undefined') {
this.content.registerProcessor(["application/json; charset=utf-8", "application/json", "json"], {
parser: identity,
stringify: toString
});
} else {
this.Shred.registerProcessor(["application/json; charset=utf-8", "application/json", "json"], {
parser: identity,
stringify: toString
});
if (typeof window !== 'undefined') {
this.content.registerProcessor(["application/json; charset=utf-8", "application/json", "json"], {
parser: identity,
stringify: toString
});
} else {
this.Shred.registerProcessor(["application/json; charset=utf-8", "application/json", "json"], {
parser: identity,
stringify: toString
});
}
}
}
ShredHttpClient.prototype.execute = function(obj) {
if(!this.isInitialized)
this.initShred();
ShredHttpClient.prototype.execute = function (obj) {
if (!this.isInitialized)
this.initShred();
var cb = obj.on, res;
var cb = obj.on, res;
var transform = function(response) {
var out = {
headers: response._headers,
url: response.request.url,
method: response.request.method,
status: response.status,
data: response.content.data
var transform = function (response) {
var out = {
headers: response._headers,
url: response.request.url,
method: response.request.method,
status: response.status,
data: response.content.data
};
var headers = response._headers.normalized || response._headers;
var contentType = (headers["content-type"] || headers["Content-Type"] || null)
if (contentType != null) {
if (contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
if (response.content.data && response.content.data !== "")
out.obj = JSON.parse(response.content.data);
else
out.obj = {}
}
}
return out;
};
var contentType = (response._headers["content-type"]||response._headers["Content-Type"]||null)
// Transform an error into a usable response-like object
var transformError = function (error) {
var out = {
// Default to a status of 0 - The client will treat this as a generic permissions sort of error
status: 0,
data: error.message || error
};
if(contentType != null) {
if(contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {
if(response.content.data && response.content.data !== "")
out.obj = JSON.parse(response.content.data);
else
out.obj = {}
if (error.code) {
out.obj = error;
if (error.code === 'ENOTFOUND' || error.code === 'ECONNREFUSED') {
// We can tell the client that this should be treated as a missing resource and not as a permissions thing
out.status = 404;
}
}
return out;
};
var res = {
error: function (response) {
if (obj)
return cb.error(transform(response));
},
// Catch the Shred error raised when the request errors as it is made (i.e. No Response is coming)
request_error: function (err) {
if (obj)
return cb.error(transformError(err));
},
redirect: function (response) {
if (obj)
return cb.redirect(transform(response));
},
307: function (response) {
if (obj)
return cb.redirect(transform(response));
},
response: function (response) {
if (obj)
return cb.response(transform(response));
}
};
if (obj) {
obj.on = res;
}
return out;
return this.shred.request(obj);
};
res = {
error: function(response) {
if (obj)
return cb.error(transform(response));
},
redirect: function(response) {
if (obj)
return cb.redirect(transform(response));
},
307: function(response) {
if (obj)
return cb.redirect(transform(response));
},
response: function(response) {
if (obj)
return cb.response(transform(response));
}
/**
* SwaggerAuthorizations applys the correct authorization to an operation being executed
*/
var SwaggerAuthorizations = function () {
this.authz = {};
};
if (obj) {
obj.on = res;
}
return this.shred.request(obj);
};
/**
* SwaggerAuthorizations applys the correct authorization to an operation being executed
*/
var SwaggerAuthorizations = function() {
this.authz = {};
};
SwaggerAuthorizations.prototype.add = function (name, auth) {
this.authz[name] = auth;
return auth;
};
SwaggerAuthorizations.prototype.add = function(name, auth) {
this.authz[name] = auth;
return auth;
};
SwaggerAuthorizations.prototype.remove = function (name) {
return delete this.authz[name];
};
SwaggerAuthorizations.prototype.remove = function(name) {
return delete this.authz[name];
};
SwaggerAuthorizations.prototype.apply = function (obj, authorizations) {
var status = null;
var key, value, result;
SwaggerAuthorizations.prototype.apply = function(obj, authorizations) {
var status = null;
var key;
// if the "authorizations" key is undefined, or has an empty array, add all keys
if(typeof authorizations === 'undefined' || Object.keys(authorizations).length == 0) {
for (key in this.authz) {
value = this.authz[key];
result = value.apply(obj, authorizations);
if (result === true)
status = true;
// if the "authorizations" key is undefined, or has an empty array, add all keys
if (typeof authorizations === 'undefined' || Object.keys(authorizations).length == 0) {
for (key in this.authz) {
value = this.authz[key];
result = value.apply(obj, authorizations);
if (result === true)
status = true;
}
}
}
else {
for(name in authorizations) {
for (key in this.authz) {
if(key == name) {
value = this.authz[key];
result = value.apply(obj, authorizations);
if (result === true)
status = true;
else {
for (name in authorizations) {
for (key in this.authz) {
if (key == name) {
value = this.authz[key];
result = value.apply(obj, authorizations);
if (result === true)
status = true;
}
}
}
}
}
}
return status;
};
return status;
};
/**
* ApiKeyAuthorization allows a query param or header to be injected
*/
var ApiKeyAuthorization = function(name, value, type) {
this.name = name;
this.value = value;
this.type = type;
};
/**
* ApiKeyAuthorization allows a query param or header to be injected
*/
var ApiKeyAuthorization = function (name, value, type, delimiter) {
this.name = name;
this.value = value;
this.type = type;
this.delimiter = delimiter;
};
ApiKeyAuthorization.prototype.apply = function(obj, authorizations) {
if (this.type === "query") {
if (obj.url.indexOf('?') > 0)
obj.url = obj.url + "&" + this.name + "=" + this.value;
else
obj.url = obj.url + "?" + this.name + "=" + this.value;
ApiKeyAuthorization.prototype.apply = function (obj, authorizations) {
if (this.type === "query") {
if (obj.url.indexOf('?') > 0)
obj.url = obj.url + "&" + this.name + "=" + this.value;
else
obj.url = obj.url + "?" + this.name + "=" + this.value;
return true;
} else if (this.type === "header") {
if (typeof obj.headers[this.name] !== 'undefined') {
if (typeof this.delimiter !== 'undefined')
obj.headers[this.name] = obj.headers[this.name] + this.delimiter + this.value;
}
else
obj.headers[this.name] = this.value;
return true;
}
};
var CookieAuthorization = function (cookie) {
this.cookie = cookie;
}
CookieAuthorization.prototype.apply = function (obj, authorizations) {
obj.cookieJar = obj.cookieJar || CookieJar();
obj.cookieJar.setCookie(this.cookie);
return true;
} else if (this.type === "header") {
obj.headers[this.name] = this.value;
return true;
}
};
var CookieAuthorization = function(cookie) {
this.cookie = cookie;
}
/**
* Password Authorization is a basic auth implementation
*/
var PasswordAuthorization = function (name, username, password) {
this.name = name;
this.username = username;
this.password = password;
this._btoa = null;
if (typeof window !== 'undefined')
this._btoa = btoa;
else
this._btoa = require("btoa");
};
CookieAuthorization.prototype.apply = function(obj, authorizations) {
obj.cookieJar = obj.cookieJar || CookieJar();
obj.cookieJar.setCookie(this.cookie);
return true;
}
PasswordAuthorization.prototype.apply = function (obj, authorizations) {
var base64encoder = this._btoa;
obj.headers["Authorization"] = "Basic " + base64encoder(this.username + ":" + this.password);
return true;
};
/**
* Password Authorization is a basic auth implementation
*/
var PasswordAuthorization = function(name, username, password) {
this.name = name;
this.username = username;
this.password = password;
this._btoa = null;
if (typeof window !== 'undefined')
this._btoa = btoa;
else
this._btoa = require("btoa");
};
var e = (typeof window !== 'undefined' ? window : exports);
PasswordAuthorization.prototype.apply = function(obj, authorizations) {
var base64encoder = this._btoa;
obj.headers["Authorization"] = "Basic " + base64encoder(this.username + ":" + this.password);
return true;
};
var sampleModels = {};
var cookies = {};
var e = (typeof window !== 'undefined' ? window : exports);
e.parameterMacro = parameterMacro;
e.modelPropertyMacro = modelPropertyMacro;
e.SampleModels = sampleModels;
e.SwaggerHttp = SwaggerHttp;
e.SwaggerRequest = SwaggerRequest;
e.authorizations = new SwaggerAuthorizations();
e.ApiKeyAuthorization = ApiKeyAuthorization;
e.PasswordAuthorization = PasswordAuthorization;
e.CookieAuthorization = CookieAuthorization;
e.JQueryHttpClient = JQueryHttpClient;
e.ShredHttpClient = ShredHttpClient;
e.SwaggerOperation = SwaggerOperation;
e.SwaggerModel = SwaggerModel;
e.SwaggerModelProperty = SwaggerModelProperty;
e.SwaggerResource = SwaggerResource;
e.SwaggerApi = SwaggerApi;
e.log = log;
var sampleModels = {};
var cookies = {};
e.SampleModels = sampleModels;
e.SwaggerHttp = SwaggerHttp;
e.SwaggerRequest = SwaggerRequest;
e.authorizations = new SwaggerAuthorizations();
e.ApiKeyAuthorization = ApiKeyAuthorization;
e.PasswordAuthorization = PasswordAuthorization;
e.CookieAuthorization = CookieAuthorization;
e.JQueryHttpClient = JQueryHttpClient;
e.ShredHttpClient = ShredHttpClient;
e.SwaggerOperation = SwaggerOperation;
e.SwaggerModel = SwaggerModel;
e.SwaggerModelProperty = SwaggerModelProperty;
e.SwaggerResource = SwaggerResource;
e.SwaggerApi = SwaggerApi;
})();

@@ -1,1 +0,1 @@

$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments)[0])}};if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="contentType"></label>\n<select name="contentType">\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(h,n,g,m,l){this.compilerInfo=[4,">= 1.0.0"];g=this.merge(g,h.helpers);l=l||{};var j="",c,s,i="function",k=this.escapeExpression,q=this;function f(x,w){var t="",v,u;t+='\n <div class="info_title">'+k(((v=((v=x.info),v==null||v===false?v:v.title)),typeof v===i?v.apply(x):v))+'</div>\n <div class="info_description">';u=((v=((v=x.info),v==null||v===false?v:v.description)),typeof v===i?v.apply(x):v);if(u||u===0){t+=u}t+="</div>\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.termsOfServiceUrl),{hash:{},inverse:q.noop,fn:q.program(2,d,w),data:w});if(u||u===0){t+=u}t+="\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.contact),{hash:{},inverse:q.noop,fn:q.program(4,r,w),data:w});if(u||u===0){t+=u}t+="\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.license),{hash:{},inverse:q.noop,fn:q.program(6,p,w),data:w});if(u||u===0){t+=u}t+="\n ";return t}function d(w,v){var t="",u;t+='<div class="info_tos"><a href="'+k(((u=((u=w.info),u==null||u===false?u:u.termsOfServiceUrl)),typeof u===i?u.apply(w):u))+'">Terms of service</a></div>';return t}function r(w,v){var t="",u;t+="<div class='info_contact'><a href=\"mailto:"+k(((u=((u=((u=w.info),u==null||u===false?u:u.contact)),u==null||u===false?u:u.name)),typeof u===i?u.apply(w):u))+'">Contact the developer</a></div>';return t}function p(w,v){var t="",u;t+="<div class='info_license'><a href='"+k(((u=((u=((u=w.info),u==null||u===false?u:u.license)),u==null||u===false?u:u.url)),typeof u===i?u.apply(w):u))+"'>"+k(((u=((u=((u=w.info),u==null||u===false?u:u.license)),u==null||u===false?u:u.name)),typeof u===i?u.apply(w):u))+"</a></div>";return t}function o(w,v){var t="",u;t+='\n , <span style="font-variant: small-caps">api version</span>: '+k(((u=((u=w.info),u==null||u===false?u:u.version)),typeof u===i?u.apply(w):u))+"\n ";return t}function e(w,v){var t="",u;t+='\n <span style="float:right"><a href="';if(u=g.validatorUrl){u=u.call(w,{hash:{},data:v})}else{u=w.validatorUrl;u=typeof u===i?u.apply(w):u}t+=k(u)+"/debug?url=";if(u=g.url){u=u.call(w,{hash:{},data:v})}else{u=w.url;u=typeof u===i?u.apply(w):u}t+=k(u)+'"><img id="validator" src="';if(u=g.validatorUrl){u=u.call(w,{hash:{},data:v})}else{u=w.validatorUrl;u=typeof u===i?u.apply(w):u}t+=k(u)+"?url=";if(u=g.url){u=u.call(w,{hash:{},data:v})}else{u=w.url;u=typeof u===i?u.apply(w):u}t+=k(u)+'"></a>\n </span>\n ';return t}j+="<div class='info' id='api_info'>\n ";c=g["if"].call(n,n.info,{hash:{},inverse:q.noop,fn:q.program(1,f,l),data:l});if(c||c===0){j+=c}j+="\n</div>\n<div class='container' id='resources_container'>\n <ul id='resources'>\n </ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ";if(c=g.basePath){c=c.call(n,{hash:{},data:l})}else{c=n.basePath;c=typeof c===i?c.apply(n):c}j+=k(c)+"\n ";s=g["if"].call(n,((c=n.info),c==null||c===false?c:c.version),{hash:{},inverse:q.noop,fn:q.program(8,o,l),data:l});if(s||s===0){j+=s}j+="]\n ";s=g["if"].call(n,n.validatorUrl,{hash:{},inverse:q.noop,fn:q.program(10,e,l),data:l});if(s||s===0){j+=s}j+="\n </h4>\n </div>\n</div>\n";return j})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.operation=b(function(j,u,s,o,A){this.compilerInfo=[4,">= 1.0.0"];s=this.merge(s,j.helpers);A=A||{};var t="",k,f,e="function",d=this.escapeExpression,r=this,c=s.blockHelperMissing;function q(C,B){return"deprecated"}function p(C,B){return"\n <h4>Warning: Deprecated</h4>\n "}function n(E,D){var B="",C;B+="\n <h4>Implementation Notes</h4>\n <p>";if(C=s.description){C=C.call(E,{hash:{},data:D})}else{C=E.description;C=typeof C===e?C.apply(E):C}if(C||C===0){B+=C}B+="</p>\n ";return B}function m(C,B){return'\n <div class="auth">\n <span class="api-ic ic-error"></span>'}function i(E,D){var B="",C;B+='\n <div id="api_information_panel" style="top: 526px; left: 776px; display: none;">\n ';C=s.each.call(E,E,{hash:{},inverse:r.noop,fn:r.program(10,z,D),data:D});if(C||C===0){B+=C}B+="\n </div>\n ";return B}function z(F,E){var B="",D,C;B+="\n <div title='";C=((D=F.description),typeof D===e?D.apply(F):D);if(C||C===0){B+=C}B+="'>"+d(((D=F.scope),typeof D===e?D.apply(F):D))+"</div>\n ";return B}function y(C,B){return"</div>"}function x(C,B){return'\n <div class=\'access\'>\n <span class="api-ic ic-off" title="click to authenticate"></span>\n </div>\n '}function w(C,B){return'\n <h4>Response Class</h4>\n <p><span class="model-signature" /></p>\n <br/>\n <div class="response-content-type" />\n '}function v(C,B){return'\n <h4>Parameters</h4>\n <table class=\'fullwidth\'>\n <thead>\n <tr>\n <th style="width: 100px; max-width: 100px">Parameter</th>\n <th style="width: 310px; max-width: 310px">Value</th>\n <th style="width: 200px; max-width: 200px">Description</th>\n <th style="width: 100px; max-width: 100px">Parameter Type</th>\n <th style="width: 220px; max-width: 230px">Data Type</th>\n </tr>\n </thead>\n <tbody class="operation-params">\n\n </tbody>\n </table>\n '}function l(C,B){return"\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n <th>Response Model</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n "}function h(C,B){return"\n "}function g(C,B){return"\n <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n "}t+="\n <ul class='operations' >\n <li class='";if(k=s.method){k=k.call(u,{hash:{},data:A})}else{k=u.method;k=typeof k===e?k.apply(u):k}t+=d(k)+" operation' id='";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"_";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+'\' class="toggleOperation">';if(k=s.method){k=k.call(u,{hash:{},data:A})}else{k=u.method;k=typeof k===e?k.apply(u):k}t+=d(k)+"</a>\n </span>\n <span class='path'>\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"' class=\"toggleOperation ";k=s["if"].call(u,u.deprecated,{hash:{},inverse:r.noop,fn:r.program(1,q,A),data:A});if(k||k===0){t+=k}t+='">';if(k=s.path){k=k.call(u,{hash:{},data:A})}else{k=u.path;k=typeof k===e?k.apply(u):k}t+=d(k)+"</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+'\' class="toggleOperation">';if(k=s.summary){k=k.call(u,{hash:{},data:A})}else{k=u.summary;k=typeof k===e?k.apply(u):k}if(k||k===0){t+=k}t+="</a>\n </li>\n </ul>\n </div>\n <div class='content' id='";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"_";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"_content' style='display:none'>\n ";k=s["if"].call(u,u.deprecated,{hash:{},inverse:r.noop,fn:r.program(3,p,A),data:A});if(k||k===0){t+=k}t+="\n ";k=s["if"].call(u,u.description,{hash:{},inverse:r.noop,fn:r.program(5,n,A),data:A});if(k||k===0){t+=k}t+="\n ";f={hash:{},inverse:r.noop,fn:r.program(7,m,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\n ";k=s.each.call(u,u.oauth,{hash:{},inverse:r.noop,fn:r.program(9,i,A),data:A});if(k||k===0){t+=k}t+="\n ";f={hash:{},inverse:r.noop,fn:r.program(12,y,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\n ";f={hash:{},inverse:r.noop,fn:r.program(14,x,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\n ";k=s["if"].call(u,u.type,{hash:{},inverse:r.noop,fn:r.program(16,w,A),data:A});if(k||k===0){t+=k}t+="\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n ";k=s["if"].call(u,u.parameters,{hash:{},inverse:r.noop,fn:r.program(18,v,A),data:A});if(k||k===0){t+=k}t+="\n ";k=s["if"].call(u,u.responseMessages,{hash:{},inverse:r.noop,fn:r.program(20,l,A),data:A});if(k||k===0){t+=k}t+="\n ";k=s["if"].call(u,u.isReadOnly,{hash:{},inverse:r.program(24,g,A),fn:r.program(22,h,A),data:A});if(k||k===0){t+=k}t+="\n </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";return t})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param=b(function(f,q,o,j,t){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);t=t||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(y,x){var v="",w;v+="\n ";w=o["if"].call(y,y.isFile,{hash:{},inverse:n.program(4,k,x),fn:n.program(2,l,x),data:x});if(w||w===0){v+=w}v+="\n ";return v}function l(y,x){var v="",w;v+='\n <input type="file" name=\'';if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+'\'/>\n <div class="parameter-content-type" />\n ';return v}function k(y,x){var v="",w;v+="\n ";w=o["if"].call(y,y["default"],{hash:{},inverse:n.program(7,h,x),fn:n.program(5,i,x),data:x});if(w||w===0){v+=w}v+="\n ";return v}function i(y,x){var v="",w;v+="\n <textarea class='body-textarea' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"'>";if(w=o["default"]){w=w.call(y,{hash:{},data:x})}else{w=y["default"];w=typeof w===d?w.apply(y):w}v+=c(w)+"</textarea>\n ";return v}function h(y,x){var v="",w;v+="\n <textarea class='body-textarea' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n ';return v}function e(y,x){var v="",w;v+="\n ";w=o["if"].call(y,y.isFile,{hash:{},inverse:n.program(10,u,x),fn:n.program(2,l,x),data:x});if(w||w===0){v+=w}v+="\n ";return v}function u(y,x){var v="",w;v+="\n ";w=o["if"].call(y,y["default"],{hash:{},inverse:n.program(13,r,x),fn:n.program(11,s,x),data:x});if(w||w===0){v+=w}v+="\n ";return v}function s(y,x){var v="",w;v+="\n <input class='parameter' minlength='0' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"' placeholder='' type='text' value='";if(w=o["default"]){w=w.call(y,{hash:{},data:x})}else{w=y["default"];w=typeof w===d?w.apply(y):w}v+=c(w)+"'/>\n ";return v}function r(y,x){var v="",w;v+="\n <input class='parameter' minlength='0' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"' placeholder='' type='text' value=''/>\n ";return v}p+="<td class='code'>";if(g=o.name){g=g.call(q,{hash:{},data:t})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\n<td>\n\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,t),fn:n.program(1,m,t),data:t});if(g||g===0){p+=g}p+="\n\n</td>\n<td>";if(g=o.description){g=g.call(q,{hash:{},data:t})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</td>\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:t})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\n<td>\n <span class="model-signature"></span>\n</td>\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_list=b(function(h,t,r,m,y){this.compilerInfo=[4,">= 1.0.0"];r=this.merge(r,h.helpers);y=y||{};var s="",j,g,e,p=this,q=r.helperMissing,d="function",c=this.escapeExpression;function o(A,z){return" multiple='multiple'"}function n(A,z){return"\n "}function l(C,B){var z="",A;z+="\n ";A=r["if"].call(C,C.defaultValue,{hash:{},inverse:p.program(8,i,B),fn:p.program(6,k,B),data:B});if(A||A===0){z+=A}z+="\n ";return z}function k(A,z){return"\n "}function i(E,D){var z="",C,B,A;z+="\n ";A={hash:{},inverse:p.program(11,x,D),fn:p.program(9,f,D),data:D};B=((C=r.isArray||E.isArray),C?C.call(E,E,A):q.call(E,"isArray",E,A));if(B||B===0){z+=B}z+="\n ";return z}function f(A,z){return"\n "}function x(A,z){return"\n <option selected=\"\" value=''></option>\n "}function w(C,B){var z="",A;z+="\n ";A=r["if"].call(C,C.isDefault,{hash:{},inverse:p.program(16,u,B),fn:p.program(14,v,B),data:B});if(A||A===0){z+=A}z+="\n ";return z}function v(C,B){var z="",A;z+='\n <option selected="" value=\'';if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+" (default)</option>\n ";return z}function u(C,B){var z="",A;z+="\n <option value='";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"</option>\n ";return z}s+="<td class='code'>";if(j=r.name){j=j.call(t,{hash:{},data:y})}else{j=t.name;j=typeof j===d?j.apply(t):j}s+=c(j)+"</td>\n<td>\n <select ";e={hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y};g=((j=r.isArray||t.isArray),j?j.call(t,t,e):q.call(t,"isArray",t,e));if(g||g===0){s+=g}s+=" class='parameter' name='";if(g=r.name){g=g.call(t,{hash:{},data:y})}else{g=t.name;g=typeof g===d?g.apply(t):g}s+=c(g)+"'>\n ";g=r["if"].call(t,t.required,{hash:{},inverse:p.program(5,l,y),fn:p.program(3,n,y),data:y});if(g||g===0){s+=g}s+="\n ";g=r.each.call(t,((j=t.allowableValues),j==null||j===false?j:j.descriptiveValues),{hash:{},inverse:p.noop,fn:p.program(13,w,y),data:y});if(g||g===0){s+=g}s+="\n </select>\n</td>\n<td>";if(g=r.description){g=g.call(t,{hash:{},data:y})}else{g=t.description;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+="</td>\n<td>";if(g=r.paramType){g=g.call(t,{hash:{},data:y})}else{g=t.paramType;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+='</td>\n<td><span class="model-signature"></span></td>';return s})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\n <textarea class='body-textarea' readonly='readonly' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\n ";return q}function c(t,s){var q="",r;q+="\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\n ";return q}function p(t,s){var q="",r;q+="\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\n ";return q}function n(r,q){return"\n (empty)\n "}i+="<td class='code'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\n<td>\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n</td>\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\n<td><span class="model-signature"></span></td>\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly_required=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\n <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\n ";return q}function c(t,s){var q="",r;q+="\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\n ";return q}function p(t,s){var q="",r;q+="\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\n ";return q}function n(r,q){return"\n (empty)\n "}i+="<td class='code required'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\n<td>\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n</td>\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\n<td><span class="model-signature"></span></td>\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_required=b(function(f,q,o,j,u){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);u=u||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(4,k,y),fn:n.program(2,l,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function l(z,y){var w="",x;w+='\n <input type="file" name=\'';if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function k(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(7,h,y),fn:n.program(5,i,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function i(z,y){var w="",x;w+="\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'>";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"</textarea>\n ";return w}function h(z,y){var w="",x;w+="\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n ';return w}function e(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(12,t,y),fn:n.program(10,v,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function v(z,y){var w="",x;w+="\n <input class='parameter' class='required' type='file' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function t(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(15,r,y),fn:n.program(13,s,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function s(z,y){var w="",x;w+="\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value='";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function r(z,y){var w="",x;w+="\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value=''/>\n ";return w}p+="<td class='code required'>";if(g=o.name){g=g.call(q,{hash:{},data:u})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\n<td>\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,u),fn:n.program(1,m,u),data:u});if(g||g===0){p+=g}p+="\n</td>\n<td>\n <strong>";if(g=o.description){g=g.call(q,{hash:{},data:u})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</strong>\n</td>\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:u})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\n<td><span class="model-signature"></span></td>\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.parameter_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.consumes,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="parameterContentType"></label>\n<select name="parameterContentType">\n';c=f["if"].call(l,l.consumes,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.resource=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,p,h="function",j=this.escapeExpression,o=this,n=f.blockHelperMissing;function e(r,q){return" : "}function c(t,s){var q="",r;q+="<li>\n <a href='";if(r=f.url){r=r.call(t,{hash:{},data:s})}else{r=t.url;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>Raw</a>\n </li>";return q}i+="<div class='heading'>\n <h2>\n <a href='#!/";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'\' class="toggleEndpointList" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">';if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</a> ";p={hash:{},inverse:o.noop,fn:o.program(1,e,k),data:k};if(d=f.summary){d=d.call(m,p)}else{d=m.summary;d=typeof d===h?d.apply(m):d}if(!f.summary){d=n.call(m,d,p)}if(d||d===0){i+=d}if(d=f.summary){d=d.call(m,{hash:{},data:k})}else{d=m.summary;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+"' id='endpointListTogger_";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'\' class="toggleEndpointList" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">Show/Hide</a>\n </li>\n <li>\n <a href=\'#\' class="collapseResource" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">\n List Operations\n </a>\n </li>\n <li>\n <a href=\'#\' class="expandResource" data-id=';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+">\n Expand Operations\n </a>\n </li>\n ";p={hash:{},inverse:o.noop,fn:o.program(3,c,k),data:k};if(d=f.url){d=d.call(m,p)}else{d=m.url;d=typeof d===h?d.apply(m):d}if(!f.url){d=n.call(m,d,p)}if(d||d===0){i+=d}i+="\n </ul>\n</div>\n<ul class='endpoints' id='";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+"_endpoint_list' style='display:none'>\n\n</ul>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.response_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="responseContentType"></label>\n<select name="responseContentType">\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.signature=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+='<div>\n<ul class="signature-nav">\n <li><a class="description-link" href="#">Model</a></li>\n <li><a class="snippet-link" href="#">Model Schema</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n <div class="description">\n ';if(c=d.signature){c=c.call(k,{hash:{},data:i})}else{c=k.signature;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+='\n </div>\n\n <div class="snippet">\n <pre><code>';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'</code></pre>\n <small class="notice"></small>\n </div>\n</div>\n\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.status_code=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="<td width='15%' class='code'>";if(c=d.code){c=c.call(k,{hash:{},data:i})}else{c=k.code;c=typeof c===f?c.apply(k):c}g+=h(c)+"</td>\n<td>";if(c=d.message){c=c.call(k,{hash:{},data:i})}else{c=k.message;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+="</td>\n<td width='50%'><span class=\"model-signature\" /></td>";return g})})();(function(){var j,r,u,o,l,k,n,m,i,p,s,q,h,c,g,f,e,d,b,a,x,w,t={}.hasOwnProperty,v=function(B,z){for(var y in z){if(t.call(z,y)){B[y]=z[y]}}function A(){this.constructor=B}A.prototype=z.prototype;B.prototype=new A();B.__super__=z.prototype;return B};s=(function(z){v(y,z);function y(){q=y.__super__.constructor.apply(this,arguments);return q}y.prototype.dom_id="swagger_ui";y.prototype.options=null;y.prototype.api=null;y.prototype.headerView=null;y.prototype.mainView=null;y.prototype.initialize=function(A){var B=this;if(A==null){A={}}if(A.dom_id!=null){this.dom_id=A.dom_id;delete A.dom_id}if($("#"+this.dom_id)==null){$("body").append('<div id="'+this.dom_id+'"></div>')}this.options=A;this.options.success=function(){return B.render()};this.options.progress=function(C){return B.showMessage(C)};this.options.failure=function(C){if(B.api&&B.api.isValid===false){log("not a valid 2.0 spec, loading legacy client");B.api=new SwaggerApi(B.options);return B.api.build()}else{return B.onLoadFailure(C)}};this.headerView=new r({el:$("#header")});return this.headerView.on("update-swagger-ui",function(C){return B.updateSwaggerUi(C)})};y.prototype.setOption=function(A,B){return this.options[A]=B};y.prototype.getOption=function(A){return this.options[A]};y.prototype.updateSwaggerUi=function(A){this.options.url=A.url;return this.load()};y.prototype.load=function(){var B,A;if((A=this.mainView)!=null){A.clear()}B=this.options.url;if(B.indexOf("http")!==0){B=this.buildUrl(window.location.href.toString(),B)}this.options.url=B;this.headerView.update(B);this.api=new SwaggerClient(this.options);return this.api.build()};y.prototype.render=function(){var A=this;this.showMessage("Finished Loading Resource Information. Rendering Swagger UI...");this.mainView=new u({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options}).render();this.showMessage();switch(this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}if(this.options.onComplete){this.options.onComplete(this.api,this)}return setTimeout(function(){return Docs.shebang()},400)};y.prototype.buildUrl=function(C,A){var B,D;log("base is "+C);if(A.indexOf("/")===0){D=C.split("/");C=D[0]+"//"+D[2];return C+A}else{B=C.length;if(C.indexOf("?")>-1){B=Math.min(B,C.indexOf("?"))}if(C.indexOf("#")>-1){B=Math.min(B,C.indexOf("#"))}C=C.substring(0,B);if(C.indexOf("/",C.length-1)!==-1){return C+A}return C+"/"+A}};y.prototype.showMessage=function(A){if(A==null){A=""}$("#message-bar").removeClass("message-fail");$("#message-bar").addClass("message-success");return $("#message-bar").html(A)};y.prototype.onLoadFailure=function(A){var B;if(A==null){A=""}$("#message-bar").removeClass("message-success");$("#message-bar").addClass("message-fail");B=$("#message-bar").html(A);if(this.options.onFailure!=null){this.options.onFailure(A)}return B};return y})(Backbone.Router);window.SwaggerUi=s;r=(function(z){v(y,z);function y(){h=y.__super__.constructor.apply(this,arguments);return h}y.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"};y.prototype.initialize=function(){};y.prototype.showPetStore=function(A){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})};y.prototype.showWordnikDev=function(A){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})};y.prototype.showCustomOnKeyup=function(A){if(A.keyCode===13){return this.showCustom()}};y.prototype.showCustom=function(A){if(A!=null){A.preventDefault()}return this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})};y.prototype.update=function(B,C,A){if(A==null){A=false}$("#input_baseUrl").val(B);if(A){return this.trigger("update-swagger-ui",{url:B})}};return y})(Backbone.View);u=(function(y){var z;v(A,y);function A(){g=A.__super__.constructor.apply(this,arguments);return g}z={alpha:function(C,B){return C.path.localeCompare(B.path)},method:function(C,B){return C.method.localeCompare(B.method)}};A.prototype.initialize=function(B){var C,I,J,E,D,G,H,F;if(B==null){B={}}if(B.swaggerOptions.sorter){E=B.swaggerOptions.sorter;J=z[E];if(this.model.apisArray){F=this.model.apisArray;for(G=0,H=F.length;G<H;G++){I=F[G];I.operationsArray.sort(J)}if(E==="alpha"){this.model.apisArray.sort(J)}}}if(this.model.info&&this.model.info.license&&typeof this.model.info.license==="string"){C=this.model.info.license;D=this.model.info.licenseUrl;this.model.info.license={};this.model.info.license.name=C;this.model.info.license.url=D}if(!this.model.info){this.model.info={}}if(!this.model.info.version){this.model.info.version=this.model.apiVersion}if("validatorUrl" in B.swaggerOptions){return this.model.validatorUrl=B.swaggerOptions.validatorUrl}else{if(this.model.url.match(/https?:\/\/localhost/)&&this.model.swaggerVersion===2){return this.model.validatorUrl=this.model.url}else{return this.model.validatorUrl="http://online.swagger.io/validator"}}};A.prototype.render=function(){var C,H,E,F,D,B,G;$(this.el).html(Handlebars.templates.main(this.model));F={};C=0;G=this.model.apisArray;for(D=0,B=G.length;D<B;D++){E=G[D];H=E.name;while(typeof F[H]!=="undefined"){H=H+"_"+C;C+=1}E.id=H;F[H]=E;this.addResource(E)}return this};A.prototype.addResource=function(C){var B;C.id=C.id.replace(/\s/g,"_");B=new n({model:C,tagName:"li",id:"resource_"+C.id,className:"resource",swaggerOptions:this.options.swaggerOptions});return $("#resources").append(B.render().el)};A.prototype.clear=function(){return $(this.el).html("")};return A})(Backbone.View);n=(function(z){v(y,z);function y(){f=y.__super__.constructor.apply(this,arguments);return f}y.prototype.initialize=function(){if(""===this.model.description){return this.model.description=null}};y.prototype.render=function(){var B,G,D,C,E,A,F;$(this.el).html(Handlebars.templates.resource(this.model));D={};if(this.model.description){this.model.summary=this.model.description}F=this.model.operationsArray;for(E=0,A=F.length;E<A;E++){C=F[E];B=0;G=C.nickname;while(typeof D[G]!=="undefined"){G=G+"_"+B;B+=1}D[G]=C;C.nickname=G;C.parentId=this.model.id;this.addOperation(C)}$(".toggleEndpointList",this.el).click(this.callDocs.bind(this,"toggleEndpointListForResource"));$(".collapseResource",this.el).click(this.callDocs.bind(this,"collapseOperationsForResource"));$(".expandResource",this.el).click(this.callDocs.bind(this,"expandOperationsForResource"));return this};y.prototype.addOperation=function(A){var B;A.number=this.number;B=new o({model:A,tagName:"li",className:"endpoint",swaggerOptions:this.options.swaggerOptions});$(".endpoints",$(this.el)).append(B.render().el);return this.number++};y.prototype.callDocs=function(B,A){A.preventDefault();return Docs[B](A.currentTarget.getAttribute("data-id"))};return y})(Backbone.View);o=(function(z){v(y,z);function y(){e=y.__super__.constructor.apply(this,arguments);return e}y.prototype.invocationUrl=null;y.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","mouseout .api-ic":"mouseExit"};y.prototype.initialize=function(){};y.prototype.mouseEnter=function(F){var D,E,I,B,A,J,G,C,K,H;D=$(F.currentTarget.parentNode).find("#api_information_panel");K=F.pageX;H=F.pageY;J=$(window).scrollLeft();G=$(window).scrollTop();B=J+$(window).width();A=G+$(window).height();C=D.width();E=D.height();if(K+C>B){K=B-C}if(K<J){K=J}if(H+E>A){H=A-E}if(H<G){H=G}I={};I.top=H;I.left=K;D.css(I);return $(F.currentTarget.parentNode).find("#api_information_panel").show()};y.prototype.mouseExit=function(A){return $(A.currentTarget.parentNode).find("#api_information_panel").hide()};y.prototype.render=function(){var D,U,V,T,R,K,J,Q,L,P,W,O,M,I,N,S,H,G,F,C,Y,ab,Z,X,E,B,A,ac,aa;V=true;if(!V){this.model.isReadOnly=true}this.model.description=this.model.description||this.model.notes;if(this.model.description){this.model.description=this.model.description.replace(/(?:\r\n|\r|\n)/g,"<br />")}this.model.oauth=null;if(this.model.authorizations){E=this.model.authorizations;for(T in E){N=E[T];if(T==="oauth2"){if(this.model.oauth===null){this.model.oauth={}}if(this.model.oauth.scopes===void 0){this.model.oauth.scopes=[]}for(H=0,Y=N.length;H<Y;H++){R=N[H];this.model.oauth.scopes.push(R)}}}}if(typeof this.model.responses!=="undefined"){this.model.responseMessages=[];B=this.model.responses;for(D in B){S=B[D];P=null;W=this.model.responses[D].schema;if(W&&W["$ref"]){P=W["$ref"];if(P.indexOf("#/definitions/")===0){P=P.substring("#/definitions/".length)}}this.model.responseMessages.push({code:D,message:S.description,responseModel:P})}}if(typeof this.model.responseMessages==="undefined"){this.model.responseMessages=[]}$(this.el).html(Handlebars.templates.operation(this.model));if(this.model.responseClassSignature&&this.model.responseClassSignature!=="string"){O={sampleJSON:this.model.responseSampleJSON,isParam:false,signature:this.model.responseClassSignature};L=new i({model:O,tagName:"div"});$(".model-signature",$(this.el)).append(L.render().el)}else{this.model.responseClassSignature="string";$(".model-signature",$(this.el)).html(this.model.type)}U={isParam:false};U.consumes=this.model.consumes;U.produces=this.model.produces;A=this.model.parameters;for(G=0,ab=A.length;G<ab;G++){K=A[G];I=K.type||K.dataType;if(typeof I==="undefined"){P=K.schema;if(P&&P["$ref"]){J=P["$ref"];if(J.indexOf("#/definitions/")===0){I=J.substring("#/definitions/".length)}else{I=J}}}if(I&&I.toLowerCase()==="file"){if(!U.consumes){U.consumes="multipart/form-data"}}K.type=I}Q=new m({model:U});$(".response-content-type",$(this.el)).append(Q.render().el);ac=this.model.parameters;for(F=0,Z=ac.length;F<Z;F++){K=ac[F];this.addParameter(K,U.consumes)}aa=this.model.responseMessages;for(C=0,X=aa.length;C<X;C++){M=aa[C];this.addStatusCode(M)}return this};y.prototype.addParameter=function(C,A){var B;C.consumes=A;B=new k({model:C,tagName:"tr",readOnly:this.model.isReadOnly});return $(".operation-params",$(this.el)).append(B.render().el)};y.prototype.addStatusCode=function(B){var A;A=new p({model:B,tagName:"tr"});return $(".operation-status",$(this.el)).append(A.render().el)};y.prototype.submitOperation=function(O){var Q,G,N,D,I,A,J,M,L,K,P,F,C,H,E,B;if(O!=null){O.preventDefault()}G=$(".sandbox",$(this.el));Q=true;G.find("input.required").each(function(){var R=this;$(this).removeClass("error");if(jQuery.trim($(this).val())===""){$(this).addClass("error");$(this).wiggle({callback:function(){return $(R).focus()}});return Q=false}});if(Q){D={};A={parent:this};N=false;H=G.find("input");for(M=0,P=H.length;M<P;M++){I=H[M];if((I.value!=null)&&jQuery.trim(I.value).length>0){D[I.name]=I.value}if(I.type==="file"){N=true}}E=G.find("textarea");for(L=0,F=E.length;L<F;L++){I=E[L];if((I.value!=null)&&jQuery.trim(I.value).length>0){D[I.name]=I.value}}B=G.find("select");for(K=0,C=B.length;K<C;K++){I=B[K];J=this.getSelectedValue(I);if((J!=null)&&jQuery.trim(J).length>0){D[I.name]=J}}A.responseContentType=$("div select[name=responseContentType]",$(this.el)).val();A.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val();$(".response_throbber",$(this.el)).show();if(N){return this.handleFileUpload(D,G)}else{return this.model["do"](D,A,this.showCompleteStatus,this.showErrorStatus,this)}}};y.prototype.success=function(A,B){return B.showCompleteStatus(A)};y.prototype.handleFileUpload=function(R,I){var M,H,C,N,L,K,P,J,G,F,D,Q,U,T,S,E,B,A,V,O=this;E=I.serializeArray();for(J=0,Q=E.length;J<Q;J++){N=E[J];if((N.value!=null)&&jQuery.trim(N.value).length>0){R[N.name]=N.value}}M=new FormData();P=0;B=this.model.parameters;for(G=0,U=B.length;G<U;G++){K=B[G];if(K.paramType==="form"){if(K.type.toLowerCase()!=="file"&&R[K.name]!==void 0){M.append(K.name,R[K.name])}}}C={};A=this.model.parameters;for(F=0,T=A.length;F<T;F++){K=A[F];if(K.paramType==="header"){C[K.name]=R[K.name]}}V=I.find('input[type~="file"]');for(D=0,S=V.length;D<S;D++){H=V[D];if(typeof H.files[0]!=="undefined"){M.append($(H).attr("name"),H.files[0]);P+=1}}this.invocationUrl=this.model.supportHeaderParams()?(C=this.model.getHeaderParams(R),this.model.urlify(R,false)):this.model.urlify(R,true);$(".request_url",$(this.el)).html("<pre></pre>");$(".request_url pre",$(this.el)).text(this.invocationUrl);L={type:this.model.method,url:this.invocationUrl,headers:C,data:M,dataType:"json",contentType:false,processData:false,error:function(X,Y,W){return O.showErrorStatus(O.wrap(X),O)},success:function(W){return O.showResponse(W,O)},complete:function(W){return O.showCompleteStatus(O.wrap(W),O)}};if(window.authorizations){window.authorizations.apply(L)}if(P===0){L.data.append("fake","true")}jQuery.ajax(L);return false};y.prototype.wrap=function(E){var C,F,H,B,G,D,A;H={};F=E.getAllResponseHeaders().split("\r");for(D=0,A=F.length;D<A;D++){B=F[D];C=B.split(":");if(C[0]!==void 0&&C[1]!==void 0){H[C[0].trim()]=C[1].trim()}}G={};G.content={};G.content.data=E.responseText;G.headers=H;G.request={};G.request.url=this.invocationUrl;G.status=E.status;return G};y.prototype.getSelectedValue=function(A){var D,C,F,B,E;if(!A.multiple){return A.value}else{C=[];E=A.options;for(F=0,B=E.length;F<B;F++){D=E[F];if(D.selected){C.push(D.value)}}if(C.length>0){return C}else{return null}}};y.prototype.hideResponse=function(A){if(A!=null){A.preventDefault()}$(".response",$(this.el)).slideUp();return $(".response_hider",$(this.el)).fadeOut()};y.prototype.showResponse=function(A){var B;B=JSON.stringify(A,null,"\t").replace(/\n/g,"<br>");return $(".response_body",$(this.el)).html(escape(B))};y.prototype.showErrorStatus=function(B,A){return A.showStatus(B)};y.prototype.showCompleteStatus=function(B,A){return A.showStatus(B)};y.prototype.formatXml=function(H){var D,G,B,I,N,J,C,A,L,M,F,E,K;A=/(>)(<)(\/*)/g;M=/[ ]*(.*)[ ]+\n/g;D=/(<.+>)(.+\n)/g;H=H.replace(A,"$1\n$2$3").replace(M,"$1\n").replace(D,"$1\n$2");C=0;G="";N=H.split("\n");B=0;I="other";L={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0};F=function(T){var P,O,R,V,S,Q,U;Q={single:Boolean(T.match(/<.+\/>/)),closing:Boolean(T.match(/<\/.+>/)),opening:Boolean(T.match(/<[^!?].*>/))};S=((function(){var W;W=[];for(R in Q){U=Q[R];if(U){W.push(R)}}return W})())[0];S=S===void 0?"other":S;P=I+"->"+S;I=S;V="";B+=L[P];V=((function(){var X,Y,W;W=[];for(O=X=0,Y=B;0<=Y?X<Y:X>Y;O=0<=Y?++X:--X){W.push(" ")}return W})()).join("");if(P==="opening->closing"){return G=G.substr(0,G.length-1)+T+"\n"}else{return G+=V+T+"\n"}};for(E=0,K=N.length;E<K;E++){J=N[E];F(J)}return G};y.prototype.showStatus=function(F){var C,J,L,I,D,M,A,E,H,G,B;if(F.content===void 0){J=F.data;B=F.url}else{J=F.content.data;B=F.request.url}D=F.headers;L=D&&D["Content-Type"]?D["Content-Type"].split(";")[0].trim():null;if(!J){C=$("<code />").text("no content");E=$('<pre class="json" />').append(C)}else{if(L==="application/json"||/\+json$/.test(L)){M=null;try{M=JSON.stringify(JSON.parse(J),null," ")}catch(K){I=K;M="can't parse JSON. Raw result:\n\n"+J}C=$("<code />").text(M);E=$('<pre class="json" />').append(C)}else{if(L==="application/xml"||/\+xml$/.test(L)){C=$("<code />").text(this.formatXml(J));E=$('<pre class="xml" />').append(C)}else{if(L==="text/html"){C=$("<code />").html(_.escape(J));E=$('<pre class="xml" />').append(C)}else{if(/^image\//.test(L)){E=$("<img>").attr("src",B)}else{C=$("<code />").text(J);E=$('<pre class="json" />').append(C)}}}}}H=E;$(".request_url",$(this.el)).html("<pre></pre>");$(".request_url pre",$(this.el)).text(B);$(".response_code",$(this.el)).html("<pre>"+F.status+"</pre>");$(".response_body",$(this.el)).html(H);$(".response_headers",$(this.el)).html("<pre>"+_.escape(JSON.stringify(F.headers,null," ")).replace(/\n/g,"<br>")+"</pre>");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();G=$(".response_body",$(this.el))[0];A=this.options.swaggerOptions;if(A.highlightSizeThreshold&&F.data.length>A.highlightSizeThreshold){return G}else{return hljs.highlightBlock(G)}};y.prototype.toggleOperationContent=function(){var A;A=$("#"+Docs.escapeResourceName(this.model.parentId)+"_"+this.model.nickname+"_content");if(A.is(":visible")){return Docs.collapseOperation(A)}else{return Docs.expandOperation(A)}};return y})(Backbone.View);p=(function(z){v(y,z);function y(){d=y.__super__.constructor.apply(this,arguments);return d}y.prototype.initialize=function(){};y.prototype.render=function(){var B,A,C;C=this.template();$(this.el).html(C(this.model));if(swaggerUi.api.models.hasOwnProperty(this.model.responseModel)){B={sampleJSON:JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(),null,2),isParam:false,signature:swaggerUi.api.models[this.model.responseModel].getMockSignature()};A=new i({model:B,tagName:"div"});$(".model-signature",this.$el).append(A.render().el)}else{$(".model-signature",this.$el).html("")}return this};y.prototype.template=function(){return Handlebars.templates.status_code};return y})(Backbone.View);k=(function(z){v(y,z);function y(){b=y.__super__.constructor.apply(this,arguments);return b}y.prototype.initialize=function(){return Handlebars.registerHelper("isArray",function(B,A){if(B.type.toLowerCase()==="array"||B.allowMultiple){return A.fn(this)}else{return A.inverse(this)}})};y.prototype.render=function(){var A,B,E,C,F,D,I,J,H,G;G=this.model.type||this.model.dataType;if(typeof G==="undefined"){D=this.model.schema;if(D&&D["$ref"]){C=D["$ref"];if(C.indexOf("#/definitions/")===0){G=C.substring("#/definitions/".length)}else{G=C}}}this.model.type=G;this.model.paramType=this.model["in"]||this.model.paramType;if(this.model.paramType==="body"){this.model.isBody=true}if(G&&G.toLowerCase()==="file"){this.model.isFile=true}this.model["default"]=this.model["default"]||this.model.defaultValue;H=this.template();$(this.el).html(H(this.model));I={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){J=new i({model:I,tagName:"div"});$(".model-signature",$(this.el)).append(J.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}B=false;if(this.model.isBody){B=true}A={isParam:B};A.consumes=this.model.consumes;if(B){E=new l({model:A});$(".parameter-content-type",$(this.el)).append(E.render().el)}else{F=new m({model:A});$(".response-content-type",$(this.el)).append(F.render().el)}return this};y.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return y})(Backbone.View);i=(function(z){v(y,z);function y(){a=y.__super__.constructor.apply(this,arguments);return a}y.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));this.switchToSnippet();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};y.prototype.template=function(){return Handlebars.templates.signature};y.prototype.switchToDescription=function(A){if(A!=null){A.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};y.prototype.switchToSnippet=function(A){if(A!=null){A.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};y.prototype.snippetToTextArea=function(A){var B;if(this.isParam){if(A!=null){A.preventDefault()}B=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(B.val())===""){return B.val(this.model.sampleJSON)}}};return y})(Backbone.View);j=(function(y){v(z,y);function z(){x=z.__super__.constructor.apply(this,arguments);return x}z.prototype.initialize=function(){};z.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=contentType]",$(this.el)).text("Response Content Type");return this};z.prototype.template=function(){return Handlebars.templates.content_type};return z})(Backbone.View);m=(function(y){v(z,y);function z(){w=z.__super__.constructor.apply(this,arguments);return w}z.prototype.initialize=function(){};z.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=responseContentType]",$(this.el)).text("Response Content Type");return this};z.prototype.template=function(){return Handlebars.templates.response_content_type};return z})(Backbone.View);l=(function(z){v(y,z);function y(){c=y.__super__.constructor.apply(this,arguments);return c}y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:");return this};y.prototype.template=function(){return Handlebars.templates.parameter_content_type};return y})(Backbone.View)}).call(this);
$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments)[0])}};if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.apikey_button_view=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="<div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div>\n<div class='auth_container' id='apikey_container'>\n <div class='key_input_container'>\n <div class='auth_label'>";if(c=d.keyName){c=c.call(k,{hash:{},data:i})}else{c=k.keyName;c=typeof c===f?c.apply(k):c}g+=h(c)+'</div>\n <input placeholder="api_key" class="auth_input" id="input_apiKey_entry" name="apiKey" type="text"/>\n <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_api_key" href="#">apply</a></div>\n </div>\n</div>\n\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.basic_auth_button_view=b(function(f,g,d,c,e){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,f.helpers);e=e||{};return'<div class=\'auth_button\' id=\'basic_auth_button\'><img class=\'auth_icon\' src=\'images/password.jpeg\'></div>\n<div class=\'auth_container\' id=\'basic_auth_container\'>\n <div class=\'key_input_container\'>\n <div class="auth_label">Username</div>\n <input placeholder="username" class="auth_input" id="input_username" name="username" type="text"/>\n <div class="auth_label">Password</div>\n <input placeholder="password" class="auth_input" id="input_password" name="password" type="password"/>\n <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_basic_auth" href="#">apply</a></div>\n </div>\n</div>\n\n'})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="contentType"></label>\n<select name="contentType">\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(h,n,g,m,l){this.compilerInfo=[4,">= 1.0.0"];g=this.merge(g,h.helpers);l=l||{};var j="",c,s,i="function",k=this.escapeExpression,q=this;function f(x,w){var t="",v,u;t+='\n <div class="info_title">'+k(((v=((v=x.info),v==null||v===false?v:v.title)),typeof v===i?v.apply(x):v))+'</div>\n <div class="info_description">';u=((v=((v=x.info),v==null||v===false?v:v.description)),typeof v===i?v.apply(x):v);if(u||u===0){t+=u}t+="</div>\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.termsOfServiceUrl),{hash:{},inverse:q.noop,fn:q.program(2,d,w),data:w});if(u||u===0){t+=u}t+="\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.contact),{hash:{},inverse:q.noop,fn:q.program(4,r,w),data:w});if(u||u===0){t+=u}t+="\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.license),{hash:{},inverse:q.noop,fn:q.program(6,p,w),data:w});if(u||u===0){t+=u}t+="\n ";return t}function d(w,v){var t="",u;t+='<div class="info_tos"><a href="'+k(((u=((u=w.info),u==null||u===false?u:u.termsOfServiceUrl)),typeof u===i?u.apply(w):u))+'">Terms of service</a></div>';return t}function r(w,v){var t="",u;t+="<div class='info_contact'><a href=\"mailto:"+k(((u=((u=((u=w.info),u==null||u===false?u:u.contact)),u==null||u===false?u:u.name)),typeof u===i?u.apply(w):u))+'">Contact the developer</a></div>';return t}function p(w,v){var t="",u;t+="<div class='info_license'><a href='"+k(((u=((u=((u=w.info),u==null||u===false?u:u.license)),u==null||u===false?u:u.url)),typeof u===i?u.apply(w):u))+"'>"+k(((u=((u=((u=w.info),u==null||u===false?u:u.license)),u==null||u===false?u:u.name)),typeof u===i?u.apply(w):u))+"</a></div>";return t}function o(w,v){var t="",u;t+='\n , <span style="font-variant: small-caps">api version</span>: '+k(((u=((u=w.info),u==null||u===false?u:u.version)),typeof u===i?u.apply(w):u))+"\n ";return t}function e(w,v){var t="",u;t+='\n <span style="float:right"><a href="';if(u=g.validatorUrl){u=u.call(w,{hash:{},data:v})}else{u=w.validatorUrl;u=typeof u===i?u.apply(w):u}t+=k(u)+"/debug?url=";if(u=g.url){u=u.call(w,{hash:{},data:v})}else{u=w.url;u=typeof u===i?u.apply(w):u}t+=k(u)+'"><img id="validator" src="';if(u=g.validatorUrl){u=u.call(w,{hash:{},data:v})}else{u=w.validatorUrl;u=typeof u===i?u.apply(w):u}t+=k(u)+"?url=";if(u=g.url){u=u.call(w,{hash:{},data:v})}else{u=w.url;u=typeof u===i?u.apply(w):u}t+=k(u)+'"></a>\n </span>\n ';return t}j+="<div class='info' id='api_info'>\n ";c=g["if"].call(n,n.info,{hash:{},inverse:q.noop,fn:q.program(1,f,l),data:l});if(c||c===0){j+=c}j+="\n</div>\n<div class='container' id='resources_container'>\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ";if(c=g.basePath){c=c.call(n,{hash:{},data:l})}else{c=n.basePath;c=typeof c===i?c.apply(n):c}j+=k(c)+"\n ";s=g["if"].call(n,((c=n.info),c==null||c===false?c:c.version),{hash:{},inverse:q.noop,fn:q.program(8,o,l),data:l});if(s||s===0){j+=s}j+="]\n ";s=g["if"].call(n,n.validatorUrl,{hash:{},inverse:q.noop,fn:q.program(10,e,l),data:l});if(s||s===0){j+=s}j+="\n </h4>\n </div>\n</div>\n";return j})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.operation=b(function(j,u,s,o,A){this.compilerInfo=[4,">= 1.0.0"];s=this.merge(s,j.helpers);A=A||{};var t="",k,f,e="function",d=this.escapeExpression,r=this,c=s.blockHelperMissing;function q(C,B){return"deprecated"}function p(C,B){return"\n <h4>Warning: Deprecated</h4>\n "}function n(E,D){var B="",C;B+="\n <h4>Implementation Notes</h4>\n <p>";if(C=s.description){C=C.call(E,{hash:{},data:D})}else{C=E.description;C=typeof C===e?C.apply(E):C}if(C||C===0){B+=C}B+="</p>\n ";return B}function m(C,B){return'\n <div class="auth">\n <span class="api-ic ic-error"></span>'}function i(E,D){var B="",C;B+='\n <div id="api_information_panel" style="top: 526px; left: 776px; display: none;">\n ';C=s.each.call(E,E,{hash:{},inverse:r.noop,fn:r.program(10,z,D),data:D});if(C||C===0){B+=C}B+="\n </div>\n ";return B}function z(F,E){var B="",D,C;B+="\n <div title='";C=((D=F.description),typeof D===e?D.apply(F):D);if(C||C===0){B+=C}B+="'>"+d(((D=F.scope),typeof D===e?D.apply(F):D))+"</div>\n ";return B}function y(C,B){return"</div>"}function x(C,B){return'\n <div class=\'access\'>\n <span class="api-ic ic-off" title="click to authenticate"></span>\n </div>\n '}function w(C,B){return'\n <h4>Response Class</h4>\n <p><span class="model-signature" /></p>\n <br/>\n <div class="response-content-type" />\n '}function v(C,B){return'\n <h4>Parameters</h4>\n <table class=\'fullwidth\'>\n <thead>\n <tr>\n <th style="width: 100px; max-width: 100px">Parameter</th>\n <th style="width: 310px; max-width: 310px">Value</th>\n <th style="width: 200px; max-width: 200px">Description</th>\n <th style="width: 100px; max-width: 100px">Parameter Type</th>\n <th style="width: 220px; max-width: 230px">Data Type</th>\n </tr>\n </thead>\n <tbody class="operation-params">\n\n </tbody>\n </table>\n '}function l(C,B){return"\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n <th>Response Model</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n "}function h(C,B){return"\n "}function g(C,B){return"\n <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n "}t+="\n <ul class='operations' >\n <li class='";if(k=s.method){k=k.call(u,{hash:{},data:A})}else{k=u.method;k=typeof k===e?k.apply(u):k}t+=d(k)+" operation' id='";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"_";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+'\' class="toggleOperation">';if(k=s.method){k=k.call(u,{hash:{},data:A})}else{k=u.method;k=typeof k===e?k.apply(u):k}t+=d(k)+"</a>\n </span>\n <span class='path'>\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"' class=\"toggleOperation ";k=s["if"].call(u,u.deprecated,{hash:{},inverse:r.noop,fn:r.program(1,q,A),data:A});if(k||k===0){t+=k}t+='">';if(k=s.path){k=k.call(u,{hash:{},data:A})}else{k=u.path;k=typeof k===e?k.apply(u):k}t+=d(k)+"</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+'\' class="toggleOperation">';if(k=s.summary){k=k.call(u,{hash:{},data:A})}else{k=u.summary;k=typeof k===e?k.apply(u):k}if(k||k===0){t+=k}t+="</a>\n </li>\n </ul>\n </div>\n <div class='content' id='";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"_";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"_content' style='display:none'>\n ";k=s["if"].call(u,u.deprecated,{hash:{},inverse:r.noop,fn:r.program(3,p,A),data:A});if(k||k===0){t+=k}t+="\n ";k=s["if"].call(u,u.description,{hash:{},inverse:r.noop,fn:r.program(5,n,A),data:A});if(k||k===0){t+=k}t+="\n ";f={hash:{},inverse:r.noop,fn:r.program(7,m,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\n ";k=s.each.call(u,u.oauth,{hash:{},inverse:r.noop,fn:r.program(9,i,A),data:A});if(k||k===0){t+=k}t+="\n ";f={hash:{},inverse:r.noop,fn:r.program(12,y,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\n ";f={hash:{},inverse:r.noop,fn:r.program(14,x,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\n ";k=s["if"].call(u,u.type,{hash:{},inverse:r.noop,fn:r.program(16,w,A),data:A});if(k||k===0){t+=k}t+="\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n ";k=s["if"].call(u,u.parameters,{hash:{},inverse:r.noop,fn:r.program(18,v,A),data:A});if(k||k===0){t+=k}t+="\n ";k=s["if"].call(u,u.responseMessages,{hash:{},inverse:r.noop,fn:r.program(20,l,A),data:A});if(k||k===0){t+=k}t+="\n ";k=s["if"].call(u,u.isReadOnly,{hash:{},inverse:r.program(24,g,A),fn:r.program(22,h,A),data:A});if(k||k===0){t+=k}t+="\n </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";return t})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param=b(function(f,q,o,j,t){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);t=t||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(y,x){var v="",w;v+="\n ";w=o["if"].call(y,y.isFile,{hash:{},inverse:n.program(4,k,x),fn:n.program(2,l,x),data:x});if(w||w===0){v+=w}v+="\n ";return v}function l(y,x){var v="",w;v+='\n <input type="file" name=\'';if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+'\'/>\n <div class="parameter-content-type" />\n ';return v}function k(y,x){var v="",w;v+="\n ";w=o["if"].call(y,y["default"],{hash:{},inverse:n.program(7,h,x),fn:n.program(5,i,x),data:x});if(w||w===0){v+=w}v+="\n ";return v}function i(y,x){var v="",w;v+="\n <textarea class='body-textarea' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"'>";if(w=o["default"]){w=w.call(y,{hash:{},data:x})}else{w=y["default"];w=typeof w===d?w.apply(y):w}v+=c(w)+"</textarea>\n ";return v}function h(y,x){var v="",w;v+="\n <textarea class='body-textarea' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n ';return v}function e(y,x){var v="",w;v+="\n ";w=o["if"].call(y,y.isFile,{hash:{},inverse:n.program(10,u,x),fn:n.program(2,l,x),data:x});if(w||w===0){v+=w}v+="\n ";return v}function u(y,x){var v="",w;v+="\n ";w=o["if"].call(y,y["default"],{hash:{},inverse:n.program(13,r,x),fn:n.program(11,s,x),data:x});if(w||w===0){v+=w}v+="\n ";return v}function s(y,x){var v="",w;v+="\n <input class='parameter' minlength='0' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"' placeholder='' type='text' value='";if(w=o["default"]){w=w.call(y,{hash:{},data:x})}else{w=y["default"];w=typeof w===d?w.apply(y):w}v+=c(w)+"'/>\n ";return v}function r(y,x){var v="",w;v+="\n <input class='parameter' minlength='0' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"' placeholder='' type='text' value=''/>\n ";return v}p+="<td class='code'>";if(g=o.name){g=g.call(q,{hash:{},data:t})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\n<td>\n\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,t),fn:n.program(1,m,t),data:t});if(g||g===0){p+=g}p+="\n\n</td>\n<td>";if(g=o.description){g=g.call(q,{hash:{},data:t})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</td>\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:t})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\n<td>\n <span class="model-signature"></span>\n</td>\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_list=b(function(h,t,r,m,y){this.compilerInfo=[4,">= 1.0.0"];r=this.merge(r,h.helpers);y=y||{};var s="",j,g,e,p=this,q=r.helperMissing,d="function",c=this.escapeExpression;function o(A,z){return" multiple='multiple'"}function n(A,z){return"\n "}function l(C,B){var z="",A;z+="\n ";A=r["if"].call(C,C.defaultValue,{hash:{},inverse:p.program(8,i,B),fn:p.program(6,k,B),data:B});if(A||A===0){z+=A}z+="\n ";return z}function k(A,z){return"\n "}function i(E,D){var z="",C,B,A;z+="\n ";A={hash:{},inverse:p.program(11,x,D),fn:p.program(9,f,D),data:D};B=((C=r.isArray||E.isArray),C?C.call(E,E,A):q.call(E,"isArray",E,A));if(B||B===0){z+=B}z+="\n ";return z}function f(A,z){return"\n "}function x(A,z){return"\n <option selected=\"\" value=''></option>\n "}function w(C,B){var z="",A;z+="\n ";A=r["if"].call(C,C.isDefault,{hash:{},inverse:p.program(16,u,B),fn:p.program(14,v,B),data:B});if(A||A===0){z+=A}z+="\n ";return z}function v(C,B){var z="",A;z+='\n <option selected="" value=\'';if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+" (default)</option>\n ";return z}function u(C,B){var z="",A;z+="\n <option value='";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"</option>\n ";return z}s+="<td class='code'>";if(j=r.name){j=j.call(t,{hash:{},data:y})}else{j=t.name;j=typeof j===d?j.apply(t):j}s+=c(j)+"</td>\n<td>\n <select ";e={hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y};g=((j=r.isArray||t.isArray),j?j.call(t,t,e):q.call(t,"isArray",t,e));if(g||g===0){s+=g}s+=" class='parameter' name='";if(g=r.name){g=g.call(t,{hash:{},data:y})}else{g=t.name;g=typeof g===d?g.apply(t):g}s+=c(g)+"'>\n ";g=r["if"].call(t,t.required,{hash:{},inverse:p.program(5,l,y),fn:p.program(3,n,y),data:y});if(g||g===0){s+=g}s+="\n ";g=r.each.call(t,((j=t.allowableValues),j==null||j===false?j:j.descriptiveValues),{hash:{},inverse:p.noop,fn:p.program(13,w,y),data:y});if(g||g===0){s+=g}s+="\n </select>\n</td>\n<td>";if(g=r.description){g=g.call(t,{hash:{},data:y})}else{g=t.description;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+="</td>\n<td>";if(g=r.paramType){g=g.call(t,{hash:{},data:y})}else{g=t.paramType;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+='</td>\n<td><span class="model-signature"></span></td>';return s})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\n <textarea class='body-textarea' readonly='readonly' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\n ";return q}function c(t,s){var q="",r;q+="\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\n ";return q}function p(t,s){var q="",r;q+="\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\n ";return q}function n(r,q){return"\n (empty)\n "}i+="<td class='code'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\n<td>\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n</td>\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\n<td><span class="model-signature"></span></td>\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly_required=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\n <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\n ";return q}function c(t,s){var q="",r;q+="\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\n ";return q}function p(t,s){var q="",r;q+="\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\n ";return q}function n(r,q){return"\n (empty)\n "}i+="<td class='code required'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\n<td>\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n</td>\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\n<td><span class="model-signature"></span></td>\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_required=b(function(f,q,o,j,u){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);u=u||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(4,k,y),fn:n.program(2,l,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function l(z,y){var w="",x;w+='\n <input type="file" name=\'';if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function k(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(7,h,y),fn:n.program(5,i,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function i(z,y){var w="",x;w+="\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'>";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"</textarea>\n ";return w}function h(z,y){var w="",x;w+="\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n ';return w}function e(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(12,t,y),fn:n.program(10,v,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function v(z,y){var w="",x;w+="\n <input class='parameter' class='required' type='file' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function t(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(15,r,y),fn:n.program(13,s,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function s(z,y){var w="",x;w+="\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value='";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function r(z,y){var w="",x;w+="\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value=''/>\n ";return w}p+="<td class='code required'>";if(g=o.name){g=g.call(q,{hash:{},data:u})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\n<td>\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,u),fn:n.program(1,m,u),data:u});if(g||g===0){p+=g}p+="\n</td>\n<td>\n <strong>";if(g=o.description){g=g.call(q,{hash:{},data:u})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</strong>\n</td>\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:u})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\n<td><span class="model-signature"></span></td>\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.parameter_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.consumes,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="parameterContentType"></label>\n<select name="parameterContentType">\n';c=f["if"].call(l,l.consumes,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.resource=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,p,h="function",j=this.escapeExpression,o=this,n=f.blockHelperMissing;function e(r,q){return" : "}function c(t,s){var q="",r;q+="<li>\n <a href='";if(r=f.url){r=r.call(t,{hash:{},data:s})}else{r=t.url;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>Raw</a>\n </li>";return q}i+="<div class='heading'>\n <h2>\n <a href='#!/";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'\' class="toggleEndpointList" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">';if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</a> ";p={hash:{},inverse:o.noop,fn:o.program(1,e,k),data:k};if(d=f.summary){d=d.call(m,p)}else{d=m.summary;d=typeof d===h?d.apply(m):d}if(!f.summary){d=n.call(m,d,p)}if(d||d===0){i+=d}if(d=f.summary){d=d.call(m,{hash:{},data:k})}else{d=m.summary;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+"' id='endpointListTogger_";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'\' class="toggleEndpointList" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">Show/Hide</a>\n </li>\n <li>\n <a href=\'#\' class="collapseResource" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">\n List Operations\n </a>\n </li>\n <li>\n <a href=\'#\' class="expandResource" data-id=';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+">\n Expand Operations\n </a>\n </li>\n ";p={hash:{},inverse:o.noop,fn:o.program(3,c,k),data:k};if(d=f.url){d=d.call(m,p)}else{d=m.url;d=typeof d===h?d.apply(m):d}if(!f.url){d=n.call(m,d,p)}if(d||d===0){i+=d}i+="\n </ul>\n</div>\n<ul class='endpoints' id='";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+"_endpoint_list' style='display:none'>\n\n</ul>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.response_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="responseContentType"></label>\n<select name="responseContentType">\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.signature=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+='<div>\n<ul class="signature-nav">\n <li><a class="description-link" href="#">Model</a></li>\n <li><a class="snippet-link" href="#">Model Schema</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n <div class="description">\n ';if(c=d.signature){c=c.call(k,{hash:{},data:i})}else{c=k.signature;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+='\n </div>\n\n <div class="snippet">\n <pre><code>';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'</code></pre>\n <small class="notice"></small>\n </div>\n</div>\n\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.status_code=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="<td width='15%' class='code'>";if(c=d.code){c=c.call(k,{hash:{},data:i})}else{c=k.code;c=typeof c===f?c.apply(k):c}g+=h(c)+"</td>\n<td>";if(c=d.message){c=c.call(k,{hash:{},data:i})}else{c=k.message;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+="</td>\n<td width='50%'><span class=\"model-signature\" /></td>";return g})})();(function(){var t,k,l,u,x,q,n,m,p,o,j,r,v,s,i,d,b,B,h,g,f,e,c,a,A,z,w={}.hasOwnProperty,y=function(F,D){for(var C in D){if(w.call(D,C)){F[C]=D[C]}}function E(){this.constructor=F}E.prototype=D.prototype;F.prototype=new E();F.__super__=D.prototype;return F};v=(function(D){y(C,D);function C(){s=C.__super__.constructor.apply(this,arguments);return s}C.prototype.dom_id="swagger_ui";C.prototype.options=null;C.prototype.api=null;C.prototype.headerView=null;C.prototype.mainView=null;C.prototype.initialize=function(E){var F=this;if(E==null){E={}}if(E.dom_id!=null){this.dom_id=E.dom_id;delete E.dom_id}if($("#"+this.dom_id)==null){$("body").append('<div id="'+this.dom_id+'"></div>')}this.options=E;this.options.success=function(){return F.render()};this.options.progress=function(G){return F.showMessage(G)};this.options.failure=function(G){if(F.api&&F.api.isValid===false){log("not a valid 2.0 spec, loading legacy client");F.api=new SwaggerApi(F.options);return F.api.build()}else{return F.onLoadFailure(G)}};this.headerView=new u({el:$("#header")});return this.headerView.on("update-swagger-ui",function(G){return F.updateSwaggerUi(G)})};C.prototype.setOption=function(E,F){return this.options[E]=F};C.prototype.getOption=function(E){return this.options[E]};C.prototype.updateSwaggerUi=function(E){this.options.url=E.url;return this.load()};C.prototype.load=function(){var F,E;if((E=this.mainView)!=null){E.clear()}F=this.options.url;if(F.indexOf("http")!==0){F=this.buildUrl(window.location.href.toString(),F)}this.options.url=F;this.headerView.update(F);this.api=new SwaggerClient(this.options);return this.api.build()};C.prototype.render=function(){var E=this;this.showMessage("Finished Loading Resource Information. Rendering Swagger UI...");this.mainView=new x({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options}).render();this.showMessage();switch(this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}if(this.options.onComplete){this.options.onComplete(this.api,this)}return setTimeout(function(){return Docs.shebang()},400)};C.prototype.buildUrl=function(G,E){var F,H;log("base is "+G);if(E.indexOf("/")===0){H=G.split("/");G=H[0]+"//"+H[2];return G+E}else{F=G.length;if(G.indexOf("?")>-1){F=Math.min(F,G.indexOf("?"))}if(G.indexOf("#")>-1){F=Math.min(F,G.indexOf("#"))}G=G.substring(0,F);if(G.indexOf("/",G.length-1)!==-1){return G+E}return G+"/"+E}};C.prototype.showMessage=function(E){if(E==null){E=""}$("#message-bar").removeClass("message-fail");$("#message-bar").addClass("message-success");return $("#message-bar").html(E)};C.prototype.onLoadFailure=function(E){var F;if(E==null){E=""}$("#message-bar").removeClass("message-success");$("#message-bar").addClass("message-fail");F=$("#message-bar").html(E);if(this.options.onFailure!=null){this.options.onFailure(E)}return F};return C})(Backbone.Router);window.SwaggerUi=v;u=(function(D){y(C,D);function C(){i=C.__super__.constructor.apply(this,arguments);return i}C.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"};C.prototype.initialize=function(){};C.prototype.showPetStore=function(E){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})};C.prototype.showWordnikDev=function(E){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})};C.prototype.showCustomOnKeyup=function(E){if(E.keyCode===13){return this.showCustom()}};C.prototype.showCustom=function(E){if(E!=null){E.preventDefault()}return this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})};C.prototype.update=function(F,G,E){if(E==null){E=false}$("#input_baseUrl").val(F);if(E){return this.trigger("update-swagger-ui",{url:F})}};return C})(Backbone.View);x=(function(C){var D;y(E,C);function E(){h=E.__super__.constructor.apply(this,arguments);return h}D={alpha:function(G,F){return G.path.localeCompare(F.path)},method:function(G,F){return G.method.localeCompare(F.method)}};E.prototype.initialize=function(J){var I,H,G,F,K,L;if(J==null){J={}}this.model.auths=[];L=this.model.securityDefinitions;for(H in L){K=L[H];I={name:H,type:K.type,value:K};this.model.auths.push(I)}if(this.model.info&&this.model.info.license&&typeof this.model.info.license==="string"){G=this.model.info.license;F=this.model.info.licenseUrl;this.model.info.license={};this.model.info.license.name=G;this.model.info.license.url=F}if(!this.model.info){this.model.info={}}if(!this.model.info.version){this.model.info.version=this.model.apiVersion}if(this.model.swaggerVersion==="2.0"){if("validatorUrl" in J.swaggerOptions){return this.model.validatorUrl=J.swaggerOptions.validatorUrl}else{if(this.model.url.match(/https?:\/\/localhost/)){return this.model.validatorUrl=this.model.url}else{return this.model.validatorUrl="http://online.swagger.io/validator"}}}};E.prototype.render=function(){var K,N,F,H,G,L,I,M,O,J;if(this.model.securityDefinitions){for(G in this.model.securityDefinitions){K=this.model.securityDefinitions[G];if(K.type==="apiKey"&&$("#apikey_button").length===0){N=new t({model:K}).render().el;$(".auth_main_container").append(N)}if(K.type==="basicAuth"&&$("#basic_auth_button").length===0){N=new k({model:K}).render().el;$(".auth_main_container").append(N)}}}$(this.el).html(Handlebars.templates.main(this.model));I={};F=0;J=this.model.apisArray;for(M=0,O=J.length;M<O;M++){L=J[M];H=L.name;while(typeof I[H]!=="undefined"){H=H+"_"+F;F+=1}L.id=H;I[H]=L;this.addResource(L,this.model.auths)}return this};E.prototype.addResource=function(H,G){var F;H.id=H.id.replace(/\s/g,"_");F=new p({model:H,tagName:"li",id:"resource_"+H.id,className:"resource",auths:G,swaggerOptions:this.options.swaggerOptions});return $("#resources").append(F.render().el)};E.prototype.clear=function(){return $(this.el).html("")};return E})(Backbone.View);p=(function(D){y(C,D);function C(){g=C.__super__.constructor.apply(this,arguments);return g}C.prototype.initialize=function(E){if(E==null){E={}}this.auths=E.auths;if(""===this.model.description){return this.model.description=null}};C.prototype.render=function(){var F,K,H,G,I,E,J;$(this.el).html(Handlebars.templates.resource(this.model));H={};if(this.model.description){this.model.summary=this.model.description}J=this.model.operationsArray;for(I=0,E=J.length;I<E;I++){G=J[I];F=0;K=G.nickname;while(typeof H[K]!=="undefined"){K=K+"_"+F;F+=1}H[K]=G;G.nickname=K;G.parentId=this.model.id;this.addOperation(G)}$(".toggleEndpointList",this.el).click(this.callDocs.bind(this,"toggleEndpointListForResource"));$(".collapseResource",this.el).click(this.callDocs.bind(this,"collapseOperationsForResource"));$(".expandResource",this.el).click(this.callDocs.bind(this,"expandOperationsForResource"));return this};C.prototype.addOperation=function(E){var F;E.number=this.number;F=new q({model:E,tagName:"li",className:"endpoint",swaggerOptions:this.options.swaggerOptions,auths:this.auths});$(".endpoints",$(this.el)).append(F.render().el);return this.number++};C.prototype.callDocs=function(F,E){E.preventDefault();return Docs[F](E.currentTarget.getAttribute("data-id"))};return C})(Backbone.View);q=(function(D){y(C,D);function C(){f=C.__super__.constructor.apply(this,arguments);return f}C.prototype.invocationUrl=null;C.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","mouseout .api-ic":"mouseExit"};C.prototype.initialize=function(E){if(E==null){E={}}this.auths=E.auths;return this};C.prototype.mouseEnter=function(J){var H,I,M,F,E,N,K,G,O,L;H=$(J.currentTarget.parentNode).find("#api_information_panel");O=J.pageX;L=J.pageY;N=$(window).scrollLeft();K=$(window).scrollTop();F=N+$(window).width();E=K+$(window).height();G=H.width();I=H.height();if(O+G>F){O=F-G}if(O<N){O=N}if(L+I>E){L=E-I}if(L<K){L=K}M={};M.top=L;M.left=O;H.css(M);return $(J.currentTarget.parentNode).find("#api_information_panel").show()};C.prototype.mouseExit=function(E){return $(E.currentTarget.parentNode).find("#api_information_panel").hide()};C.prototype.render=function(){var al,R,aj,F,W,V,af,S,ab,H,Z,G,U,X,ad,ak,E,ao,Y,aa,ai,ah,ag,ae,T,N,L,J,I,ac,an,am,Q,P,O,M,K;V=true;if(!V){this.model.isReadOnly=true}this.model.description=this.model.description||this.model.notes;if(this.model.description){this.model.description=this.model.description.replace(/(?:\r\n|\r|\n)/g,"<br />")}this.model.oauth=null;if(this.model.authorizations){if(Array.isArray(this.model.authorizations)){Q=this.model.authorizations;for(ai=0,T=Q.length;ai<T;ai++){aj=Q[ai];for(S in aj){R=aj[S];for(al in this.auths){R=this.auths[al];if(R.type==="oauth2"){this.model.oauth={};this.model.oauth.scopes=[];P=R.value.scopes;for(af in P){Y=P[af];ab={scope:af,description:Y};this.model.oauth.scopes.push(ab)}}}}}}else{O=this.model.authorizations;for(af in O){Y=O[af];if(af==="oauth2"){if(this.model.oauth===null){this.model.oauth={}}if(this.model.oauth.scopes===void 0){this.model.oauth.scopes=[]}for(ah=0,N=Y.length;ah<N;ah++){ab=Y[ah];this.model.oauth.scopes.push(ab)}}}}}if(typeof this.model.responses!=="undefined"){this.model.responseMessages=[];M=this.model.responses;for(F in M){aa=M[F];X=null;ad=this.model.responses[F].schema;if(ad&&ad["$ref"]){X=ad["$ref"];if(X.indexOf("#/definitions/")===0){X=X.substring("#/definitions/".length)}}this.model.responseMessages.push({code:F,message:aa.description,responseModel:X})}}if(typeof this.model.responseMessages==="undefined"){this.model.responseMessages=[]}$(this.el).html(Handlebars.templates.operation(this.model));if(this.model.responseClassSignature&&this.model.responseClassSignature!=="string"){ak={sampleJSON:this.model.responseSampleJSON,isParam:false,signature:this.model.responseClassSignature};U=new j({model:ak,tagName:"div"});$(".model-signature",$(this.el)).append(U.render().el)}else{this.model.responseClassSignature="string";$(".model-signature",$(this.el)).html(this.model.type)}W={isParam:false};W.consumes=this.model.consumes;W.produces=this.model.produces;K=this.model.parameters;for(ag=0,L=K.length;ag<L;ag++){H=K[ag];ao=H.type||H.dataType;if(typeof ao==="undefined"){X=H.schema;if(X&&X["$ref"]){Z=X["$ref"];if(Z.indexOf("#/definitions/")===0){ao=Z.substring("#/definitions/".length)}else{ao=Z}}}if(ao&&ao.toLowerCase()==="file"){if(!W.consumes){W.consumes="multipart/form-data"}}H.type=ao}G=new o({model:W});$(".response-content-type",$(this.el)).append(G.render().el);an=this.model.parameters;for(ae=0,J=an.length;ae<J;ae++){H=an[ae];this.addParameter(H,W.consumes)}am=this.model.responseMessages;for(ac=0,I=am.length;ac<I;ac++){E=am[ac];this.addStatusCode(E)}return this};C.prototype.addParameter=function(G,E){var F;G.consumes=E;F=new m({model:G,tagName:"tr",readOnly:this.model.isReadOnly});return $(".operation-params",$(this.el)).append(F.render().el)};C.prototype.addStatusCode=function(F){var E;E=new r({model:F,tagName:"tr"});return $(".operation-status",$(this.el)).append(E.render().el)};C.prototype.submitOperation=function(S){var U,K,R,H,M,E,N,Q,P,O,T,J,G,L,I,F;if(S!=null){S.preventDefault()}K=$(".sandbox",$(this.el));U=true;K.find("input.required").each(function(){var V=this;$(this).removeClass("error");if(jQuery.trim($(this).val())===""){$(this).addClass("error");$(this).wiggle({callback:function(){return $(V).focus()}});return U=false}});if(U){H={};E={parent:this};R=false;L=K.find("input");for(Q=0,T=L.length;Q<T;Q++){M=L[Q];if((M.value!=null)&&jQuery.trim(M.value).length>0){H[M.name]=M.value}if(M.type==="file"){R=true}}I=K.find("textarea");for(P=0,J=I.length;P<J;P++){M=I[P];if((M.value!=null)&&jQuery.trim(M.value).length>0){H[M.name]=M.value}}F=K.find("select");for(O=0,G=F.length;O<G;O++){M=F[O];N=this.getSelectedValue(M);if((N!=null)&&jQuery.trim(N).length>0){H[M.name]=N}}E.responseContentType=$("div select[name=responseContentType]",$(this.el)).val();E.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val();$(".response_throbber",$(this.el)).show();if(R){return this.handleFileUpload(H,K)}else{return this.model["do"](H,E,this.showCompleteStatus,this.showErrorStatus,this)}}};C.prototype.success=function(E,F){return F.showCompleteStatus(E)};C.prototype.handleFileUpload=function(V,M){var Q,L,G,R,P,O,T,N,K,J,H,U,Y,X,W,I,F,E,Z,S=this;I=M.serializeArray();for(N=0,U=I.length;N<U;N++){R=I[N];if((R.value!=null)&&jQuery.trim(R.value).length>0){V[R.name]=R.value}}Q=new FormData();T=0;F=this.model.parameters;for(K=0,Y=F.length;K<Y;K++){O=F[K];if(O.paramType==="form"){if(O.type.toLowerCase()!=="file"&&V[O.name]!==void 0){Q.append(O.name,V[O.name])}}}G={};E=this.model.parameters;for(J=0,X=E.length;J<X;J++){O=E[J];if(O.paramType==="header"){G[O.name]=V[O.name]}}Z=M.find('input[type~="file"]');for(H=0,W=Z.length;H<W;H++){L=Z[H];if(typeof L.files[0]!=="undefined"){Q.append($(L).attr("name"),L.files[0]);T+=1}}this.invocationUrl=this.model.supportHeaderParams()?(G=this.model.getHeaderParams(V),this.model.urlify(V,false)):this.model.urlify(V,true);$(".request_url",$(this.el)).html("<pre></pre>");$(".request_url pre",$(this.el)).text(this.invocationUrl);P={type:this.model.method,url:this.invocationUrl,headers:G,data:Q,dataType:"json",contentType:false,processData:false,error:function(ab,ac,aa){return S.showErrorStatus(S.wrap(ab),S)},success:function(aa){return S.showResponse(aa,S)},complete:function(aa){return S.showCompleteStatus(S.wrap(aa),S)}};if(window.authorizations){window.authorizations.apply(P)}if(T===0){P.data.append("fake","true")}jQuery.ajax(P);return false};C.prototype.wrap=function(I){var G,J,L,F,K,H,E;L={};J=I.getAllResponseHeaders().split("\r");for(H=0,E=J.length;H<E;H++){F=J[H];G=F.split(":");if(G[0]!==void 0&&G[1]!==void 0){L[G[0].trim()]=G[1].trim()}}K={};K.content={};K.content.data=I.responseText;K.headers=L;K.request={};K.request.url=this.invocationUrl;K.status=I.status;return K};C.prototype.getSelectedValue=function(E){var H,G,J,F,I;if(!E.multiple){return E.value}else{G=[];I=E.options;for(J=0,F=I.length;J<F;J++){H=I[J];if(H.selected){G.push(H.value)}}if(G.length>0){return G}else{return null}}};C.prototype.hideResponse=function(E){if(E!=null){E.preventDefault()}$(".response",$(this.el)).slideUp();return $(".response_hider",$(this.el)).fadeOut()};C.prototype.showResponse=function(E){var F;F=JSON.stringify(E,null,"\t").replace(/\n/g,"<br>");return $(".response_body",$(this.el)).html(escape(F))};C.prototype.showErrorStatus=function(F,E){return E.showStatus(F)};C.prototype.showCompleteStatus=function(F,E){return E.showStatus(F)};C.prototype.formatXml=function(L){var H,K,F,M,R,N,G,E,P,Q,J,I,O;E=/(>)(<)(\/*)/g;Q=/[ ]*(.*)[ ]+\n/g;H=/(<.+>)(.+\n)/g;L=L.replace(E,"$1\n$2$3").replace(Q,"$1\n").replace(H,"$1\n$2");G=0;K="";R=L.split("\n");F=0;M="other";P={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0};J=function(X){var T,S,V,Z,W,U,Y;U={single:Boolean(X.match(/<.+\/>/)),closing:Boolean(X.match(/<\/.+>/)),opening:Boolean(X.match(/<[^!?].*>/))};W=((function(){var aa;aa=[];for(V in U){Y=U[V];if(Y){aa.push(V)}}return aa})())[0];W=W===void 0?"other":W;T=M+"->"+W;M=W;Z="";F+=P[T];Z=((function(){var ab,ac,aa;aa=[];for(S=ab=0,ac=F;0<=ac?ab<ac:ab>ac;S=0<=ac?++ab:--ab){aa.push(" ")}return aa})()).join("");if(T==="opening->closing"){return K=K.substr(0,K.length-1)+X+"\n"}else{return K+=Z+X+"\n"}};for(I=0,O=R.length;I<O;I++){N=R[I];J(N)}return K};C.prototype.showStatus=function(J){var G,N,P,M,H,Q,E,I,L,K,F;if(J.content===void 0){N=J.data;F=J.url}else{N=J.content.data;F=J.request.url}H=J.headers;P=null;if(H){P=H["Content-Type"]||H["content-type"];if(P){P=P.split(";")[0].trim()}}if(!N){G=$("<code />").text("no content");I=$('<pre class="json" />').append(G)}else{if(P==="application/json"||/\+json$/.test(P)){Q=null;try{Q=JSON.stringify(JSON.parse(N),null," ")}catch(O){M=O;Q="can't parse JSON. Raw result:\n\n"+N}G=$("<code />").text(Q);I=$('<pre class="json" />').append(G)}else{if(P==="application/xml"||/\+xml$/.test(P)){G=$("<code />").text(this.formatXml(N));I=$('<pre class="xml" />').append(G)}else{if(P==="text/html"){G=$("<code />").html(_.escape(N));I=$('<pre class="xml" />').append(G)}else{if(/^image\//.test(P)){I=$("<img>").attr("src",F)}else{G=$("<code />").text(N);I=$('<pre class="json" />').append(G)}}}}}L=I;$(".request_url",$(this.el)).html("<pre></pre>");$(".request_url pre",$(this.el)).text(F);$(".response_code",$(this.el)).html("<pre>"+J.status+"</pre>");$(".response_body",$(this.el)).html(L);$(".response_headers",$(this.el)).html("<pre>"+_.escape(JSON.stringify(J.headers,null," ")).replace(/\n/g,"<br>")+"</pre>");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();K=$(".response_body",$(this.el))[0];E=this.options.swaggerOptions;if(E.highlightSizeThreshold&&J.data.length>E.highlightSizeThreshold){return K}else{return hljs.highlightBlock(K)}};C.prototype.toggleOperationContent=function(){var E;E=$("#"+Docs.escapeResourceName(this.model.parentId)+"_"+this.model.nickname+"_content");if(E.is(":visible")){return Docs.collapseOperation(E)}else{return Docs.expandOperation(E)}};return C})(Backbone.View);r=(function(D){y(C,D);function C(){e=C.__super__.constructor.apply(this,arguments);return e}C.prototype.initialize=function(){};C.prototype.render=function(){var F,E,G;G=this.template();$(this.el).html(G(this.model));if(swaggerUi.api.models.hasOwnProperty(this.model.responseModel)){F={sampleJSON:JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(),null,2),isParam:false,signature:swaggerUi.api.models[this.model.responseModel].getMockSignature()};E=new j({model:F,tagName:"div"});$(".model-signature",this.$el).append(E.render().el)}else{$(".model-signature",this.$el).html("")}return this};C.prototype.template=function(){return Handlebars.templates.status_code};return C})(Backbone.View);m=(function(D){y(C,D);function C(){c=C.__super__.constructor.apply(this,arguments);return c}C.prototype.initialize=function(){return Handlebars.registerHelper("isArray",function(F,E){if(F.type.toLowerCase()==="array"||F.allowMultiple){return E.fn(this)}else{return E.inverse(this)}})};C.prototype.render=function(){var E,F,I,G,J,H,M,N,L,K;K=this.model.type||this.model.dataType;if(typeof K==="undefined"){H=this.model.schema;if(H&&H["$ref"]){G=H["$ref"];if(G.indexOf("#/definitions/")===0){K=G.substring("#/definitions/".length)}else{K=G}}}this.model.type=K;this.model.paramType=this.model["in"]||this.model.paramType;if(this.model.paramType==="body"){this.model.isBody=true}if(K&&K.toLowerCase()==="file"){this.model.isFile=true}this.model["default"]=this.model["default"]||this.model.defaultValue;L=this.template();$(this.el).html(L(this.model));M={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){N=new j({model:M,tagName:"div"});$(".model-signature",$(this.el)).append(N.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}F=false;if(this.model.isBody){F=true}E={isParam:F};E.consumes=this.model.consumes;if(F){I=new n({model:E});$(".parameter-content-type",$(this.el)).append(I.render().el)}else{J=new o({model:E});$(".response-content-type",$(this.el)).append(J.render().el)}return this};C.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return C})(Backbone.View);j=(function(D){y(C,D);function C(){a=C.__super__.constructor.apply(this,arguments);return a}C.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};C.prototype.initialize=function(){};C.prototype.render=function(){var E;E=this.template();$(this.el).html(E(this.model));this.switchToSnippet();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};C.prototype.template=function(){return Handlebars.templates.signature};C.prototype.switchToDescription=function(E){if(E!=null){E.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};C.prototype.switchToSnippet=function(E){if(E!=null){E.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};C.prototype.snippetToTextArea=function(E){var F;if(this.isParam){if(E!=null){E.preventDefault()}F=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(F.val())===""){return F.val(this.model.sampleJSON)}}};return C})(Backbone.View);l=(function(C){y(D,C);function D(){A=D.__super__.constructor.apply(this,arguments);return A}D.prototype.initialize=function(){};D.prototype.render=function(){var E;E=this.template();$(this.el).html(E(this.model));$("label[for=contentType]",$(this.el)).text("Response Content Type");return this};D.prototype.template=function(){return Handlebars.templates.content_type};return D})(Backbone.View);o=(function(C){y(D,C);function D(){z=D.__super__.constructor.apply(this,arguments);return z}D.prototype.initialize=function(){};D.prototype.render=function(){var E;E=this.template();$(this.el).html(E(this.model));$("label[for=responseContentType]",$(this.el)).text("Response Content Type");return this};D.prototype.template=function(){return Handlebars.templates.response_content_type};return D})(Backbone.View);n=(function(D){y(C,D);function C(){d=C.__super__.constructor.apply(this,arguments);return d}C.prototype.initialize=function(){};C.prototype.render=function(){var E;E=this.template();$(this.el).html(E(this.model));$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:");return this};C.prototype.template=function(){return Handlebars.templates.parameter_content_type};return C})(Backbone.View);t=(function(D){y(C,D);function C(){b=C.__super__.constructor.apply(this,arguments);return b}C.prototype.initialize=function(){};C.prototype.render=function(){var E;E=this.template();$(this.el).html(E(this.model));return this};C.prototype.events={"click #apikey_button":"toggleApiKeyContainer","click #apply_api_key":"applyApiKey"};C.prototype.applyApiKey=function(){var E;window.authorizations.add(this.model.name,new ApiKeyAuthorization(this.model.name,$("#input_apiKey_entry").val(),this.model["in"]));window.swaggerUi.load();return E=$("#apikey_container").show()};C.prototype.toggleApiKeyContainer=function(){var E;if($("#apikey_container").length>0){E=$("#apikey_container").first();if(E.is(":visible")){return E.hide()}else{$(".auth_container").hide();return E.show()}}};C.prototype.template=function(){return Handlebars.templates.apikey_button_view};return C})(Backbone.View);k=(function(D){y(C,D);function C(){B=C.__super__.constructor.apply(this,arguments);return B}C.prototype.initialize=function(){};C.prototype.render=function(){var E;E=this.template();$(this.el).html(E(this.model));return this};C.prototype.events={"click #basic_auth_button":"togglePasswordContainer","click #apply_basic_auth":"applyPassword"};C.prototype.applyPassword=function(){var F,E,G;console.log("applying password");G=$(".input_username").val();E=$(".input_password").val();window.authorizations.add(this.model.type,new PasswordAuthorization("basic",G,E));window.swaggerUi.load();return F=$("#basic_auth_container").hide()};C.prototype.togglePasswordContainer=function(){var E;if($("#basic_auth_container").length>0){E=$("#basic_auth_container").show();if(E.is(":visible")){return E.slideUp()}else{$(".auth_container").hide();return E.show()}}};C.prototype.template=function(){return Handlebars.templates.basic_auth_button_view};return C})(Backbone.View)}).call(this);

@@ -90,11 +90,16 @@ // swagger-client.js

else {
for(name in authorizations) {
for (key in this.authz) {
if(key == name) {
value = this.authz[key];
result = value.apply(obj, authorizations);
if (result === true)
status = true;
if(Array.isArray(authorizations)) {
var i;
for(i = 0; i < authorizations.length; i++) {
var auth = authorizations[i];
log(auth);
for (key in this.authz) {
var value = this.authz[key];
if(typeof value !== 'undefined') {
result = value.apply(obj, authorizations);
if (result === true)
status = true;
}
}
}
}
}

@@ -386,4 +391,7 @@ }

this.produces = response.produces;
this.authSchemes = response.authorizations;
this.securityDefinitions = response.securityDefinitions;
// legacy support
this.authSchemes = response.securityDefinitions;
var location = this.parseUri(this.url);

@@ -417,53 +425,58 @@ if(typeof this.schemes === 'undefined' || this.schemes.length === 0) {

for(path in response.paths) {
var httpMethod;
for(httpMethod in response.paths[path]) {
var operation = response.paths[path][httpMethod];
var tags = operation.tags;
if(typeof tags === 'undefined') {
operation.tags = [ 'default' ];
tags = operation.tags;
}
var operationId = this.idFromOp(path, httpMethod, operation);
var operationObject = new Operation (
this,
operationId,
httpMethod,
path,
operation,
this.definitions
);
// bind this operation's execute command to the api
if(tags.length > 0) {
var i;
for(i = 0; i < tags.length; i++) {
var tag = this.tagFromLabel(tags[i]);
var operationGroup = this[tag];
if(typeof operationGroup === 'undefined') {
this[tag] = [];
operationGroup = this[tag];
operationGroup.label = tag;
operationGroup.apis = [];
this[tag].help = this.help.bind(operationGroup);
this.apisArray.push(new OperationGroup(tag, operationObject));
}
operationGroup[operationId] = operationObject.execute.bind(operationObject);
operationGroup[operationId].help = operationObject.help.bind(operationObject);
operationGroup.apis.push(operationObject);
if(typeof response.paths[path] === 'object') {
var httpMethod;
for(httpMethod in response.paths[path]) {
if(['delete', 'get', 'head', 'options', 'patch', 'post', 'put'].indexOf(httpMethod) === -1) {
continue;
}
var operation = response.paths[path][httpMethod];
var tags = operation.tags;
if(typeof tags === 'undefined') {
operation.tags = [ 'default' ];
tags = operation.tags;
}
var operationId = this.idFromOp(path, httpMethod, operation);
var operationObject = new Operation (
this,
operationId,
httpMethod,
path,
operation,
this.definitions
);
// bind this operation's execute command to the api
if(tags.length > 0) {
var i;
for(i = 0; i < tags.length; i++) {
var tag = this.tagFromLabel(tags[i]);
var operationGroup = this[tag];
if(typeof operationGroup === 'undefined') {
this[tag] = [];
operationGroup = this[tag];
operationGroup.label = tag;
operationGroup.apis = [];
this[tag].help = this.help.bind(operationGroup);
this.apisArray.push(new OperationGroup(tag, operationObject));
}
operationGroup[operationId] = operationObject.execute.bind(operationObject);
operationGroup[operationId].help = operationObject.help.bind(operationObject);
operationGroup.apis.push(operationObject);
// legacy UI feature
var j;
var api;
for(j = 0; j < this.apisArray.length; j++) {
if(this.apisArray[j].tag === tag) {
api = this.apisArray[j];
// legacy UI feature
var j;
var api;
for(j = 0; j < this.apisArray.length; j++) {
if(this.apisArray[j].tag === tag) {
api = this.apisArray[j];
}
}
if(api) {
api.operationsArray.push(operationObject);
}
}
if(api) {
api.operationsArray.push(operationObject);
}
}
else {
log('no group to bind to');
}
}
else {
log('no group to bind to');
}
}

@@ -544,2 +557,3 @@ }

this.security = args.security;
this.authorizations = args.security;
this.description = args.description;

@@ -555,3 +569,3 @@

var innerType = this.getType(param);
if(innerType.toString().toLowerCase() === 'boolean') {
if(innerType && innerType.toString().toLowerCase() === 'boolean') {
param.allowableValues = {};

@@ -1112,2 +1126,3 @@ param.isList = true;

this.optional = true;
this.default = obj.default || null;
this.example = obj.example || null;

@@ -1145,2 +1160,4 @@ }

output = this.example;
else if(this.default)
output = this.default;
else if(type === 'date-time')

@@ -1147,0 +1164,0 @@ output = new Date().toISOString();

@@ -10,6 +10,25 @@ var appName;

if(window.swaggerUi.api.authSchemes
&& window.swaggerUi.api.authSchemes.oauth2
&& window.swaggerUi.api.authSchemes.oauth2.scopes) {
scopes = window.swaggerUi.api.authSchemes.oauth2.scopes;
var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
if(auths) {
var key;
var defs = auths;
for(key in defs) {
var auth = defs[key];
if(auth.type === 'oauth2' && auth.scopes) {
var scope;
if(Array.isArray(auth.scopes)) {
// 1.2 support
var i;
for(i = 0; i < auth.scopes.length; i++) {
scopes.push(auth.scopes[i]);
}
}
else {
// 2.0 support
for(scope in auth.scopes) {
scopes.push({scope: scope, description: auth.scopes[scope]});
}
}
}
}
}

@@ -22,32 +41,28 @@

if(popupDialog.length > 0)
popupDialog = popupDialog.last();
else {
popupDialog = $(
[
'<div class="api-popup-dialog">',
'<div class="api-popup-title">Select OAuth2.0 Scopes</div>',
'<div class="api-popup-content">',
'<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.',
'<a href="#">Learn how to use</a>',
'</p>',
'<p><strong>' + appName + '</strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>',
'<ul class="api-popup-scopes">',
'</ul>',
'<p class="error-msg"></p>',
'<div class="api-popup-actions"><button class="api-popup-authbtn api-button green" type="button">Authorize</button><button class="api-popup-cancel api-button gray" type="button">Cancel</button></div>',
'</div>',
'</div>'].join(''));
$(document.body).append(popupDialog);
popupDialog = $(
[
'<div class="api-popup-dialog">',
'<div class="api-popup-title">Select OAuth2.0 Scopes</div>',
'<div class="api-popup-content">',
'<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.',
'<a href="#">Learn how to use</a>',
'</p>',
'<p><strong>' + appName + '</strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>',
'<ul class="api-popup-scopes">',
'</ul>',
'<p class="error-msg"></p>',
'<div class="api-popup-actions"><button class="api-popup-authbtn api-button green" type="button">Authorize</button><button class="api-popup-cancel api-button gray" type="button">Cancel</button></div>',
'</div>',
'</div>'].join(''));
$(document.body).append(popupDialog);
popup = popupDialog.find('ul.api-popup-scopes').empty();
for (i = 0; i < scopes.length; i ++) {
scope = scopes[i];
str = '<li><input type="checkbox" id="scope_' + i + '" scope="' + scope.scope + '"/>' + '<label for="scope_' + i + '">' + scope.scope;
if (scope.description) {
str += '<br/><span class="api-scope-desc">' + scope.description + '</span>';
}
str += '</label></li>';
popup.append(str);
popup = popupDialog.find('ul.api-popup-scopes').empty();
for (i = 0; i < scopes.length; i ++) {
scope = scopes[i];
str = '<li><input type="checkbox" id="scope_' + i + '" scope="' + scope.scope + '"/>' + '<label for="scope_' + i + '">' + scope.scope;
if (scope.description) {
str += '<br/><span class="api-scope-desc">' + scope.description + '</span>';
}
str += '</label></li>';
popup.append(str);
}

@@ -72,3 +87,6 @@

popupDialog.hide();
popupDialog.empty();
popupDialog = [];
});
popupDialog.find('button.api-popup-authbtn').click(function() {

@@ -81,3 +99,3 @@ popupMask.hide();

var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
var redirectUrl = host.protocol + '//' + host.host + pathname + "/o2c.html";
var redirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
var url = null;

@@ -87,8 +105,17 @@

if (authSchemes.hasOwnProperty(key)) {
var o = authSchemes[key].grantTypes;
for(var t in o) {
if(o.hasOwnProperty(t) && t === 'implicit') {
var dets = o[t];
url = dets.loginEndpoint.url + "?response_type=token";
window.swaggerUi.tokenName = dets.tokenName;
if(authSchemes[key].type === 'oauth2' && authSchemes[key].flow === 'implicit') {
var dets = authSchemes[key];
url = dets.authorizationUrl + '?response_type=token';
window.swaggerUi.tokenName = dets.tokenUrl || 'access_token';
}
else if(authSchemes[key].grantTypes) {
// 1.2 support
var o = authSchemes[key].grantTypes;
for(var t in o) {
if(o.hasOwnProperty(t) && t === 'implicit') {
var dets = o[t];
var ep = dets.loginEndpoint.url;
url = dets.loginEndpoint.url + '?response_type=token';
window.swaggerUi.tokenName = dets.tokenName;
}
}

@@ -102,3 +129,3 @@ }

for(k =0; k < o.length; k++) {
scopes.push($(o[k]).attr("scope"));
scopes.push($(o[k]).attr('scope'));
}

@@ -139,10 +166,10 @@

appName = (o.appName||errors.push("missing appName"));
appName = (o.appName||errors.push('missing appName'));
popupMask = (o.popupMask||$('#api-common-mask'));
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
clientId = (o.clientId||errors.push("missing client id"));
realm = (o.realm||errors.push("missing realm"));
clientId = (o.clientId||errors.push('missing client id'));
realm = (o.realm||errors.push('missing realm'));
if(errors.length > 0){
log("auth unable initialize oauth: " + errors);
log('auth unable initialize oauth: ' + errors);
return;

@@ -213,4 +240,3 @@ }

});
window.authorizations.add("oauth2", new ApiKeyAuthorization("Authorization", "Bearer " + b, "header"));
window.authorizations.add('oauth2', new ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
}

@@ -217,0 +243,0 @@ }

// swagger.js
// version 2.0.41
// version 2.0.42

@@ -501,3 +501,3 @@ (function () {

o.nickname = this.sanitize(o.nickname);
var op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces, o.authorizations);
var op = new SwaggerOperation(o.nickname, resource_path, method, o.parameters, o.summary, o.notes, type, responseMessages, this, consumes, produces, o.authorizations, o.deprecated);
this.operations[op.nickname] = op;

@@ -695,3 +695,3 @@ output.push(this.operationsArray.push(op));

var SwaggerOperation = function (nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces, authorizations) {
var SwaggerOperation = function (nickname, path, method, parameters, summary, notes, type, responseMessages, resource, consumes, produces, authorizations, deprecated) {
var _this = this;

@@ -712,2 +712,3 @@

this.authorizations = authorizations;
this.deprecated = deprecated;
this["do"] = __bind(this["do"], this);

@@ -744,3 +745,3 @@

if (type.toLowerCase() === 'boolean') {
if (type && type.toLowerCase() === 'boolean') {
param.allowableValues = {};

@@ -980,25 +981,18 @@ param.allowableValues.values = ["true", "false"];

var param = params[i];
if (param.paramType === 'query') {
if (args[param.name] !== undefined) {
var value = args[param.name];
if (queryParams !== '')
queryParams += '&';
if (Array.isArray(value)) {
var j;
var output = '';
for(j = 0; j < value.length; j++) {
if(j > 0)
output += ',';
output += encodeURIComponent(value[j]);
}
queryParams += encodeURIComponent(param.name) + '=' + output;
}
else {
queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]);
}
}
if (queryParams !== '')
queryParams += '&';
if (Array.isArray(param)) {
var j;
var output = '';
for(j = 0; j < param.length; j++) {
if(j > 0)
output += ',';
output += encodeURIComponent(param[j]);
}
queryParams += encodeURIComponent(param.name) + '=' + output;
}
else {
queryParams += encodeURIComponent(param.name) + '=' + encodeURIComponent(args[param.name]);
}
}
if ((queryParams != null) && queryParams.length > 0)
url += '?' + queryParams;
return url;

@@ -1497,4 +1491,4 @@ };

var contentType = (response._headers["content-type"] || response._headers["Content-Type"] || null)
var headers = response._headers.normalized || response._headers;
var contentType = (headers["content-type"] || headers["Content-Type"] || null)
if (contentType != null) {

@@ -1668,2 +1662,4 @@ if (contentType.indexOf("application/json") == 0 || contentType.indexOf("+json") > 0) {

e.parameterMacro = parameterMacro;
e.modelPropertyMacro = modelPropertyMacro;
e.SampleModels = sampleModels;

@@ -1670,0 +1666,0 @@ e.SwaggerHttp = SwaggerHttp;

{
"name": "swagger-ui",
"version": "2.1.0-alpha.3",
"version": "2.1.0-alpha.4",
"description": "Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",

@@ -5,0 +5,0 @@ "scripts": {

# Swagger UI
Swagger UI is part of Swagger project. The Swagger project allows you to produce, visualize and consume your OWN RESTful services. No proxy or 3rd party services required. Do it your own way.

@@ -14,3 +13,3 @@

Check out [Swagger-Spec](https://github.com/wordnik/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more.
Check out [Swagger-Spec](https://github.com/swagger-api/swagger-spec) for additional information about the Swagger project, including additional libraries with support for other languages and more.

@@ -23,6 +22,6 @@

------------------ | ------------ | -------------------------- | ----- | ------
2.1.0-alpha.1 (in development) | 2014-10-06 | 1.1, 1.2, 2.0 | [master](https://github.com/wordnik/swagger-ui/tree/master) | [Issues](https://github.com/wordnik/swagger-ui/milestones/v2.1.0)
2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/wordnik/swagger-ui/tree/v2.0.24) |
1.0.13 | 2013-03-08 | 1.1, 1.2 | [tag v1.0.13](https://github.com/wordnik/swagger-ui/tree/v1.0.13) |
1.0.1 | 2011-10-11 | 1.0, 1.1 | [tag v1.0.1](https://github.com/wordnik/swagger-ui/tree/v1.0.1) |
2.1.0-alpha.1 (in development) | 2014-10-06 | 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-ui/tree/master) | [Issues](https://github.com/swagger-api/swagger-ui/milestones/v2.1.0)
2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) |
1.0.13 | 2013-03-08 | 1.1, 1.2 | [tag v1.0.13](https://github.com/swagger-api/swagger-ui/tree/v1.0.13) |
1.0.1 | 2011-10-11 | 1.0, 1.1 | [tag v1.0.1](https://github.com/swagger-api/swagger-ui/tree/v1.0.1) |

@@ -38,6 +37,5 @@ ## How to Use It

1. install [handlebars](http://handlebarsjs.com/)
2. install java
3. npm install
4. npm run-script build
5. You should see the distribution under the dist folder. Open ./dist/index.html to launch Swagger UI in a browser
2. npm install
3. npm run-script build
4. You should see the distribution under the dist folder. Open ./dist/index.html to launch Swagger UI in a browser

@@ -61,3 +59,3 @@ ### Use

### SwaggerUi
To use swagger-ui you should take a look at the [source of swagger-ui html page](https://github.com/wordnik/swagger-ui/tree/master/src/main/html) and customize it. This basically requires you to instantiate a SwaggerUi object and call load() on it as below:
To use swagger-ui you should take a look at the [source of swagger-ui html page](https://github.com/swagger-api/swagger-ui/tree/master/src/main/html) and customize it. This basically requires you to instantiate a SwaggerUi object and call load() on it as below:

@@ -72,3 +70,3 @@ ```javascript

```
* *url* parameter should point to a resource listing url as per [Swagger Spec](https://github.com/wordnik/swagger-core/wiki)
* *url* parameter should point to a resource listing url as per [Swagger Spec](https://github.com/swagger-api/swagger-spec/)
* *dom_id parameter* is the the id of a dom element inside which SwaggerUi will put the user interface for swagger

@@ -85,7 +83,7 @@ * *booleanValues* SwaggerUI renders boolean data types as a dropdown. By default it provides a 'true' and 'false' string as the possible choices. You can use this parameter to change the values in dropdown to be something else, for example 0 and 1 by setting booleanValues to new Array(0, 1)

### HTTP Methods and API Invocation
swagger-ui supports invocation of all HTTP methods APIs including GET, PUT, POST, DELETE, PATCH, OPTIONS. These are handled in the [swagger-js](https://github.com/wordnik/swagger-js) project, please see there for specifics on their usage.
swagger-ui supports invocation of all HTTP methods APIs including GET, PUT, POST, DELETE, PATCH, OPTIONS. These are handled in the [swagger-js](https://github.com/swagger-api/swagger-js) project, please see there for specifics on their usage.
### Header Parameters
Header params are supported through a pluggable mechanism in [swagger-js](https://github.com/wordnik/swagger-js). You can see the [index.html](https://github.com/wordnik/swagger-ui/blob/master/dist/index.html) for a sample of how to dynamically set headers:
Header params are supported through a pluggable mechanism in [swagger-js](https://github.com/swagger-api/swagger-js). You can see the [index.html](https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html) for a sample of how to dynamically set headers:

@@ -115,5 +113,5 @@ ```js

Create your own fork of [wordnik/swagger-ui](https://github.com/wordnik/swagger-ui)
Create your own fork of [wordnik/swagger-ui](https://github.com/swagger-api/swagger-ui)
To share your changes, [submit a pull request](https://github.com/wordnik/swagger-ui/pull/new/master).
To share your changes, [submit a pull request](https://github.com/swagger-api/swagger-ui/pull/new/master).

@@ -120,0 +118,0 @@ Since the javascript files are compiled from coffeescript, please submit changes in the *.coffee files! We have to reject changes only in the .js files as they will be lost on each build of the ui.

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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc