swagger_ui_engine_rails7 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +65 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +28 -0
- data/app/assets/fonts/swagger_ui_engine/DroidSans-Bold.ttf +0 -0
- data/app/assets/fonts/swagger_ui_engine/DroidSans.ttf +0 -0
- data/app/assets/images/swagger_ui_engine/collapse.gif +0 -0
- data/app/assets/images/swagger_ui_engine/expand.gif +0 -0
- data/app/assets/images/swagger_ui_engine/explorer_icons.png +0 -0
- data/app/assets/images/swagger_ui_engine/favicon-16x16.png +0 -0
- data/app/assets/images/swagger_ui_engine/favicon-32x32.png +0 -0
- data/app/assets/images/swagger_ui_engine/favicon.ico +0 -0
- data/app/assets/images/swagger_ui_engine/logo_small.png +0 -0
- data/app/assets/images/swagger_ui_engine/pet_store_api.png +0 -0
- data/app/assets/images/swagger_ui_engine/throbber.gif +0 -0
- data/app/assets/images/swagger_ui_engine/wordnik_api.png +0 -0
- data/app/assets/javascripts/swagger_ui_engine/application.js +14 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/ca.js +55 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/de.js +58 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/el.js +58 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/en.js +58 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/es.js +55 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/fr.js +56 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/geo.js +58 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/it.js +54 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/ja.js +58 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/ko-kr.js +55 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/pl.js +55 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/pt.js +55 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/ru.js +58 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/tr.js +55 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/translator.js +39 -0
- data/app/assets/javascripts/swagger_ui_engine/lang/zh-cn.js +58 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/backbone-min.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/es5-shim.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/handlebars-4.0.5.js +3 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/highlight.9.1.0.pack.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/highlight.9.1.0.pack_extended.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/jquery-1.8.0.min.js +3 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/jquery.ba-bbq.min.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/jquery.slideto.min.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/jquery.wiggle.min.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/js-yaml.min.js +2 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/jsoneditor.min.js +5 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/lodash.min.js +2 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/marked.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/object-assign-pollyfill.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/sanitize-html.min.js +4 -0
- data/app/assets/javascripts/swagger_ui_engine/lib/swagger-oauth.js +1 -0
- data/app/assets/javascripts/swagger_ui_engine/swagger-ui.js +25344 -0
- data/app/assets/javascripts/swagger_ui_engine/swagger-ui.min.js +15 -0
- data/app/assets/javascripts/swagger_ui_engine/swagger.json +18 -0
- data/app/assets/stylesheets/swagger_ui_engine/application.css +6 -0
- data/app/assets/stylesheets/swagger_ui_engine/custom.css +7 -0
- data/app/assets/stylesheets/swagger_ui_engine/lib/print.css.erb +1377 -0
- data/app/assets/stylesheets/swagger_ui_engine/lib/reset.css +1 -0
- data/app/assets/stylesheets/swagger_ui_engine/lib/screen.css.erb +1504 -0
- data/app/assets/stylesheets/swagger_ui_engine/lib/style.css +1 -0
- data/app/assets/stylesheets/swagger_ui_engine/lib/typography.css.erb +14 -0
- data/app/assets/stylesheets/swagger_ui_engine/print.css +4 -0
- data/app/controllers/swagger_ui_engine/application_controller.rb +20 -0
- data/app/controllers/swagger_ui_engine/swagger_docs_controller.rb +51 -0
- data/app/helpers/swagger_ui_engine/auth_config_parser.rb +19 -0
- data/app/helpers/swagger_ui_engine/config_parser.rb +26 -0
- data/app/helpers/swagger_ui_engine/oauth_config_parser.rb +12 -0
- data/app/helpers/swagger_ui_engine/translation_helper.rb +16 -0
- data/app/views/swagger_ui_engine/layouts/swagger.html.erb +37 -0
- data/app/views/swagger_ui_engine/swagger_docs/index.html.erb +8 -0
- data/app/views/swagger_ui_engine/swagger_docs/oauth2.html.erb +20 -0
- data/app/views/swagger_ui_engine/swagger_docs/show.html.erb +66 -0
- data/config/routes.rb +12 -0
- data/lib/swagger_ui_engine_rails7/configuration.rb +24 -0
- data/lib/swagger_ui_engine_rails7/defaults.rb +19 -0
- data/lib/swagger_ui_engine_rails7/engine.rb +28 -0
- data/lib/swagger_ui_engine_rails7/version.rb +4 -0
- data/lib/swagger_ui_engine_rails7.rb +20 -0
- metadata +148 -0
@@ -0,0 +1 @@
|
|
1
|
+
function handleLogin(){var e=[],o=window.swaggerUiAuth.authSchemes||window.swaggerUiAuth.securityDefinitions;if(o){var i,n=o;for(i in n){var a=n[i];if("oauth2"===a.type&&a.scopes){var t;if(Array.isArray(a.scopes)){var p;for(p=0;p<a.scopes.length;p++)e.push(a.scopes[p])}else for(t in a.scopes)e.push({scope:t,description:a.scopes[t],OAuthSchemeKey:i})}}}for(window.swaggerUi.api&&window.swaggerUi.api.info&&(appName=window.swaggerUi.api.info.title),$(".api-popup-dialog").remove(),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" data-sw-translate>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(),p=0;p<e.length;p++)t=e[p],str='<li><input type="checkbox" id="scope_'+p+'" scope="'+t.scope+'"" oauthtype="'+t.OAuthSchemeKey+'"/><label for="scope_'+p+'">'+t.scope,t.description&&($.map(o,function(e,o){return o}).length>1?str+='<br/><span class="api-scope-desc">'+t.description+" ("+t.OAuthSchemeKey+")</span>":str+='<br/><span class="api-scope-desc">'+t.description+"</span>"),str+="</label></li>",popup.append(str);var r=$(window),s=r.width(),c=r.height(),l=r.scrollTop(),d=popupDialog.outerWidth(),u=popupDialog.outerHeight(),h=(c-u)/2+l,g=(s-d)/2;popupDialog.css({top:(h<0?0:h)+"px",left:(g<0?0:g)+"px"}),popupDialog.find("button.api-popup-cancel").click(function(){popupMask.hide(),popupDialog.hide(),popupDialog.empty(),popupDialog=[]}),$("button.api-popup-authbtn").unbind(),popupDialog.find("button.api-popup-authbtn").click(function(){function e(e){return e.vendorExtensions["x-tokenName"]||e.tokenName}popupMask.hide(),popupDialog.hide();var o,i=window.swaggerUi.api.authSchemes,n=window.location,a=location.pathname.substring(0,location.pathname.lastIndexOf("/")),t=n.protocol+"//"+n.host+a+"/o2c.html",p=window.oAuthRedirectUrl||t,r=null,s=[],c=popup.find("input:checked"),l=[];for(k=0;k<c.length;k++){var d=$(c[k]).attr("scope");s.indexOf(d)===-1&&s.push(d);var u=$(c[k]).attr("oauthtype");l.indexOf(u)===-1&&l.push(u)}window.enabledScopes=s;for(var h in i)if(i.hasOwnProperty(h)&&l.indexOf(h)!=-1){var g=i[h].flow;if("oauth2"!==i[h].type||!g||"implicit"!==g&&"accessCode"!==g){if("oauth2"===i[h].type&&g&&"application"===g){var w=i[h];return window.swaggerUi.tokenName=e(w)||"access_token",void clientCredentialsFlow(s,w.tokenUrl,h)}if(i[h].grantTypes){var c=i[h].grantTypes;for(var f in c)if(c.hasOwnProperty(f)&&"implicit"===f){var w=c[f];w.loginEndpoint.url;r=w.loginEndpoint.url+"?response_type=token",window.swaggerUi.tokenName=e(w)}else if(c.hasOwnProperty(f)&&"accessCode"===f){var w=c[f];w.tokenRequestEndpoint.url;r=w.tokenRequestEndpoint.url+"?response_type=code",window.swaggerUi.tokenName=e(w)}}}else{var w=i[h];r=w.authorizationUrl+"?response_type="+("implicit"===g?"token":"code"),window.swaggerUi.tokenName=e(w)||"access_token",window.swaggerUi.tokenUrl="accessCode"===g?w.tokenUrl:null,o=h}}redirect_uri=p,r+="&redirect_uri="+encodeURIComponent(p),r+="&realm="+encodeURIComponent(realm),r+="&client_id="+encodeURIComponent(clientId),r+="&scope="+encodeURIComponent(s.join(scopeSeparator)),r+="&state="+encodeURIComponent(o);for(var h in additionalQueryStringParams)r+="&"+h+"="+encodeURIComponent(additionalQueryStringParams[h]);window.open(r)}),popupMask.show(),popupDialog.show()}function handleLogout(){for(key in window.swaggerUi.api.clientAuthorizations.authz)window.swaggerUi.api.clientAuthorizations.remove(key);window.enabledScopes=null,$(".api-ic.ic-on").addClass("ic-off"),$(".api-ic.ic-on").removeClass("ic-on"),$(".api-ic.ic-warning").addClass("ic-error"),$(".api-ic.ic-warning").removeClass("ic-warning")}function initOAuth(e){var o=e||{},i=[];return appName=o.appName||i.push("missing appName"),popupMask=o.popupMask||$("#api-common-mask"),popupDialog=o.popupDialog||$(".api-popup-dialog"),clientId=o.clientId||i.push("missing client id"),clientSecret=o.clientSecret||null,realm=o.realm||i.push("missing realm"),scopeSeparator=o.scopeSeparator||" ",additionalQueryStringParams=o.additionalQueryStringParams||{},i.length>0?void log("auth unable initialize oauth: "+i):($("pre code").each(function(e,o){hljs.highlightBlock(o)}),$(".api-ic").unbind(),void $(".api-ic").click(function(e){$(e.target).hasClass("ic-off")?handleLogin():handleLogout()}))}function clientCredentialsFlow(e,o,i){var n={client_id:clientId,client_secret:clientSecret,scope:e.join(" "),grant_type:"client_credentials"};$.ajax({url:o,type:"POST",data:n,success:function(e,o,n){onOAuthComplete(e,i)},error:function(e,o,i){onOAuthComplete("")}})}var appName,popupMask,popupDialog,clientId,realm,redirect_uri,clientSecret,scopeSeparator,additionalQueryStringParams;window.processOAuthCode=function(e){var o=e.state,i=window.location,n=location.pathname.substring(0,location.pathname.lastIndexOf("/")),a=i.protocol+"//"+i.host+n+"/o2c.html",t=window.oAuthRedirectUrl||a,p={client_id:clientId,code:e.code,grant_type:"authorization_code",redirect_uri:t};clientSecret&&(p.client_secret=clientSecret),$.ajax({url:window.swaggerUiAuth.tokenUrl,type:"POST",data:p,success:function(e,i,n){onOAuthComplete(e,o)},error:function(e,o,i){onOAuthComplete("")}})},window.onOAuthComplete=function(e,o){if(e)if(e.error){var i=$("input[type=checkbox],.secured");i.each(function(e){i[e].checked=!1}),alert(e.error)}else{var n=e[window.swaggerUiAuth.tokenName];if(o||(o=e.state),n){var a=null;$.each($(".auth .api-ic .api_information_panel"),function(e,o){var i=o;if(i&&i.childNodes){var n=[];$.each(i.childNodes,function(e,o){var i=o.innerHTML;i&&n.push(i)});for(var t=[],p=0;p<n.length;p++){var r=n[p];window.enabledScopes&&window.enabledScopes.indexOf(r)==-1&&t.push(r)}t.length>0?(a=o.parentNode.parentNode,$(a.parentNode).find(".api-ic.ic-on").addClass("ic-off"),$(a.parentNode).find(".api-ic.ic-on").removeClass("ic-on"),$(a).find(".api-ic").addClass("ic-warning"),$(a).find(".api-ic").removeClass("ic-error")):(a=o.parentNode.parentNode,$(a.parentNode).find(".api-ic.ic-off").addClass("ic-on"),$(a.parentNode).find(".api-ic.ic-off").removeClass("ic-off"),$(a).find(".api-ic").addClass("ic-info"),$(a).find(".api-ic").removeClass("ic-warning"),$(a).find(".api-ic").removeClass("ic-error"))}}),"undefined"!=typeof window.swaggerUi&&(window.swaggerUi.api.clientAuthorizations.add(window.swaggerUiAuth.OAuthSchemeKey,new SwaggerClient.ApiKeyAuthorization("Authorization","Bearer "+n,"header")),window.swaggerUi.load())}}};
|