You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/02/25 09:26:31 UTC
[isis] 02/02: ISIS-1881 remove swagger-ui from simpleapp/helloworld
and artifacts
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 48c78c877c8f4260a70001a8583718ce7224d299
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sun Feb 25 10:25:04 2018 +0100
ISIS-1881 remove swagger-ui from simpleapp/helloworld and artifacts
(swagger-ui is now bundled with metamodel)
---
.../src/main/webapp/swagger-ui/00-README.md | 5 -
.../src/main/webapp/swagger-ui/css/print.css | 1 -
.../src/main/webapp/swagger-ui/css/reset.css | 1 -
.../src/main/webapp/swagger-ui/css/screen.css | 1 -
.../src/main/webapp/swagger-ui/css/style.css | 1 -
.../src/main/webapp/swagger-ui/css/typography.css | 0
.../webapp/swagger-ui/fonts/DroidSans-Bold.ttf | Bin 42480 -> 0 bytes
.../src/main/webapp/swagger-ui/fonts/DroidSans.ttf | Bin 41028 -> 0 bytes
.../src/main/webapp/swagger-ui/images/collapse.gif | Bin 69 -> 0 bytes
.../src/main/webapp/swagger-ui/images/expand.gif | Bin 73 -> 0 bytes
.../webapp/swagger-ui/images/explorer_icons.png | Bin 5115 -> 0 bytes
.../webapp/swagger-ui/images/favicon-16x16.png | Bin 445 -> 0 bytes
.../webapp/swagger-ui/images/favicon-32x32.png | Bin 1141 -> 0 bytes
.../src/main/webapp/swagger-ui/images/favicon.ico | Bin 5430 -> 0 bytes
.../main/webapp/swagger-ui/images/logo_small.png | Bin 455 -> 0 bytes
.../webapp/swagger-ui/images/pet_store_api.png | Bin 631 -> 0 bytes
.../src/main/webapp/swagger-ui/images/throbber.gif | Bin 9257 -> 0 bytes
.../main/webapp/swagger-ui/images/wordnik_api.png | Bin 670 -> 0 bytes
.../main/webapp/swagger-ui/index-ORIG-2.2.10.html | 126 -
.../src/main/webapp/swagger-ui/index.html | 168 -
.../src/main/webapp/swagger-ui/lang/ca.js | 53 -
.../src/main/webapp/swagger-ui/lang/el.js | 56 -
.../src/main/webapp/swagger-ui/lang/en.js | 56 -
.../src/main/webapp/swagger-ui/lang/es.js | 53 -
.../src/main/webapp/swagger-ui/lang/fr.js | 54 -
.../src/main/webapp/swagger-ui/lang/geo.js | 56 -
.../src/main/webapp/swagger-ui/lang/it.js | 52 -
.../src/main/webapp/swagger-ui/lang/ja.js | 56 -
.../src/main/webapp/swagger-ui/lang/ko-kr.js | 53 -
.../src/main/webapp/swagger-ui/lang/pl.js | 53 -
.../src/main/webapp/swagger-ui/lang/pt.js | 53 -
.../src/main/webapp/swagger-ui/lang/ru.js | 56 -
.../src/main/webapp/swagger-ui/lang/tr.js | 53 -
.../src/main/webapp/swagger-ui/lang/translator.js | 39 -
.../src/main/webapp/swagger-ui/lang/zh-cn.js | 56 -
.../src/main/webapp/swagger-ui/lib/backbone-min.js | 1 -
.../src/main/webapp/swagger-ui/lib/es5-shim.js | 1 -
.../main/webapp/swagger-ui/lib/handlebars-4.0.5.js | 3 -
.../webapp/swagger-ui/lib/highlight.9.1.0.pack.js | 1 -
.../lib/highlight.9.1.0.pack_extended.js | 1 -
.../main/webapp/swagger-ui/lib/jquery-1.8.0.min.js | 3 -
.../webapp/swagger-ui/lib/jquery.ba-bbq.min.js | 1 -
.../webapp/swagger-ui/lib/jquery.slideto.min.js | 1 -
.../webapp/swagger-ui/lib/jquery.wiggle.min.js | 1 -
.../src/main/webapp/swagger-ui/lib/js-yaml.min.js | 2 -
.../main/webapp/swagger-ui/lib/jsoneditor.min.js | 5 -
.../src/main/webapp/swagger-ui/lib/lodash.min.js | 2 -
.../src/main/webapp/swagger-ui/lib/marked.js | 1 -
.../swagger-ui/lib/object-assign-pollyfill.js | 1 -
.../webapp/swagger-ui/lib/sanitize-html.min.js | 4 -
.../main/webapp/swagger-ui/lib/swagger-oauth.js | 1 -
.../helloworld/src/main/webapp/swagger-ui/o2c.html | 20 -
.../src/main/webapp/swagger-ui/swagger-ui.js | 25344 -------------------
.../src/main/webapp/swagger-ui/swagger-ui.min.js | 15 -
.../webapp/src/main/webapp/swagger-ui/00-README.md | 5 -
.../src/main/webapp/swagger-ui/css/print.css | 1 -
.../src/main/webapp/swagger-ui/css/reset.css | 1 -
.../src/main/webapp/swagger-ui/css/screen.css | 1 -
.../src/main/webapp/swagger-ui/css/style.css | 1 -
.../src/main/webapp/swagger-ui/css/typography.css | 0
.../webapp/swagger-ui/fonts/DroidSans-Bold.ttf | Bin 42480 -> 0 bytes
.../src/main/webapp/swagger-ui/fonts/DroidSans.ttf | Bin 41028 -> 0 bytes
.../src/main/webapp/swagger-ui/images/collapse.gif | Bin 69 -> 0 bytes
.../src/main/webapp/swagger-ui/images/expand.gif | Bin 73 -> 0 bytes
.../webapp/swagger-ui/images/explorer_icons.png | Bin 5115 -> 0 bytes
.../webapp/swagger-ui/images/favicon-16x16.png | Bin 445 -> 0 bytes
.../webapp/swagger-ui/images/favicon-32x32.png | Bin 1141 -> 0 bytes
.../src/main/webapp/swagger-ui/images/favicon.ico | Bin 5430 -> 0 bytes
.../main/webapp/swagger-ui/images/logo_small.png | Bin 455 -> 0 bytes
.../webapp/swagger-ui/images/pet_store_api.png | Bin 631 -> 0 bytes
.../src/main/webapp/swagger-ui/images/throbber.gif | Bin 9257 -> 0 bytes
.../main/webapp/swagger-ui/images/wordnik_api.png | Bin 670 -> 0 bytes
.../main/webapp/swagger-ui/index-ORIG-2.2.10.html | 126 -
.../webapp/src/main/webapp/swagger-ui/index.html | 168 -
.../webapp/src/main/webapp/swagger-ui/lang/ca.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/el.js | 56 -
.../webapp/src/main/webapp/swagger-ui/lang/en.js | 56 -
.../webapp/src/main/webapp/swagger-ui/lang/es.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/fr.js | 54 -
.../webapp/src/main/webapp/swagger-ui/lang/geo.js | 56 -
.../webapp/src/main/webapp/swagger-ui/lang/it.js | 52 -
.../webapp/src/main/webapp/swagger-ui/lang/ja.js | 56 -
.../src/main/webapp/swagger-ui/lang/ko-kr.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/pl.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/pt.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/ru.js | 56 -
.../webapp/src/main/webapp/swagger-ui/lang/tr.js | 53 -
.../src/main/webapp/swagger-ui/lang/translator.js | 39 -
.../src/main/webapp/swagger-ui/lang/zh-cn.js | 56 -
.../src/main/webapp/swagger-ui/lib/backbone-min.js | 1 -
.../src/main/webapp/swagger-ui/lib/es5-shim.js | 1 -
.../main/webapp/swagger-ui/lib/handlebars-4.0.5.js | 3 -
.../webapp/swagger-ui/lib/highlight.9.1.0.pack.js | 1 -
.../lib/highlight.9.1.0.pack_extended.js | 1 -
.../main/webapp/swagger-ui/lib/jquery-1.8.0.min.js | 3 -
.../webapp/swagger-ui/lib/jquery.ba-bbq.min.js | 1 -
.../webapp/swagger-ui/lib/jquery.slideto.min.js | 1 -
.../webapp/swagger-ui/lib/jquery.wiggle.min.js | 1 -
.../src/main/webapp/swagger-ui/lib/js-yaml.min.js | 2 -
.../main/webapp/swagger-ui/lib/jsoneditor.min.js | 5 -
.../src/main/webapp/swagger-ui/lib/lodash.min.js | 2 -
.../src/main/webapp/swagger-ui/lib/marked.js | 1 -
.../swagger-ui/lib/object-assign-pollyfill.js | 1 -
.../webapp/swagger-ui/lib/sanitize-html.min.js | 4 -
.../main/webapp/swagger-ui/lib/swagger-oauth.js | 1 -
.../webapp/src/main/webapp/swagger-ui/o2c.html | 20 -
.../src/main/webapp/swagger-ui/swagger-ui.js | 25344 -------------------
.../src/main/webapp/swagger-ui/swagger-ui.min.js | 15 -
.../src/main/webapp/swagger-ui/00-README.md | 5 -
.../src/main/webapp/swagger-ui/css/print.css | 1 -
.../src/main/webapp/swagger-ui/css/reset.css | 1 -
.../src/main/webapp/swagger-ui/css/screen.css | 1 -
.../src/main/webapp/swagger-ui/css/style.css | 1 -
.../src/main/webapp/swagger-ui/css/typography.css | 0
.../webapp/swagger-ui/fonts/DroidSans-Bold.ttf | Bin 42480 -> 0 bytes
.../src/main/webapp/swagger-ui/fonts/DroidSans.ttf | Bin 41028 -> 0 bytes
.../src/main/webapp/swagger-ui/images/collapse.gif | Bin 69 -> 0 bytes
.../src/main/webapp/swagger-ui/images/expand.gif | Bin 73 -> 0 bytes
.../webapp/swagger-ui/images/explorer_icons.png | Bin 5115 -> 0 bytes
.../webapp/swagger-ui/images/favicon-16x16.png | Bin 445 -> 0 bytes
.../webapp/swagger-ui/images/favicon-32x32.png | Bin 1141 -> 0 bytes
.../src/main/webapp/swagger-ui/images/favicon.ico | Bin 5430 -> 0 bytes
.../main/webapp/swagger-ui/images/logo_small.png | Bin 455 -> 0 bytes
.../webapp/swagger-ui/images/pet_store_api.png | Bin 631 -> 0 bytes
.../src/main/webapp/swagger-ui/images/throbber.gif | Bin 9257 -> 0 bytes
.../main/webapp/swagger-ui/images/wordnik_api.png | Bin 670 -> 0 bytes
.../main/webapp/swagger-ui/index-ORIG-2.2.10.html | 129 -
.../src/main/webapp/swagger-ui/index.html | 171 -
.../src/main/webapp/swagger-ui/lang/ca.js | 53 -
.../src/main/webapp/swagger-ui/lang/el.js | 56 -
.../src/main/webapp/swagger-ui/lang/en.js | 56 -
.../src/main/webapp/swagger-ui/lang/es.js | 53 -
.../src/main/webapp/swagger-ui/lang/fr.js | 54 -
.../src/main/webapp/swagger-ui/lang/geo.js | 56 -
.../src/main/webapp/swagger-ui/lang/it.js | 52 -
.../src/main/webapp/swagger-ui/lang/ja.js | 56 -
.../src/main/webapp/swagger-ui/lang/ko-kr.js | 53 -
.../src/main/webapp/swagger-ui/lang/pl.js | 53 -
.../src/main/webapp/swagger-ui/lang/pt.js | 53 -
.../src/main/webapp/swagger-ui/lang/ru.js | 56 -
.../src/main/webapp/swagger-ui/lang/tr.js | 53 -
.../src/main/webapp/swagger-ui/lang/translator.js | 39 -
.../src/main/webapp/swagger-ui/lang/zh-cn.js | 56 -
.../src/main/webapp/swagger-ui/lib/backbone-min.js | 1 -
.../src/main/webapp/swagger-ui/lib/es5-shim.js | 1 -
.../main/webapp/swagger-ui/lib/handlebars-4.0.5.js | 3 -
.../webapp/swagger-ui/lib/highlight.9.1.0.pack.js | 1 -
.../lib/highlight.9.1.0.pack_extended.js | 1 -
.../main/webapp/swagger-ui/lib/jquery-1.8.0.min.js | 3 -
.../webapp/swagger-ui/lib/jquery.ba-bbq.min.js | 1 -
.../webapp/swagger-ui/lib/jquery.slideto.min.js | 1 -
.../webapp/swagger-ui/lib/jquery.wiggle.min.js | 1 -
.../src/main/webapp/swagger-ui/lib/js-yaml.min.js | 2 -
.../main/webapp/swagger-ui/lib/jsoneditor.min.js | 5 -
.../src/main/webapp/swagger-ui/lib/lodash.min.js | 2 -
.../src/main/webapp/swagger-ui/lib/marked.js | 1 -
.../swagger-ui/lib/object-assign-pollyfill.js | 1 -
.../webapp/swagger-ui/lib/sanitize-html.min.js | 4 -
.../main/webapp/swagger-ui/lib/swagger-oauth.js | 1 -
.../src/main/webapp/swagger-ui/o2c.html | 23 -
.../src/main/webapp/swagger-ui/swagger-ui.js | 25344 -------------------
.../src/main/webapp/swagger-ui/swagger-ui.min.js | 15 -
.../webapp/src/main/webapp/swagger-ui/00-README.md | 5 -
.../src/main/webapp/swagger-ui/css/print.css | 1 -
.../src/main/webapp/swagger-ui/css/reset.css | 1 -
.../src/main/webapp/swagger-ui/css/screen.css | 1 -
.../src/main/webapp/swagger-ui/css/style.css | 1 -
.../src/main/webapp/swagger-ui/css/typography.css | 0
.../webapp/swagger-ui/fonts/DroidSans-Bold.ttf | Bin 42480 -> 0 bytes
.../src/main/webapp/swagger-ui/fonts/DroidSans.ttf | Bin 41028 -> 0 bytes
.../src/main/webapp/swagger-ui/images/collapse.gif | Bin 69 -> 0 bytes
.../src/main/webapp/swagger-ui/images/expand.gif | Bin 73 -> 0 bytes
.../webapp/swagger-ui/images/explorer_icons.png | Bin 5115 -> 0 bytes
.../webapp/swagger-ui/images/favicon-16x16.png | Bin 445 -> 0 bytes
.../webapp/swagger-ui/images/favicon-32x32.png | Bin 1141 -> 0 bytes
.../src/main/webapp/swagger-ui/images/favicon.ico | Bin 5430 -> 0 bytes
.../main/webapp/swagger-ui/images/logo_small.png | Bin 455 -> 0 bytes
.../webapp/swagger-ui/images/pet_store_api.png | Bin 631 -> 0 bytes
.../src/main/webapp/swagger-ui/images/throbber.gif | Bin 9257 -> 0 bytes
.../main/webapp/swagger-ui/images/wordnik_api.png | Bin 670 -> 0 bytes
.../main/webapp/swagger-ui/index-ORIG-2.2.10.html | 129 -
.../webapp/src/main/webapp/swagger-ui/index.html | 171 -
.../webapp/src/main/webapp/swagger-ui/lang/ca.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/el.js | 56 -
.../webapp/src/main/webapp/swagger-ui/lang/en.js | 56 -
.../webapp/src/main/webapp/swagger-ui/lang/es.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/fr.js | 54 -
.../webapp/src/main/webapp/swagger-ui/lang/geo.js | 56 -
.../webapp/src/main/webapp/swagger-ui/lang/it.js | 52 -
.../webapp/src/main/webapp/swagger-ui/lang/ja.js | 56 -
.../src/main/webapp/swagger-ui/lang/ko-kr.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/pl.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/pt.js | 53 -
.../webapp/src/main/webapp/swagger-ui/lang/ru.js | 56 -
.../webapp/src/main/webapp/swagger-ui/lang/tr.js | 53 -
.../src/main/webapp/swagger-ui/lang/translator.js | 39 -
.../src/main/webapp/swagger-ui/lang/zh-cn.js | 56 -
.../src/main/webapp/swagger-ui/lib/backbone-min.js | 1 -
.../src/main/webapp/swagger-ui/lib/es5-shim.js | 1 -
.../main/webapp/swagger-ui/lib/handlebars-4.0.5.js | 3 -
.../webapp/swagger-ui/lib/highlight.9.1.0.pack.js | 1 -
.../lib/highlight.9.1.0.pack_extended.js | 1 -
.../main/webapp/swagger-ui/lib/jquery-1.8.0.min.js | 3 -
.../webapp/swagger-ui/lib/jquery.ba-bbq.min.js | 1 -
.../webapp/swagger-ui/lib/jquery.slideto.min.js | 1 -
.../webapp/swagger-ui/lib/jquery.wiggle.min.js | 1 -
.../src/main/webapp/swagger-ui/lib/js-yaml.min.js | 2 -
.../main/webapp/swagger-ui/lib/jsoneditor.min.js | 5 -
.../src/main/webapp/swagger-ui/lib/lodash.min.js | 2 -
.../src/main/webapp/swagger-ui/lib/marked.js | 1 -
.../swagger-ui/lib/object-assign-pollyfill.js | 1 -
.../webapp/swagger-ui/lib/sanitize-html.min.js | 4 -
.../main/webapp/swagger-ui/lib/swagger-oauth.js | 1 -
.../webapp/src/main/webapp/swagger-ui/o2c.html | 23 -
.../src/main/webapp/swagger-ui/swagger-ui.js | 25344 -------------------
.../src/main/webapp/swagger-ui/swagger-ui.min.js | 15 -
216 files changed, 106058 deletions(-)
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/00-README.md b/example/application/helloworld/src/main/webapp/swagger-ui/00-README.md
deleted file mode 100644
index 31e1c18..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/00-README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# README
-
-This directory is almost exact copy of the [swagger-ui dist](https://github.com/swagger-api/swagger-ui/tree/v2.2.10/dist) directory.
-
-The only changes are some very simple alterations to the `index.html` for (a) Basic auth and (b) to allow different Swagger specification file to be used.
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/css/print.css b/example/application/helloworld/src/main/webapp/swagger-ui/css/print.css
deleted file mode 100644
index f2e8446..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/css/print.css
+++ /dev/null
@@ -1 +0,0 @@
-.swagger-section pre code{display:block;padding:.5em;background:#f0f0f0}.swagger-section pre .clojure .built_in,.swagger-section pre .lisp .title,.swagger-section pre .nginx .title,.swagger-section pre .subst,.swagger-section pre .tag .title,.swagger-section pre code{color:#000}.swagger-section pre .addition,.swagger-section pre .aggregate,.swagger-section pre .apache .cbracket,.swagger-section pre .apache .tag,.swagger-section pre .bash .variable,.swagger-section pre .constant,.swagger- [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/css/reset.css b/example/application/helloworld/src/main/webapp/swagger-ui/css/reset.css
deleted file mode 100644
index 40dc830..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/css/reset.css
+++ /dev/null
@@ -1 +0,0 @@
-a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}a [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/css/screen.css b/example/application/helloworld/src/main/webapp/swagger-ui/css/screen.css
deleted file mode 100644
index 1f069f6..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/css/screen.css
+++ /dev/null
@@ -1 +0,0 @@
-.swagger-section pre code{display:block;padding:.5em;background:#f0f0f0}.swagger-section pre .clojure .built_in,.swagger-section pre .lisp .title,.swagger-section pre .nginx .title,.swagger-section pre .subst,.swagger-section pre .tag .title,.swagger-section pre code{color:#000}.swagger-section pre .addition,.swagger-section pre .aggregate,.swagger-section pre .apache .cbracket,.swagger-section pre .apache .tag,.swagger-section pre .bash .variable,.swagger-section pre .constant,.swagger- [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/css/style.css b/example/application/helloworld/src/main/webapp/swagger-ui/css/style.css
deleted file mode 100644
index 52907e4..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/css/style.css
+++ /dev/null
@@ -1 +0,0 @@
-.swagger-section #header a#logo{font-size:1.5em;font-weight:700;text-decoration:none;padding:20px 0 20px 40px}#text-head{font-size:80px;font-family:Roboto,sans-serif;color:#fff;float:right;margin-right:20%}.navbar-fixed-top .navbar-brand,.navbar-fixed-top .navbar-nav,.navbar-header{height:auto}.navbar-inverse{background-color:#000;border-color:#000}#navbar-brand{margin-left:20%}.navtext{font-size:10px}.h1,h1{font-size:60px}.navbar-default .navbar-header .navbar-brand{color:#a2dfee}.swagg [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/css/typography.css b/example/application/helloworld/src/main/webapp/swagger-ui/css/typography.css
deleted file mode 100644
index e69de29..0000000
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/fonts/DroidSans-Bold.ttf b/example/application/helloworld/src/main/webapp/swagger-ui/fonts/DroidSans-Bold.ttf
deleted file mode 100644
index 036c4d1..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/fonts/DroidSans-Bold.ttf and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/fonts/DroidSans.ttf b/example/application/helloworld/src/main/webapp/swagger-ui/fonts/DroidSans.ttf
deleted file mode 100644
index e517a0c..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/fonts/DroidSans.ttf and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/collapse.gif b/example/application/helloworld/src/main/webapp/swagger-ui/images/collapse.gif
deleted file mode 100644
index 8843e8c..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/collapse.gif and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/expand.gif b/example/application/helloworld/src/main/webapp/swagger-ui/images/expand.gif
deleted file mode 100644
index 477bf13..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/expand.gif and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/explorer_icons.png b/example/application/helloworld/src/main/webapp/swagger-ui/images/explorer_icons.png
deleted file mode 100644
index be43b27..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/explorer_icons.png and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon-16x16.png b/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon-16x16.png
deleted file mode 100644
index 0f7e13b..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon-16x16.png and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon-32x32.png b/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon-32x32.png
deleted file mode 100644
index b0a3352..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon-32x32.png and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon.ico b/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon.ico
deleted file mode 100644
index 8b60bcf..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/favicon.ico and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/logo_small.png b/example/application/helloworld/src/main/webapp/swagger-ui/images/logo_small.png
deleted file mode 100644
index ce3908e..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/logo_small.png and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/pet_store_api.png b/example/application/helloworld/src/main/webapp/swagger-ui/images/pet_store_api.png
deleted file mode 100644
index 1192ad8..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/pet_store_api.png and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/throbber.gif b/example/application/helloworld/src/main/webapp/swagger-ui/images/throbber.gif
deleted file mode 100644
index 0639388..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/throbber.gif and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/images/wordnik_api.png b/example/application/helloworld/src/main/webapp/swagger-ui/images/wordnik_api.png
deleted file mode 100644
index dc0ddab..0000000
Binary files a/example/application/helloworld/src/main/webapp/swagger-ui/images/wordnik_api.png and /dev/null differ
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/index-ORIG-2.2.10.html b/example/application/helloworld/src/main/webapp/swagger-ui/index-ORIG-2.2.10.html
deleted file mode 100644
index f3b324b..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/index-ORIG-2.2.10.html
+++ /dev/null
@@ -1,126 +0,0 @@
-<!DOCTYPE html>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<html>
-<head>
- <meta charset="UTF-8">
- <meta http-equiv="x-ua-compatible" content="IE=edge">
- <title>Swagger UI</title>
- <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
- <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
- <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
- <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
-
- <script src='lib/object-assign-pollyfill.js' type='text/javascript'></script>
- <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
- <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
- <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
- <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
- <script src='lib/handlebars-4.0.5.js' type='text/javascript'></script>
- <script src='lib/lodash.min.js' type='text/javascript'></script>
- <script src='lib/backbone-min.js' type='text/javascript'></script>
- <script src='swagger-ui.js' type='text/javascript'></script>
- <script src='lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
- <script src='lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
- <script src='lib/jsoneditor.min.js' type='text/javascript'></script>
- <script src='lib/marked.js' type='text/javascript'></script>
- <script src='lib/swagger-oauth.js' type='text/javascript'></script>
-
- <!-- Some basic translations -->
- <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
- <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
- <!-- <script src='lang/en.js' type='text/javascript'></script> -->
-
- <script type="text/javascript">
- $(function () {
- var url = window.location.search.match(/url=([^&]+)/);
- if (url && url.length > 1) {
- url = decodeURIComponent(url[1]);
- } else {
- url = "http://petstore.swagger.io/v2/swagger.json";
- }
-
- hljs.configure({
- highlightSizeThreshold: 5000
- });
-
- // Pre load translate...
- if(window.SwaggerTranslator) {
- window.SwaggerTranslator.translate();
- }
- window.swaggerUi = new SwaggerUi({
- url: url,
- dom_id: "swagger-ui-container",
- supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
- onComplete: function(swaggerApi, swaggerUi){
- if(typeof initOAuth == "function") {
- initOAuth({
- clientId: "your-client-id",
- clientSecret: "your-client-secret-if-required",
- realm: "your-realms",
- appName: "your-app-name",
- scopeSeparator: " ",
- additionalQueryStringParams: {}
- });
- }
-
- if(window.SwaggerTranslator) {
- window.SwaggerTranslator.translate();
- }
- },
- onFailure: function(data) {
- log("Unable to Load SwaggerUI");
- },
- docExpansion: "none",
- jsonEditor: false,
- defaultModelRendering: 'schema',
- showRequestHeaders: false,
- showOperationIds: false
- });
-
- window.swaggerUi.load();
-
- function log() {
- if ('console' in window) {
- console.log.apply(console, arguments);
- }
- }
- });
- </script>
-</head>
-
-<body class="swagger-section">
-<div id='header'>
- <div class="swagger-ui-wrap">
- <a id="logo" href="http://swagger.io"><img class="logo__img" alt="swagger" height="30" width="30" src="images/logo_small.png" /><span class="logo__title">swagger</span></a>
- <form id='api_selector'>
- <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
- <div id='auth_container'></div>
- <div class='input'><a id="explore" class="header__btn" href="#" data-sw-translate>Explore</a></div>
- </form>
- </div>
-</div>
-
-<div id="message-bar" class="swagger-ui-wrap" data-sw-translate> </div>
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
-</body>
-</html>
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/index.html b/example/application/helloworld/src/main/webapp/swagger-ui/index.html
deleted file mode 100644
index bdc825f..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/index.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<!DOCTYPE html>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<html>
-<head>
- <meta charset="UTF-8">
- <meta http-equiv="x-ua-compatible" content="IE=edge">
- <title>Swagger UI</title>
- <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
- <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
- <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
- <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
- <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
-
- <script src='lib/object-assign-pollyfill.js' type='text/javascript'></script>
- <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
- <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
- <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
- <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
- <script src='lib/handlebars-4.0.5.js' type='text/javascript'></script>
- <script src='lib/lodash.min.js' type='text/javascript'></script>
- <script src='lib/backbone-min.js' type='text/javascript'></script>
- <script src='swagger-ui.js' type='text/javascript'></script>
- <script src='lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
- <script src='lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
- <script src='lib/jsoneditor.min.js' type='text/javascript'></script>
- <script src='lib/marked.js' type='text/javascript'></script>
- <script src='lib/swagger-oauth.js' type='text/javascript'></script>
-
- <!-- Some basic translations -->
- <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
- <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
- <!-- <script src='lang/en.js' type='text/javascript'></script> -->
-
- <script type="text/javascript">
- $(function () {
- var url = document.getElementById("input_baseUrl").selectedOptions[0].value;
-
- hljs.configure({
- highlightSizeThreshold: 5000
- });
-
- // Pre load translate...
- if(window.SwaggerTranslator) {
- window.SwaggerTranslator.translate();
- }
- window.swaggerUi = new SwaggerUi({
- url: url,
- dom_id: "swagger-ui-container",
- supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
- onComplete: function(swaggerApi, swaggerUi){
- if(typeof initOAuth == "function") {
- initOAuth({
- clientId: "your-client-id",
- clientSecret: "your-client-secret-if-required",
- realm: "your-realms",
- appName: "your-app-name",
- scopeSeparator: ",",
- additionalQueryStringParams: {}
- });
- }
-
- if(window.SwaggerTranslator) {
- window.SwaggerTranslator.translate();
- }
-
- addApiKeyAuthorization();
- },
- onFailure: function(data) {
- log("Unable to Load SwaggerUI");
- },
- docExpansion: "none",
- jsonEditor: false,
- defaultModelRendering: 'schema',
- showRequestHeaders: false,
- showOperationIds: false
- });
-
-
- // don't automatically load; let the developer change the user/password if required
- // window.swaggerUi.load();
-
- function log() {
- if ('console' in window) {
- console.log.apply(console, arguments);
- }
- }
-
- function addApiKeyAuthorization(){
- /*
- var key = encodeURIComponent($('#input_apiKey')[0].value);
- if(key && key.trim() != "") {
- var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
- window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
- log("added key " + key);
- }
- */
- var username = document.getElementById("input_user").value;
- var password = document.getElementById("input_pass").value;
- if(username && username.trim() != "" && password && password.trim() != "") {
- var auth = "Basic " + btoa(username + ":" + password);
- var swaggerUi = window.swaggerUi;
- window.swaggerUi.api.clientAuthorizations.add("key", new SwaggerClient.ApiKeyAuthorization("Authorization", auth, "header"));
- } else {
- window.swaggerUi.api.clientAuthorizations.remove("key");
- }
- }
-
- // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
- /*
- $('#input_apiKey').change(addApiKeyAuthorization);
- */
-
- /*
- var apiKey = "myApiKeyXXXX123456789";
- $('#input_apiKey').val(apiKey);
- */
- $('#input_user').val("sven");
- $('#input_pass').val("pass");
-
- });
- </script>
-</head>
-
-<body class="swagger-section">
-<div id='header'>
- <div class="swagger-ui-wrap">
- <a id="logo" href="http://swagger.io"><img class="logo__img" alt="swagger" height="30" width="30" src="images/logo_small.png" /><span class="logo__title">swagger</span></a>
- <form id='api_selector'>
- <div class='input'>
- <div class='input'><input placeholder="user" id="input_user" name="user" type="text" size="10"/></div>
- <div class='input'><input placeholder="pass" id="input_pass" name="pass" type="password" size="10"/></div>
-
- <select id="input_baseUrl" name="baseUrl" style="height: 26px;">
- <option id="private" label="private" value="../../restful/swagger/private"></option>
- <option id="public" label="public" value="../../restful/swagger/public"></option>
- <option id="prototyping" label="prototyping" value="../../restful/swagger/prototyping"></option>
- </select>
- </div>
- <div class='input' style="display:none;"><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
- <div class='input'><a id="explore" href="#" data-sw-translate>Reload</a></div>
- </form>
-
- </div>
-</div>
-
-<div id="message-bar" class="swagger-ui-wrap" data-sw-translate> </div>
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
-</body>
-</html>
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/ca.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/ca.js
deleted file mode 100644
index f8c815a..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/ca.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Advertència: Obsolet",
- "Implementation Notes":"Notes d'implementació",
- "Response Class":"Classe de la Resposta",
- "Status":"Estatus",
- "Parameters":"Paràmetres",
- "Parameter":"Paràmetre",
- "Value":"Valor",
- "Description":"Descripció",
- "Parameter Type":"Tipus del Paràmetre",
- "Data Type":"Tipus de la Dada",
- "Response Messages":"Missatges de la Resposta",
- "HTTP Status Code":"Codi d'Estatus HTTP",
- "Reason":"Raó",
- "Response Model":"Model de la Resposta",
- "Request URL":"URL de la Sol·licitud",
- "Response Body":"Cos de la Resposta",
- "Response Code":"Codi de la Resposta",
- "Response Headers":"Capçaleres de la Resposta",
- "Hide Response":"Amagar Resposta",
- "Try it out!":"Prova-ho!",
- "Show/Hide":"Mostrar/Amagar",
- "List Operations":"Llista Operacions",
- "Expand Operations":"Expandir Operacions",
- "Raw":"Cru",
- "can't parse JSON. Raw result":"no puc analitzar el JSON. Resultat cru",
- "Example Value":"Valor d'Exemple",
- "Model Schema":"Esquema del Model",
- "Model":"Model",
- "apply":"aplicar",
- "Username":"Nom d'usuari",
- "Password":"Contrasenya",
- "Terms of service":"Termes del servei",
- "Created by":"Creat per",
- "See more at":"Veure més en",
- "Contact the developer":"Contactar amb el desenvolupador",
- "api version":"versió de la api",
- "Response Content Type":"Tipus de Contingut de la Resposta",
- "fetching resource":"recollint recurs",
- "fetching resource list":"recollins llista de recursos",
- "Explore":"Explorant",
- "Show Swagger Petstore Example Apis":"Mostrar API d'Exemple Swagger Petstore",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"No es pot llegir del servidor. Potser no teniu la configuració de control d'accés apropiada.",
- "Please specify the protocol for":"Si us plau, especifiqueu el protocol per a",
- "Can't read swagger JSON from":"No es pot llegir el JSON de swagger des de",
- "Finished Loading Resource Information. Rendering Swagger UI":"Finalitzada la càrrega del recurs informatiu. Renderitzant Swagger UI",
- "Unable to read api":"No es pot llegir l'api",
- "from path":"des de la ruta",
- "server returned":"el servidor ha retornat"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/el.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/el.js
deleted file mode 100644
index fcd1ffd..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/el.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Προειδοποίηση: Έχει αποσυρθεί",
- "Implementation Notes":"Σημειώσεις Υλοποίησης",
- "Response Class":"Απόκριση",
- "Status":"Κατάσταση",
- "Parameters":"Παράμετροι",
- "Parameter":"Παράμετρος",
- "Value":"Τιμή",
- "Description":"Περιγραφή",
- "Parameter Type":"Τύπος Παραμέτρου",
- "Data Type":"Τύπος Δεδομένων",
- "Response Messages":"Μηνύματα Απόκρισης",
- "HTTP Status Code":"Κωδικός Κατάστασης HTTP",
- "Reason":"Αιτιολογία",
- "Response Model":"Μοντέλο Απόκρισης",
- "Request URL":"URL Αιτήματος",
- "Response Body":"Σώμα Απόκρισης",
- "Response Code":"Κωδικός Απόκρισης",
- "Response Headers":"Επικεφαλίδες Απόκρισης",
- "Hide Response":"Απόκρυψη Απόκρισης",
- "Headers":"Επικεφαλίδες",
- "Try it out!":"Δοκιμάστε το!",
- "Show/Hide":"Εμφάνιση/Απόκρυψη",
- "List Operations":"Λίστα Λειτουργιών",
- "Expand Operations":"Ανάπτυξη Λειτουργιών",
- "Raw":"Ακατέργαστο",
- "can't parse JSON. Raw result":"αδυναμία ανάλυσης JSON. Ακατέργαστο αποτέλεσμα",
- "Example Value":"Παράδειγμα Τιμής",
- "Model Schema":"Σχήμα Μοντέλου",
- "Model":"Μοντέλο",
- "Click to set as parameter value":"Πατήστε για να θέσετε τιμή παραμέτρου",
- "apply":"εφαρμογή",
- "Username":"Όνομα χρήση",
- "Password":"Κωδικός πρόσβασης",
- "Terms of service":"Όροι χρήσης",
- "Created by":"Δημιουργήθηκε από",
- "See more at":"Δείτε περισσότερα στο",
- "Contact the developer":"Επικοινωνήστε με τον προγραμματιστή",
- "api version":"έκδοση api",
- "Response Content Type":"Τύπος Περιεχομένου Απόκρισης",
- "Parameter content type:":"Τύπος περιεχομένου παραμέτρου:",
- "fetching resource":"παραλαβή πόρου",
- "fetching resource list":"παραλαβή λίστας πόρων",
- "Explore":"Εξερεύνηση",
- "Show Swagger Petstore Example Apis":"Εμφάνιση Api Δειγμάτων Petstore του Swagger",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"Αδυναμία ανάγνωσης από τον εξυπηρετητή. Μπορεί να μην έχει κατάλληλες ρυθμίσεις για access-control-origin.",
- "Please specify the protocol for":"Παρακαλώ προσδιορίστε το πρωτόκολλο για",
- "Can't read swagger JSON from":"Αδυναμία ανάγνωσης swagger JSON από",
- "Finished Loading Resource Information. Rendering Swagger UI":"Ολοκλήρωση Φόρτωσης Πληροφορικών Πόρου. Παρουσίαση Swagger UI",
- "Unable to read api":"Αδυναμία ανάγνωσης api",
- "from path":"από το μονοπάτι",
- "server returned":"ο εξυπηρετηρής επέστρεψε"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/en.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/en.js
deleted file mode 100644
index 9183136..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/en.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Warning: Deprecated",
- "Implementation Notes":"Implementation Notes",
- "Response Class":"Response Class",
- "Status":"Status",
- "Parameters":"Parameters",
- "Parameter":"Parameter",
- "Value":"Value",
- "Description":"Description",
- "Parameter Type":"Parameter Type",
- "Data Type":"Data Type",
- "Response Messages":"Response Messages",
- "HTTP Status Code":"HTTP Status Code",
- "Reason":"Reason",
- "Response Model":"Response Model",
- "Request URL":"Request URL",
- "Response Body":"Response Body",
- "Response Code":"Response Code",
- "Response Headers":"Response Headers",
- "Hide Response":"Hide Response",
- "Headers":"Headers",
- "Try it out!":"Try it out!",
- "Show/Hide":"Show/Hide",
- "List Operations":"List Operations",
- "Expand Operations":"Expand Operations",
- "Raw":"Raw",
- "can't parse JSON. Raw result":"can't parse JSON. Raw result",
- "Example Value":"Example Value",
- "Model Schema":"Model Schema",
- "Model":"Model",
- "Click to set as parameter value":"Click to set as parameter value",
- "apply":"apply",
- "Username":"Username",
- "Password":"Password",
- "Terms of service":"Terms of service",
- "Created by":"Created by",
- "See more at":"See more at",
- "Contact the developer":"Contact the developer",
- "api version":"api version",
- "Response Content Type":"Response Content Type",
- "Parameter content type:":"Parameter content type:",
- "fetching resource":"fetching resource",
- "fetching resource list":"fetching resource list",
- "Explore":"Explore",
- "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.",
- "Please specify the protocol for":"Please specify the protocol for",
- "Can't read swagger JSON from":"Can't read swagger JSON from",
- "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI",
- "Unable to read api":"Unable to read api",
- "from path":"from path",
- "server returned":"server returned"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/es.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/es.js
deleted file mode 100644
index 13fa015..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/es.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Advertencia: Obsoleto",
- "Implementation Notes":"Notas de implementación",
- "Response Class":"Clase de la Respuesta",
- "Status":"Status",
- "Parameters":"Parámetros",
- "Parameter":"Parámetro",
- "Value":"Valor",
- "Description":"Descripción",
- "Parameter Type":"Tipo del Parámetro",
- "Data Type":"Tipo del Dato",
- "Response Messages":"Mensajes de la Respuesta",
- "HTTP Status Code":"Código de Status HTTP",
- "Reason":"Razón",
- "Response Model":"Modelo de la Respuesta",
- "Request URL":"URL de la Solicitud",
- "Response Body":"Cuerpo de la Respuesta",
- "Response Code":"Código de la Respuesta",
- "Response Headers":"Encabezados de la Respuesta",
- "Hide Response":"Ocultar Respuesta",
- "Try it out!":"Pruébalo!",
- "Show/Hide":"Mostrar/Ocultar",
- "List Operations":"Listar Operaciones",
- "Expand Operations":"Expandir Operaciones",
- "Raw":"Crudo",
- "can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo",
- "Example Value":"Valor de Ejemplo",
- "Model Schema":"Esquema del Modelo",
- "Model":"Modelo",
- "apply":"aplicar",
- "Username":"Nombre de usuario",
- "Password":"Contraseña",
- "Terms of service":"Términos de Servicio",
- "Created by":"Creado por",
- "See more at":"Ver más en",
- "Contact the developer":"Contactar al desarrollador",
- "api version":"versión de la api",
- "Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta",
- "fetching resource":"buscando recurso",
- "fetching resource list":"buscando lista del recurso",
- "Explore":"Explorar",
- "Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.",
- "Please specify the protocol for":"Por favor, especificar el protocola para",
- "Can't read swagger JSON from":"No se puede leer el JSON de swagger desde",
- "Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI",
- "Unable to read api":"No se puede leer la api",
- "from path":"desde ruta",
- "server returned":"el servidor retornó"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/fr.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/fr.js
deleted file mode 100644
index 388dff1..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/fr.js
+++ /dev/null
@@ -1,54 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Avertissement : Obsolète",
- "Implementation Notes":"Notes d'implémentation",
- "Response Class":"Classe de la réponse",
- "Status":"Statut",
- "Parameters":"Paramètres",
- "Parameter":"Paramètre",
- "Value":"Valeur",
- "Description":"Description",
- "Parameter Type":"Type du paramètre",
- "Data Type":"Type de données",
- "Response Messages":"Messages de la réponse",
- "HTTP Status Code":"Code de statut HTTP",
- "Reason":"Raison",
- "Response Model":"Modèle de réponse",
- "Request URL":"URL appelée",
- "Response Body":"Corps de la réponse",
- "Response Code":"Code de la réponse",
- "Response Headers":"En-têtes de la réponse",
- "Hide Response":"Cacher la réponse",
- "Headers":"En-têtes",
- "Try it out!":"Testez !",
- "Show/Hide":"Afficher/Masquer",
- "List Operations":"Liste des opérations",
- "Expand Operations":"Développer les opérations",
- "Raw":"Brut",
- "can't parse JSON. Raw result":"impossible de décoder le JSON. Résultat brut",
- "Example Value":"Exemple la valeur",
- "Model Schema":"Définition du modèle",
- "Model":"Modèle",
- "apply":"appliquer",
- "Username":"Nom d'utilisateur",
- "Password":"Mot de passe",
- "Terms of service":"Conditions de service",
- "Created by":"Créé par",
- "See more at":"Voir plus sur",
- "Contact the developer":"Contacter le développeur",
- "api version":"version de l'api",
- "Response Content Type":"Content Type de la réponse",
- "fetching resource":"récupération de la ressource",
- "fetching resource list":"récupération de la liste de ressources",
- "Explore":"Explorer",
- "Show Swagger Petstore Example Apis":"Montrer les Apis de l'exemple Petstore de Swagger",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"Impossible de lire à partir du serveur. Il se peut que les réglages access-control-origin ne soient pas appropriés.",
- "Please specify the protocol for":"Veuillez spécifier un protocole pour",
- "Can't read swagger JSON from":"Impossible de lire le JSON swagger à partir de",
- "Finished Loading Resource Information. Rendering Swagger UI":"Chargement des informations terminé. Affichage de Swagger UI",
- "Unable to read api":"Impossible de lire l'api",
- "from path":"à partir du chemin",
- "server returned":"réponse du serveur"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/geo.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/geo.js
deleted file mode 100644
index 609c20d..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/geo.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"ყურადღება: აღარ გამოიყენება",
- "Implementation Notes":"იმპლემენტაციის აღწერა",
- "Response Class":"რესპონს კლასი",
- "Status":"სტატუსი",
- "Parameters":"პარამეტრები",
- "Parameter":"პარამეტრი",
- "Value":"მნიშვნელობა",
- "Description":"აღწერა",
- "Parameter Type":"პარამეტრის ტიპი",
- "Data Type":"მონაცემის ტიპი",
- "Response Messages":"პასუხი",
- "HTTP Status Code":"HTTP სტატუსი",
- "Reason":"მიზეზი",
- "Response Model":"რესპონს მოდელი",
- "Request URL":"მოთხოვნის URL",
- "Response Body":"პასუხის სხეული",
- "Response Code":"პასუხის კოდი",
- "Response Headers":"პასუხის ჰედერები",
- "Hide Response":"დამალე პასუხი",
- "Headers":"ჰედერები",
- "Try it out!":"ცადე !",
- "Show/Hide":"გამოჩენა/დამალვა",
- "List Operations":"ოპერაციების სია",
- "Expand Operations":"ოპერაციები ვრცლად",
- "Raw":"ნედლი",
- "can't parse JSON. Raw result":"JSON-ის დამუშავება ვერ მოხერხდა. ნედლი პასუხი",
- "Example Value":"მაგალითი",
- "Model Schema":"მოდელის სტრუქტურა",
- "Model":"მოდელი",
- "Click to set as parameter value":"პარამეტრისთვის მნიშვნელობის მისანიჭებლად, დააკლიკე",
- "apply":"გამოყენება",
- "Username":"მოხმარებელი",
- "Password":"პაროლი",
- "Terms of service":"მომსახურების პირობები",
- "Created by":"შექმნა",
- "See more at":"ნახე ვრცლად",
- "Contact the developer":"დაუკავშირდი დეველოპერს",
- "api version":"api ვერსია",
- "Response Content Type":"პასუხის კონტენტის ტიპი",
- "Parameter content type:":"პარამეტრის კონტენტის ტიპი:",
- "fetching resource":"რესურსების მიღება",
- "fetching resource list":"რესურსების სიის მიღება",
- "Explore":"ნახვა",
- "Show Swagger Petstore Example Apis":"ნახე Swagger Petstore სამაგალითო Api",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"სერვერთან დაკავშირება ვერ ხერხდება. შეამოწმეთ access-control-origin.",
- "Please specify the protocol for":"მიუთითეთ პროტოკოლი",
- "Can't read swagger JSON from":"swagger JSON წაკითხვა ვერ მოხერხდა",
- "Finished Loading Resource Information. Rendering Swagger UI":"რესურსების ჩატვირთვა სრულდება. Swagger UI რენდერდება",
- "Unable to read api":"api წაკითხვა ვერ მოხერხდა",
- "from path":"მისამართიდან",
- "server returned":"სერვერმა დააბრუნა"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/it.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/it.js
deleted file mode 100644
index 8529c2a..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/it.js
+++ /dev/null
@@ -1,52 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Attenzione: Deprecato",
- "Implementation Notes":"Note di implementazione",
- "Response Class":"Classe della risposta",
- "Status":"Stato",
- "Parameters":"Parametri",
- "Parameter":"Parametro",
- "Value":"Valore",
- "Description":"Descrizione",
- "Parameter Type":"Tipo di parametro",
- "Data Type":"Tipo di dato",
- "Response Messages":"Messaggi della risposta",
- "HTTP Status Code":"Codice stato HTTP",
- "Reason":"Motivo",
- "Response Model":"Modello di risposta",
- "Request URL":"URL della richiesta",
- "Response Body":"Corpo della risposta",
- "Response Code":"Oggetto della risposta",
- "Response Headers":"Intestazioni della risposta",
- "Hide Response":"Nascondi risposta",
- "Try it out!":"Provalo!",
- "Show/Hide":"Mostra/Nascondi",
- "List Operations":"Mostra operazioni",
- "Expand Operations":"Espandi operazioni",
- "Raw":"Grezzo (raw)",
- "can't parse JSON. Raw result":"non è possibile parsare il JSON. Risultato grezzo (raw).",
- "Model Schema":"Schema del modello",
- "Model":"Modello",
- "apply":"applica",
- "Username":"Nome utente",
- "Password":"Password",
- "Terms of service":"Condizioni del servizio",
- "Created by":"Creato da",
- "See more at":"Informazioni aggiuntive:",
- "Contact the developer":"Contatta lo sviluppatore",
- "api version":"versione api",
- "Response Content Type":"Tipo di contenuto (content type) della risposta",
- "fetching resource":"recuperando la risorsa",
- "fetching resource list":"recuperando lista risorse",
- "Explore":"Esplora",
- "Show Swagger Petstore Example Apis":"Mostra le api di esempio di Swagger Petstore",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"Non è possibile leggere dal server. Potrebbe non avere le impostazioni di controllo accesso origine (access-control-origin) appropriate.",
- "Please specify the protocol for":"Si prega di specificare il protocollo per",
- "Can't read swagger JSON from":"Impossibile leggere JSON swagger da:",
- "Finished Loading Resource Information. Rendering Swagger UI":"Lettura informazioni risorse termianta. Swagger UI viene mostrata",
- "Unable to read api":"Impossibile leggere la api",
- "from path":"da cartella",
- "server returned":"il server ha restituito"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/ja.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/ja.js
deleted file mode 100644
index 1cbeb37..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/ja.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"警告: 廃止予定",
- "Implementation Notes":"実装メモ",
- "Response Class":"レスポンスクラス",
- "Status":"ステータス",
- "Parameters":"パラメータ群",
- "Parameter":"パラメータ",
- "Value":"値",
- "Description":"説明",
- "Parameter Type":"パラメータタイプ",
- "Data Type":"データタイプ",
- "Response Messages":"レスポンスメッセージ",
- "HTTP Status Code":"HTTPステータスコード",
- "Reason":"理由",
- "Response Model":"レスポンスモデル",
- "Request URL":"リクエストURL",
- "Response Body":"レスポンスボディ",
- "Response Code":"レスポンスコード",
- "Response Headers":"レスポンスヘッダ",
- "Hide Response":"レスポンスを隠す",
- "Headers":"ヘッダ",
- "Try it out!":"実際に実行!",
- "Show/Hide":"表示/非表示",
- "List Operations":"操作一覧",
- "Expand Operations":"操作の展開",
- "Raw":"未加工",
- "can't parse JSON. Raw result":"JSONへ解釈できません. 未加工の結果",
- "Example Value":"値の例",
- "Model Schema":"モデルスキーマ",
- "Model":"モデル",
- "Click to set as parameter value":"パラメータ値と設定するにはクリック",
- "apply":"実行",
- "Username":"ユーザ名",
- "Password":"パスワード",
- "Terms of service":"サービス利用規約",
- "Created by":"Created by",
- "See more at":"詳細を見る",
- "Contact the developer":"開発者に連絡",
- "api version":"APIバージョン",
- "Response Content Type":"レスポンス コンテンツタイプ",
- "Parameter content type:":"パラメータコンテンツタイプ:",
- "fetching resource":"リソースの取得",
- "fetching resource list":"リソース一覧の取得",
- "Explore":"調査",
- "Show Swagger Petstore Example Apis":"SwaggerペットストアAPIの表示",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"サーバから読み込めません. 適切なaccess-control-origin設定を持っていない可能性があります.",
- "Please specify the protocol for":"プロトコルを指定してください",
- "Can't read swagger JSON from":"次からswagger JSONを読み込めません",
- "Finished Loading Resource Information. Rendering Swagger UI":"リソース情報の読み込みが完了しました. Swagger UIを描画しています",
- "Unable to read api":"APIを読み込めません",
- "from path":"次のパスから",
- "server returned":"サーバからの返答"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/ko-kr.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/ko-kr.js
deleted file mode 100644
index 03c7626..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/ko-kr.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"경고:폐기예정됨",
- "Implementation Notes":"구현 노트",
- "Response Class":"응답 클래스",
- "Status":"상태",
- "Parameters":"매개변수들",
- "Parameter":"매개변수",
- "Value":"값",
- "Description":"설명",
- "Parameter Type":"매개변수 타입",
- "Data Type":"데이터 타입",
- "Response Messages":"응답 메세지",
- "HTTP Status Code":"HTTP 상태 코드",
- "Reason":"원인",
- "Response Model":"응답 모델",
- "Request URL":"요청 URL",
- "Response Body":"응답 본문",
- "Response Code":"응답 코드",
- "Response Headers":"응답 헤더",
- "Hide Response":"응답 숨기기",
- "Headers":"헤더",
- "Try it out!":"써보기!",
- "Show/Hide":"보이기/숨기기",
- "List Operations":"목록 작업",
- "Expand Operations":"전개 작업",
- "Raw":"원본",
- "can't parse JSON. Raw result":"JSON을 파싱할수 없음. 원본결과:",
- "Model Schema":"모델 스키마",
- "Model":"모델",
- "apply":"적용",
- "Username":"사용자 이름",
- "Password":"암호",
- "Terms of service":"이용약관",
- "Created by":"작성자",
- "See more at":"추가정보:",
- "Contact the developer":"개발자에게 문의",
- "api version":"api버전",
- "Response Content Type":"응답Content Type",
- "fetching resource":"리소스 가져오기",
- "fetching resource list":"리소스 목록 가져오기",
- "Explore":"탐색",
- "Show Swagger Petstore Example Apis":"Swagger Petstore 예제 보기",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"서버로부터 읽어들일수 없습니다. access-control-origin 설정이 올바르지 않을수 있습니다.",
- "Please specify the protocol for":"다음을 위한 프로토콜을 정하세요",
- "Can't read swagger JSON from":"swagger JSON 을 다음으로 부터 읽을수 없습니다",
- "Finished Loading Resource Information. Rendering Swagger UI":"리소스 정보 불러오기 완료. Swagger UI 랜더링",
- "Unable to read api":"api를 읽을 수 없습니다.",
- "from path":"다음 경로로 부터",
- "server returned":"서버 응답함."
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/pl.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/pl.js
deleted file mode 100644
index ce41e91..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/pl.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Uwaga: Wycofane",
- "Implementation Notes":"Uwagi Implementacji",
- "Response Class":"Klasa Odpowiedzi",
- "Status":"Status",
- "Parameters":"Parametry",
- "Parameter":"Parametr",
- "Value":"Wartość",
- "Description":"Opis",
- "Parameter Type":"Typ Parametru",
- "Data Type":"Typ Danych",
- "Response Messages":"Wiadomości Odpowiedzi",
- "HTTP Status Code":"Kod Statusu HTTP",
- "Reason":"Przyczyna",
- "Response Model":"Model Odpowiedzi",
- "Request URL":"URL Wywołania",
- "Response Body":"Treść Odpowiedzi",
- "Response Code":"Kod Odpowiedzi",
- "Response Headers":"Nagłówki Odpowiedzi",
- "Hide Response":"Ukryj Odpowiedź",
- "Headers":"Nagłówki",
- "Try it out!":"Wypróbuj!",
- "Show/Hide":"Pokaż/Ukryj",
- "List Operations":"Lista Operacji",
- "Expand Operations":"Rozwiń Operacje",
- "Raw":"Nieprzetworzone",
- "can't parse JSON. Raw result":"nie można przetworzyć pliku JSON. Nieprzetworzone dane",
- "Model Schema":"Schemat Modelu",
- "Model":"Model",
- "apply":"użyj",
- "Username":"Nazwa użytkownika",
- "Password":"Hasło",
- "Terms of service":"Warunki używania",
- "Created by":"Utworzone przez",
- "See more at":"Zobacz więcej na",
- "Contact the developer":"Kontakt z deweloperem",
- "api version":"wersja api",
- "Response Content Type":"Typ Zasobu Odpowiedzi",
- "fetching resource":"ładowanie zasobu",
- "fetching resource list":"ładowanie listy zasobów",
- "Explore":"Eksploruj",
- "Show Swagger Petstore Example Apis":"Pokaż Przykładowe Api Swagger Petstore",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"Brak połączenia z serwerem. Może on nie mieć odpowiednich ustawień access-control-origin.",
- "Please specify the protocol for":"Proszę podać protokół dla",
- "Can't read swagger JSON from":"Nie można odczytać swagger JSON z",
- "Finished Loading Resource Information. Rendering Swagger UI":"Ukończono Ładowanie Informacji o Zasobie. Renderowanie Swagger UI",
- "Unable to read api":"Nie można odczytać api",
- "from path":"ze ścieżki",
- "server returned":"serwer zwrócił"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/pt.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/pt.js
deleted file mode 100644
index f2e7c13..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/pt.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Aviso: Depreciado",
- "Implementation Notes":"Notas de Implementação",
- "Response Class":"Classe de resposta",
- "Status":"Status",
- "Parameters":"Parâmetros",
- "Parameter":"Parâmetro",
- "Value":"Valor",
- "Description":"Descrição",
- "Parameter Type":"Tipo de parâmetro",
- "Data Type":"Tipo de dados",
- "Response Messages":"Mensagens de resposta",
- "HTTP Status Code":"Código de status HTTP",
- "Reason":"Razão",
- "Response Model":"Modelo resposta",
- "Request URL":"URL requisição",
- "Response Body":"Corpo da resposta",
- "Response Code":"Código da resposta",
- "Response Headers":"Cabeçalho da resposta",
- "Headers":"Cabeçalhos",
- "Hide Response":"Esconder resposta",
- "Try it out!":"Tente agora!",
- "Show/Hide":"Mostrar/Esconder",
- "List Operations":"Listar operações",
- "Expand Operations":"Expandir operações",
- "Raw":"Cru",
- "can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru",
- "Model Schema":"Modelo esquema",
- "Model":"Modelo",
- "apply":"Aplicar",
- "Username":"Usuário",
- "Password":"Senha",
- "Terms of service":"Termos do serviço",
- "Created by":"Criado por",
- "See more at":"Veja mais em",
- "Contact the developer":"Contate o desenvolvedor",
- "api version":"Versão api",
- "Response Content Type":"Tipo de conteúdo da resposta",
- "fetching resource":"busca recurso",
- "fetching resource list":"buscando lista de recursos",
- "Explore":"Explorar",
- "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin",
- "Please specify the protocol for":"Por favor especifique o protocolo",
- "Can't read swagger JSON from":"Não é possível ler o JSON Swagger de",
- "Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI",
- "Unable to read api":"Não foi possível ler api",
- "from path":"do caminho",
- "server returned":"servidor retornou"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/ru.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/ru.js
deleted file mode 100644
index 592744e..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/ru.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Предупреждение: Устарело",
- "Implementation Notes":"Заметки",
- "Response Class":"Пример ответа",
- "Status":"Статус",
- "Parameters":"Параметры",
- "Parameter":"Параметр",
- "Value":"Значение",
- "Description":"Описание",
- "Parameter Type":"Тип параметра",
- "Data Type":"Тип данных",
- "HTTP Status Code":"HTTP код",
- "Reason":"Причина",
- "Response Model":"Структура ответа",
- "Request URL":"URL запроса",
- "Response Body":"Тело ответа",
- "Response Code":"HTTP код ответа",
- "Response Headers":"Заголовки ответа",
- "Hide Response":"Спрятать ответ",
- "Headers":"Заголовки",
- "Response Messages":"Что может прийти в ответ",
- "Try it out!":"Попробовать!",
- "Show/Hide":"Показать/Скрыть",
- "List Operations":"Операции кратко",
- "Expand Operations":"Операции подробно",
- "Raw":"В сыром виде",
- "can't parse JSON. Raw result":"Не удается распарсить ответ:",
- "Example Value":"Пример",
- "Model Schema":"Структура",
- "Model":"Описание",
- "Click to set as parameter value":"Нажмите, чтобы испльзовать в качестве значения параметра",
- "apply":"применить",
- "Username":"Имя пользователя",
- "Password":"Пароль",
- "Terms of service":"Условия использования",
- "Created by":"Разработано",
- "See more at":"Еще тут",
- "Contact the developer":"Связаться с разработчиком",
- "api version":"Версия API",
- "Response Content Type":"Content Type ответа",
- "Parameter content type:":"Content Type параметра:",
- "fetching resource":"Получение ресурса",
- "fetching resource list":"Получение ресурсов",
- "Explore":"Показать",
- "Show Swagger Petstore Example Apis":"Показать примеры АПИ",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, проблема с настройками доступа",
- "Please specify the protocol for":"Пожалуйста, укажите протокол для",
- "Can't read swagger JSON from":"Не получается прочитать swagger json из",
- "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
- "Unable to read api":"Не удалось прочитать api",
- "from path":"по адресу",
- "server returned":"сервер сказал"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/tr.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/tr.js
deleted file mode 100644
index 16426a9..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/tr.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"Uyarı: Deprecated",
- "Implementation Notes":"Gerçekleştirim Notları",
- "Response Class":"Dönen Sınıf",
- "Status":"Statü",
- "Parameters":"Parametreler",
- "Parameter":"Parametre",
- "Value":"Değer",
- "Description":"Açıklama",
- "Parameter Type":"Parametre Tipi",
- "Data Type":"Veri Tipi",
- "Response Messages":"Dönüş Mesajı",
- "HTTP Status Code":"HTTP Statü Kodu",
- "Reason":"Gerekçe",
- "Response Model":"Dönüş Modeli",
- "Request URL":"İstek URL",
- "Response Body":"Dönüş İçeriği",
- "Response Code":"Dönüş Kodu",
- "Response Headers":"Dönüş Üst Bilgileri",
- "Hide Response":"Dönüşü Gizle",
- "Headers":"Üst Bilgiler",
- "Try it out!":"Dene!",
- "Show/Hide":"Göster/Gizle",
- "List Operations":"Operasyonları Listele",
- "Expand Operations":"Operasyonları Aç",
- "Raw":"Ham",
- "can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç",
- "Model Schema":"Model Şema",
- "Model":"Model",
- "apply":"uygula",
- "Username":"Kullanıcı Adı",
- "Password":"Parola",
- "Terms of service":"Servis şartları",
- "Created by":"Oluşturan",
- "See more at":"Daha fazlası için",
- "Contact the developer":"Geliştirici ile İletişime Geçin",
- "api version":"api versiyon",
- "Response Content Type":"Dönüş İçerik Tipi",
- "fetching resource":"kaynak getiriliyor",
- "fetching resource list":"kaynak listesi getiriliyor",
- "Explore":"Keşfet",
- "Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.",
- "Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz",
- "Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor",
- "Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor",
- "Unable to read api":"api okunamadı",
- "from path":"yoldan",
- "server returned":"sunucuya dönüldü"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/translator.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/translator.js
deleted file mode 100644
index ffb879f..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/translator.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-/**
- * Translator for documentation pages.
- *
- * To enable translation you should include one of language-files in your index.html
- * after <script src='lang/translator.js' type='text/javascript'></script>.
- * For example - <script src='lang/ru.js' type='text/javascript'></script>
- *
- * If you wish to translate some new texts you should do two things:
- * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
- * 2. Mark that text it templates this way <anyHtmlTag data-sw-translate>New Phrase</anyHtmlTag> or <anyHtmlTag data-sw-translate value='New Phrase'/>.
- * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate.
- *
- */
-window.SwaggerTranslator = {
-
- _words:[],
-
- translate: function(sel) {
- var $this = this;
- sel = sel || '[data-sw-translate]';
-
- $(sel).each(function() {
- $(this).html($this._tryTranslate($(this).html()));
-
- $(this).val($this._tryTranslate($(this).val()));
- $(this).attr('title', $this._tryTranslate($(this).attr('title')));
- });
- },
-
- _tryTranslate: function(word) {
- return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
- },
-
- learn: function(wordsMap) {
- this._words = wordsMap;
- }
-};
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lang/zh-cn.js b/example/application/helloworld/src/main/webapp/swagger-ui/lang/zh-cn.js
deleted file mode 100644
index 3af61ad..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lang/zh-cn.js
+++ /dev/null
@@ -1,56 +0,0 @@
-'use strict';
-
-/* jshint quotmark: double */
-window.SwaggerTranslator.learn({
- "Warning: Deprecated":"警告:已过时",
- "Implementation Notes":"实现备注",
- "Response Class":"响应类",
- "Status":"状态",
- "Parameters":"参数",
- "Parameter":"参数",
- "Value":"值",
- "Description":"描述",
- "Parameter Type":"参数类型",
- "Data Type":"数据类型",
- "Response Messages":"响应消息",
- "HTTP Status Code":"HTTP状态码",
- "Reason":"原因",
- "Response Model":"响应模型",
- "Request URL":"请求URL",
- "Response Body":"响应体",
- "Response Code":"响应码",
- "Response Headers":"响应头",
- "Hide Response":"隐藏响应",
- "Headers":"头",
- "Try it out!":"试一下!",
- "Show/Hide":"显示/隐藏",
- "List Operations":"显示操作",
- "Expand Operations":"展开操作",
- "Raw":"原始",
- "can't parse JSON. Raw result":"无法解析JSON. 原始结果",
- "Example Value":"示例",
- "Click to set as parameter value":"点击设置参数",
- "Model Schema":"模型架构",
- "Model":"模型",
- "apply":"应用",
- "Username":"用户名",
- "Password":"密码",
- "Terms of service":"服务条款",
- "Created by":"创建者",
- "See more at":"查看更多:",
- "Contact the developer":"联系开发者",
- "api version":"api版本",
- "Response Content Type":"响应Content Type",
- "Parameter content type:":"参数类型:",
- "fetching resource":"正在获取资源",
- "fetching resource list":"正在获取资源列表",
- "Explore":"浏览",
- "Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis",
- "Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从服务器读取。可能没有正确设置access-control-origin。",
- "Please specify the protocol for":"请指定协议:",
- "Can't read swagger JSON from":"无法读取swagger JSON于",
- "Finished Loading Resource Information. Rendering Swagger UI":"已加载资源信息。正在渲染Swagger UI",
- "Unable to read api":"无法读取api",
- "from path":"从路径",
- "server returned":"服务器返回"
-});
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/backbone-min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/backbone-min.js
deleted file mode 100644
index 8eff02e..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/backbone-min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(t,e){if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(i,n,s){t.Backbone=e(t,s,i,n)});else if("undefined"!=typeof exports){var i=require("underscore");e(t,exports,i)}else t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}(this,function(t,e,i,n){var s=t.Backbone,r=[],a=(r.push,r.slice);r.splice;e.VERSION="1.1.2",e.$=n,e.noConflict=function(){return t.Backbone=s,this},e.emulateHTTP=!1,e.emulateJSON=!1;var o=e.Events={on:function(t,e,i [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/es5-shim.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/es5-shim.js
deleted file mode 100644
index 4c0fcab..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/es5-shim.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(t,e){"use strict";"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():t.returnExports=e()}(this,function(){var t,e,r=Array,n=r.prototype,o=Object,i=o.prototype,a=Function,u=a.prototype,f=String,s=f.prototype,l=Number,c=l.prototype,h=n.slice,p=n.splice,y=n.push,d=n.unshift,g=n.concat,v=n.join,b=u.call,w=u.apply,T=Math.max,m=Math.min,D=i.toString,x="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,S=Function.prototype.toString, [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/handlebars-4.0.5.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/handlebars-4.0.5.js
deleted file mode 100644
index 57025bc..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/handlebars-4.0.5.js
+++ /dev/null
@@ -1,3 +0,0 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Handlebars=e():t.Handlebars=e()}(this,function(){return function(t){function e(s){if(r[s])return r[s].exports;var i=r[s]={exports:{},id:s,loaded:!1};return t[s].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function s(){var t=v();return t.compile= [...]
-48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,139]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function(t,e){throw new Error(t)},parse:function(t) [...]
-s.push(i),this.push(this.source.functionCall("container.invokePartial","",s))},assignToHash:function(t){var e=this.popStack(),r=void 0,s=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(s=this.popStack(),r=this.popStack());var a=this.hash;r&&(a.contexts[t]=r),s&&(a.types[t]=s),i&&(a.ids[t]=i),a.values[t]=e},pushId:function(t,e,r){"BlockParam"===t?this.pushStackLiteral("blockParams["+e[0]+"].path["+e[1]+"]"+(r?" + "+JSON.stringify("."+r):"")):"PathExpression"===t?thi [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/highlight.9.1.0.pack.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/highlight.9.1.0.pack.js
deleted file mode 100644
index 7b00c68..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/highlight.9.1.0.pack.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){"undefined"!=typeof exports?e(exports):(self.hljs=e({}),"function"==typeof define&&define.amd&&define("hljs",[],function(){return self.hljs}))}(function(e){function r(e){return e.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function t(e){return e.nodeName.toLowerCase()}function n(e,r){var t=e&&e.exec(r);return t&&0==t.index}function a(e){return/^(no-?highlight|plain|text)$/i.test(e)}function c(e){var r,t,n,c=e.className+" ";if(c+=e.parentNode?e.parentNo [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/highlight.9.1.0.pack_extended.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/highlight.9.1.0.pack_extended.js
deleted file mode 100644
index 162a224..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/highlight.9.1.0.pack_extended.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";!function(){var h,l;h=hljs.configure,hljs.configure=function(l){var i=l.highlightSizeThreshold;hljs.highlightSizeThreshold=i===+i?i:null,h.call(this,l)},l=hljs.highlightBlock,hljs.highlightBlock=function(h){var i=h.innerHTML,g=hljs.highlightSizeThreshold;(null==g||g>i.length)&&l.call(hljs,h)}}();
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery-1.8.0.min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery-1.8.0.min.js
deleted file mode 100644
index e2e2b7f..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery-1.8.0.min.js
+++ /dev/null
@@ -1,3 +0,0 @@
-!function(e,t){function n(e){var t=he[e]={};return K.each(e.split(te),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(me,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r||"false"!==r&&("null"===r?null:+r+""===r?+r:ge.test(r)?K.parseJSON(r):r)}catch(o){}K.data(e,n,r)}else r=t}return r}function i(e){var t;for(t in e)if(("data"!==t||!K.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function o(){return!1}func [...]
-n}})}),K.attrHooks.contenteditable={get:ye.get,set:function(e,t,n){""===t&&(t="false"),ye.set(e,t,n)}}),K.support.hrefNormalized||K.each(["href","src","width","height"],function(e,n){K.attrHooks[n]=K.extend(K.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null===r?t:r}})}),K.support.style||(K.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=""+t}}),K.support.optSelected||(K.propHooks.selected=K.extend(K.pro [...]
-Ze.optgroup=Ze.option,Ze.tbody=Ze.tfoot=Ze.colgroup=Ze.caption=Ze.thead,Ze.th=Ze.td,K.support.htmlSerialize||(Ze._default=[1,"X<div>","</div>"]),K.fn.extend({text:function(e){return K.access(this,function(e){return e===t?K.text(this):this.empty().append((this[0]&&this[0].ownerDocument||R).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(K.isFunction(e))return this.each(function(t){K(this).wrapAll(e.call(this,t))});if(this[0]){var t=K(e,this[0].ownerDocument).eq(0).clo [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.ba-bbq.min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.ba-bbq.min.js
deleted file mode 100644
index 78d1ff5..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.ba-bbq.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e,t){function n(e){return"string"==typeof e}function r(e){var t=g.call(arguments,1);return function(){return e.apply(this,t.concat(g.call(arguments)))}}function o(e){return e.replace(/^[^#]*#?(.*)$/,"$1")}function a(e){return e.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function i(r,o,a,i,c){var u,s,p,h,d;return i!==f?(p=a.match(r?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/),d=p[3]||"",2===c&&n(i)?s=i.replace(r?R:E,""):(h=l(p[2]),i=n(i)?l[r?A:w](i):i,s=2===c?i:1===c?e.extend [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.slideto.min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.slideto.min.js
deleted file mode 100644
index b15997b..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.slideto.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(i){i.fn.slideto=function(o){return o=i.extend({slide_duration:"slow",highlight_duration:3e3,highlight:!0,highlight_color:"#FFFF99"},o),this.each(function(){obj=i(this),i("body").animate({scrollTop:obj.offset().top},o.slide_duration,function(){o.highlight&&i.ui.version&&obj.effect("highlight",{color:o.highlight_color},o.highlight_duration)})})}}(jQuery);
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.wiggle.min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.wiggle.min.js
deleted file mode 100644
index 6b4e261..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jquery.wiggle.min.js
+++ /dev/null
@@ -1 +0,0 @@
-jQuery.fn.wiggle=function(e){var a={speed:50,wiggles:3,travel:5,callback:null},e=jQuery.extend(a,e);return this.each(function(){var a=this,l=(jQuery(this).wrap('<div class="wiggle-wrap"></div>').css("position","relative"),0);for(i=1;i<=e.wiggles;i++)jQuery(this).animate({left:"-="+e.travel},e.speed).animate({left:"+="+2*e.travel},2*e.speed).animate({left:"-="+e.travel},e.speed,function(){l++,jQuery(a).parent().hasClass("wiggle-wrap")&&jQuery(a).parent().replaceWith(a),l==e.wiggles&&jQuer [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/js-yaml.min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/js-yaml.min.js
deleted file mode 100644
index 2514a41..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/js-yaml.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.jsyaml=t()}}(function(){var t;return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");thro [...]
-predicate:a,represent:o})},{"../type":13,buffer:30}],15:[function(t,e,n){"use strict";function i(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)}function r(t){return"true"===t||"True"===t||"TRUE"===t}function o(t){return"[object Boolean]"===Object.prototype.toString.call(t)}var a=t("../type");e.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:r,predicate:o,represent:{lowerca [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jsoneditor.min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/jsoneditor.min.js
deleted file mode 100644
index 21db1ab..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/jsoneditor.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-!function(){var t;!function(){var e=!1,i=/xyz/.test(function(){window.postMessage("xyz")})?/\b_super\b/:/.*/;return t=function(){},t.extend=function(t){function s(){!e&&this.init&&this.init.apply(this,arguments)}var r=this.prototype;e=!0;var n=new this;e=!1;for(var o in t)n[o]="function"==typeof t[o]&&"function"==typeof r[o]&&i.test(t[o])?function(t,e){return function(){var i=this._super;this._super=r[t];var s=e.apply(this,arguments);return this._super=i,s}}(o,t[o]):t[o];return s.prototy [...]
-var s=this.input_type;("cpp"===s||"c++"===s||"c"===s)&&(s="c_cpp"),this.ace_container=document.createElement("div"),this.ace_container.style.width="100%",this.ace_container.style.position="relative",this.ace_container.style.height="400px",this.input.parentNode.insertBefore(this.ace_container,this.input),this.input.style.display="none",this.ace_editor=window.ace.edit(this.ace_container),this.ace_editor.setValue(this.getValue()),n.plugins.ace.theme&&this.ace_editor.setTheme("ace/theme/"+n. [...]
-this.delete_last_row_button.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();var i=t.getValue(),s=null;t.rows.length>1&&t.rows[t.rows.length-1].tab===t.active_tab&&(s=t.rows[t.rows.length-2].tab),i.pop(),t.setValue(i),s&&(t.active_tab=s,t.refreshTabs()),t.onChange(!0)}),t.controls.appendChild(this.delete_last_row_button),this.remove_all_rows_button=this.getButton("All","delete","Delete All"),this.remove_all_rows_button.addEventListener("click",function(e){e.pre [...]
-this.preview.appendChild(s)}this.preview.innerHTML+="<br>";var r=this.getButton("Upload","upload","Upload");this.preview.appendChild(r),r.addEventListener("click",function(e){e.preventDefault(),r.setAttribute("disabled","disabled"),t.theme.removeInputError(t.uploader),t.theme.getProgressBar&&(t.progressBar=t.theme.getProgressBar(),t.preview.appendChild(t.progressBar)),t.jsoneditor.options.upload(t.path,i,{success:function(e){t.setValue(e),t.parent?t.parent.onChildEditorChange(t):t.jsoned [...]
-}),n.defaults.resolvers.unshift(function(t){return"any"===t.type?"multiple":void 0}),n.defaults.resolvers.unshift(function(t){return"string"===t.type&&t.media&&"base64"===t.media.binaryEncoding?"base64":void 0}),n.defaults.resolvers.unshift(function(t){return"string"===t.type&&"url"===t.format&&t.options&&t.options.upload===!0&&window.FileReader?"upload":void 0}),n.defaults.resolvers.unshift(function(t){return"array"==t.type&&"table"==t.format?"table":void 0}),n.defaults.resolvers.unshif [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/lodash.min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/lodash.min.js
deleted file mode 100644
index 3625da8..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/lodash.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-(function(){function n(n,t){if(n!==t){var r=null===n,e=n===x,u=n===n,o=null===t,i=t===x,f=t===t;if(n>t&&!o||!u||r&&!i&&f||e&&f)return 1;if(n<t&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function t(n,t,r){for(var e=n.length,u=r?e:-1;r?u--:++u<e;)if(t(n[u],u,n))return u;return-1}function r(n,t,r){if(t!==t)return p(n,r);r-=1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function e(n){return"function"==typeof n||!1}function u(n){return null==n?"":n+""}function o(n,t){for(var r=-1,e= [...]
-Nn.bindKey=Ao,Nn.callback=Le,Nn.chain=te,Nn.chunk=function(n,t,r){t=(r?$r(n,t,r):null==t)?1:ju(xu(t)||1,1),r=0;for(var e=n?n.length:0,u=-1,o=De(du(e/t));r<e;)o[++u]=St(n,r,r+=t);return o},Nn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++t<r;){var o=n[t];o&&(u[++e]=o)}return u},Nn.constant=function(n){return function(){return n}},Nn.countBy=fo,Nn.create=function(n,t,r){var e=Pu(n);return r&&$r(n,t,r)&&(t=x),t?et(e,t):e},Nn.curry=jo,Nn.curryRight=ko,Nn.debounce=le,Nn.defaults [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/marked.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/marked.js
deleted file mode 100644
index c334bff..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/marked.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=u.breaks:this.rules=u.gfm:th [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/object-assign-pollyfill.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/object-assign-pollyfill.js
deleted file mode 100644
index b34d63c..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/object-assign-pollyfill.js
+++ /dev/null
@@ -1 +0,0 @@
-"function"!=typeof Object.assign&&!function(){Object.assign=function(n){"use strict";if(void 0===n||null===n)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),o=1;o<arguments.length;o++){var r=arguments[o];if(void 0!==r&&null!==r)for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t}}();
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/sanitize-html.min.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/sanitize-html.min.js
deleted file mode 100644
index ade2508..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/sanitize-html.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.sanitizeHtml=t()}}(function(){return function t(e,r,n){function i(o,a){if(!r[o]){if(!e[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");thro [...]
-t.next=null,this._options.withStartIndices&&(t.startIndex=this._parser.startIndex),this._options.withDomLvl1&&(t.__proto__="tag"===t.type?a:o),n?(t.prev=n,n.next=t):t.prev=null,r.push(t),t.parent=e||null},n.prototype.onopentag=function(t,e){var r={type:"script"===t?i.Script:"style"===t?i.Style:i.Tag,name:t,attribs:e,children:[]};this._addDomElement(r),this._tagStack.push(r)},n.prototype.ontext=function(t){var e,r=this._options.normalizeWhitespace||this._options.ignoreWhitespace;!this._ta [...]
-ThickSpace:" ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",t [...]
-},get ProxyHandler(){return n("ProxyHandler",t("./ProxyHandler.js"))},get DomUtils(){return n("DomUtils",t("domutils"))},get CollectingHandler(){return n("CollectingHandler",t("./CollectingHandler.js"))},DefaultHandler:s,get RssHandler(){return n("RssHandler",this.FeedHandler)},parseDOM:function(t,e){var r=new s(e);return new i(r,e).end(t),r.dom},parseFeed:function(t,r){var n=new e.exports.FeedHandler(r);return new i(n,r).end(t),n.dom},createDomStream:function(t,e,r){var n=new s(t,e,r);r [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/lib/swagger-oauth.js b/example/application/helloworld/src/main/webapp/swagger-ui/lib/swagger-oauth.js
deleted file mode 100644
index 7160291..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/lib/swagger-oauth.js
+++ /dev/null
@@ -1 +0,0 @@
-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 [...]
\ No newline at end of file
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/o2c.html b/example/application/helloworld/src/main/webapp/swagger-ui/o2c.html
deleted file mode 100644
index 0cde1d3..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/o2c.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<script>
-var qp = null;
-if(/code|token|error/.test(window.location.hash)) {
- qp = location.hash.substring(1);
-}
-else {
- qp = location.search.substring(1);
-}
-qp = qp ? JSON.parse('{"' + qp.replace(/&/g, '","').replace(/=/g,'":"') + '"}',
- function(key, value) {
- return key===""?value:decodeURIComponent(value) }
- ):{}
-
-if (window.opener.swaggerUiAuth.tokenUrl)
- window.opener.processOAuthCode(qp);
-else
- window.opener.onOAuthComplete(qp);
-
-window.close();
-</script>
diff --git a/example/application/helloworld/src/main/webapp/swagger-ui/swagger-ui.js b/example/application/helloworld/src/main/webapp/swagger-ui/swagger-ui.js
deleted file mode 100644
index 5219d03..0000000
--- a/example/application/helloworld/src/main/webapp/swagger-ui/swagger-ui.js
+++ /dev/null
@@ -1,25344 +0,0 @@
-/**
- * swagger-ui - Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API
- * @version v2.2.10
- * @link http://swagger.io
- * @license Apache-2.0
- */
-(function(){/* jshint ignore:start */
- {(function() {
- var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['apikey_auth'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " <span class=\"key_auth__value\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.value : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</span>\n";
-},"3":function(container,depth0,helpers,partials,data) {
- return " <input placeholder=\"api_key\" class=\"auth_input input_apiKey_entry\" name=\"apiKey\" type=\"text\"/>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<div class=\"key_input_container\">\n <h3 class=\"auth__title\">Api key authorization</h3>\n <div class=\"auth__description\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</div>\n <div>\n <div class=\"key_auth__field\">\n <span class=\"key_auth__label\">name:</span>\n <span class=\"key_auth__value\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</span>\n </div>\n <div class=\"key_auth__field\">\n <span class=\"key_auth__label\">in:</span>\n <span class=\"key_auth__value\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0["in"] : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</span>\n </div>\n <div class=\"key_auth__field\">\n <span class=\"key_auth__label\">value:</span>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
- + " </div>\n </div>\n</div>\n";
-},"useData":true});
-templates['auth_button'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- return "<a class='authorize__btn' href=\"#\">Authorize</a>\n";
-},"useData":true});
-templates['auth_button_operation'] = template({"1":function(container,depth0,helpers,partials,data) {
- return " authorize__btn_operation_login\n";
-},"3":function(container,depth0,helpers,partials,data) {
- return " authorize__btn_operation_logout\n";
-},"5":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " <ul class=\"authorize-scopes\">\n"
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.scopes : depth0),{"name":"each","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </ul>\n";
-},"6":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <li class=\"authorize__scope\" title=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.scope : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</li>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {};
-
- return "<div class=\"authorize__btn authorize__btn_operation\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
- + "\">\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.scopes : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "</div>\n";
-},"useData":true});
-templates['auth_view'] = template({"1":function(container,depth0,helpers,partials,data) {
- return " <button type=\"button\" class=\"auth__button auth_submit__button\" data-sw-translate>Authorize</button>\n";
-},"3":function(container,depth0,helpers,partials,data) {
- return " <button type=\"button\" class=\"auth__button auth_logout__button\" data-sw-translate>Logout</button>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {};
-
- return "<div class=\"auth_container\">\n\n <div class=\"auth_inner\"></div>\n <div class=\"auth_submit\">\n"
- + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isAuthorized : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </div>\n\n</div>\n";
-},"useData":true});
-templates['basic_auth'] = template({"1":function(container,depth0,helpers,partials,data) {
- return " - authorized";
-},"3":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " <span class=\"basic_auth__value\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.username : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</span>\n";
-},"5":function(container,depth0,helpers,partials,data) {
- return " <input required placeholder=\"username\" class=\"basic_auth__username auth_input\" name=\"username\" type=\"text\"/>\n";
-},"7":function(container,depth0,helpers,partials,data) {
- return " <div class=\"auth_label\">\n <span class=\"basic_auth__label\" data-sw-translate>password:</span>\n <input required placeholder=\"password\" class=\"basic_auth__password auth_input\" name=\"password\" type=\"password\"/></label>\n </div>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {};
-
- return "<div class='basic_auth_container'>\n <h3 class=\"auth__title\">Basic authentication"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "</h3>\n <form class=\"basic_input_container\">\n <div class=\"auth__description\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</div>\n <div class=\"auth_label\">\n <span class=\"basic_auth__label\" data-sw-translate>username:</span>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(5, data, 0),"data":data})) != null ? stack1 : "")
- + " </div>\n"
- + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.isLogout : depth0),{"name":"unless","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </form>\n</div>\n";
-},"useData":true});
-templates['content_type'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.produces : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"2":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <option value=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</option>\n";
-},"4":function(container,depth0,helpers,partials,data) {
- return " <option value=\"application/json\">application/json</option>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<label data-sw-translate for=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.contentTypeId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\">Response Content Type</label>\n<select name=\"contentType\" id=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.contentTypeId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\">\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.produces : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "")
- + "</select>\n";
-},"useData":true});
-templates['main'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <div class=\"info_title\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</div>\n <div class=\"info_description markdown\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.description : stack1),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</div>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.externalDocs : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " "
- + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = helpers["if"].call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n";
-},"2":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <p>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.description : stack1),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</p>\n <a href=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\" target=\"_blank\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.externalDocs : depth0)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</a>\n";
-},"4":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return "<div class=\"info_tos\"><a target=\"_blank\" href=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.termsOfServiceUrl : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\" data-sw-translate>Terms of service</a></div>";
-},"6":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return "<div><div class='info_name' style=\"display: inline\" data-sw-translate>Created by </div> "
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.name : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</div>";
-},"8":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<div class='info_url' data-sw-translate>See more at <a href=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</a></div>";
-},"10":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<div class='info_email'><a target=\"_parent\" href=\"mailto:"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.contact : stack1)) != null ? stack1.email : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "?subject="
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.title : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\" data-sw-translate>Contact the developer</a></div>";
-},"12":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<div class='info_license'><a target=\"_blank\" href='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.url : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,((stack1 = ((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.license : stack1)) != null ? stack1.name : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</a></div>";
-},"14":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " , <span style=\"font-variant: small-caps\" data-sw-translate>api version</span>: "
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\n ";
-},"16":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <span style=\"float:right\"><a target=\"_blank\" href=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.validatorUrl : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "/debug?url="
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.url : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\"><img id=\"validator\" src=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.validatorUrl : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "?url="
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.url : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\"></a>\n </span>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {};
-
- return "<div class='info' id='api_info'>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.info : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "</div>\n<div class='container' id='resources_container'>\n <div class='authorize-wrapper'></div>\n\n <ul id='resources'></ul>\n\n <div class=\"footer\">\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: "
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.basePath : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\n"
- + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.info : depth0)) != null ? stack1.version : stack1),{"name":"if","hash":{},"fn":container.program(14, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "]\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.validatorUrl : depth0),{"name":"if","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </h4>\n </div>\n</div>\n";
-},"useData":true});
-templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return "<p>Authorization URL: "
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</p>";
-},"3":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return "<p>Token URL: "
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tokenUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</p>";
-},"5":function(container,depth0,helpers,partials,data) {
- return " <p>Please input username and password for password flow authorization</p>\n <fieldset>\n <div><label>Username: <input class=\"oauth-username\" type=\"text\" name=\"username\"></label></div>\n <div><label>Password: <input class=\"oauth-password\" type=\"password\" name=\"password\"></label></div>\n </fieldset>\n";
-},"7":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " <p>Setup client authentication."
- + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.requireClientAuthenticaiton : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "</p>\n <fieldset>\n <div><label>Type:\n <select class=\"oauth-client-authentication-type\" name=\"client-authentication-type\">\n <option value=\"none\" selected>None or other</option>\n <option value=\"basic\">Basic auth</option>\n <option value=\"request-body\">Request body</option>\n </select>\n </label></div>\n <div class=\"oauth-client-authentication\ [...]
-},"8":function(container,depth0,helpers,partials,data) {
- return "(Required)";
-},"10":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <li>\n <input class=\"oauth-scope\" type=\"checkbox\" data-scope=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.scope : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\" oauthtype=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\"/>\n <label>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.scope : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</label><br/>\n <span class=\"api-scope-desc\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </span>\n </li>\n";
-},"11":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " ("
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + ")\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<div>\n <h3 class=\"auth__title\">OAuth2.0</h3>\n <p>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</p>\n "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tokenUrl : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n <p>flow: "
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.flow : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</p>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordFlow : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.clientAuthentication : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " <p><strong> "
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.appName : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + " </strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>\n <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.\n <a href=\"#\">Learn how to use</a>\n </p>\n <ul class=\"api-popup-scopes\">\n"
- + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.scopes : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </ul>\n</div>";
-},"useData":true});
-templates['operation'] = template({"1":function(container,depth0,helpers,partials,data) {
- return "deprecated";
-},"3":function(container,depth0,helpers,partials,data) {
- return " <h4><span data-sw-translate>Warning: Deprecated</span></h4>\n";
-},"5":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " <h4><span data-sw-translate>Implementation Notes</span></h4>\n <div class=\"markdown\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</div>\n";
-},"7":function(container,depth0,helpers,partials,data) {
- return " <div class='authorize-wrapper authorize-wrapper_operation'></div>\n";
-},"9":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {};
-
- return " <div class=\"response-class\">\n <h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> "
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.successCode : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + ")</h4>\n "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.successDescription : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n <p><span class=\"model-signature\" /></p>\n <br/>\n <div class=\"response-content-type\" />\n </div>\n";
-},"10":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return "<div class=\"markdown\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.successDescription : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</div>";
-},"12":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " <h4 data-sw-translate>Headers</h4>\n <table class=\"headers\">\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Header</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Description</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Type</th>\n <th style=\"width: 320px; max-width: 320px\" data-sw-translate> [...]
- + ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.headers : depth0),{"name":"each","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </tbody>\n </table>\n";
-},"13":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <tr>\n <td>"
- + container.escapeExpression(((helper = (helper = helpers.key || (data && data.key)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"key","hash":{},"data":data}) : helper)))
- + "</td>\n <td>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n <td>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n <td>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.other : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n </tr>\n";
-},"15":function(container,depth0,helpers,partials,data) {
- return " <h4 data-sw-translate>Parameters</h4>\n <table class='fullwidth parameters'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate> [...]
-},"17":function(container,depth0,helpers,partials,data) {
- return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth response-messages'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n [...]
-},"19":function(container,depth0,helpers,partials,data) {
- return "";
-},"21":function(container,depth0,helpers,partials,data) {
- return " <div class='sandbox_header'>\n <input class='submit' type='submit' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
-},"23":function(container,depth0,helpers,partials,data) {
- return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3=container.escapeExpression;
-
- return " <ul class='operations' >\n <li class='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.method : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + " operation' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.parentId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "_"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/"
- + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.encodedParentId : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "/"
- + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "' class=\"toggleOperation\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.method : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</a>\n </span>\n <span class='path'>\n <a href='#!/"
- + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.encodedParentId : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "/"
- + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "' class=\"toggleOperation "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.deprecated : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.path : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/"
- + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.encodedParentId : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "/"
- + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "' class=\"toggleOperation\"><span class=\"markdown\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.summary : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</span></a>\n </li>\n </ul>\n </div>\n <div class='content' id='"
- + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.encodedParentId : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "_"
- + alias3((helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.nickname : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "_content' style='display:none'>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.deprecated : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.security : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.headers : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.parameters : depth0),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.responseMessages : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isReadOnly : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.program(21, data, 0),"data":data})) != null ? stack1 : "")
- + " </form>\n <div class='response' style='display:none'>\n <h4 class='curl'>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.showRequestHeaders : depth0),{"name":"if","hash":{},"fn":container.program(23, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
-},"useData":true});
-templates['param'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.isFile : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "");
-},"2":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <input type=\"file\" name='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'/>\n <div class=\"parameter-content-type\" />\n";
-},"4":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "");
-},"5":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <div class=\"editor_holder\"></div>\n <textarea class='body-textarea' name='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0["default"] : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
-},"7":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <textarea class='body-textarea' name='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
-},"9":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.isFile : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(10, data, 0),"data":data})) != null ? stack1 : "");
-},"10":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = (helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helpers.helperMissing).call(depth0 != null ? depth0 : {},depth0,{"name":"renderTextParam","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"11":function(container,depth0,helpers,partials,data) {
- return "";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<td class='code'><label for='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</label></td>\n<td>\n\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isBody : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(9, data, 0),"data":data})) != null ? stack1 : "")
- + "\n</td>\n<td class=\"markdown\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td>\n <span class=\"model-signature\"></span>\n</td>\n";
-},"useData":true});
-templates['param_list'] = template({"1":function(container,depth0,helpers,partials,data) {
- return " required";
-},"3":function(container,depth0,helpers,partials,data) {
- return " multiple=\"multiple\"";
-},"5":function(container,depth0,helpers,partials,data) {
- return " required ";
-},"7":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " <option "
- + ((stack1 = helpers.unless.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.hasDefault : depth0),{"name":"unless","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " value=''></option>\n";
-},"8":function(container,depth0,helpers,partials,data) {
- return " selected=\"\" ";
-},"10":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "\n <option "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isDefault : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " value='"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.value : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "'> "
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.value : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + " "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isDefault : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </option>\n\n";
-},"11":function(container,depth0,helpers,partials,data) {
- return " selected=\"\" ";
-},"13":function(container,depth0,helpers,partials,data) {
- return " (default) ";
-},"15":function(container,depth0,helpers,partials,data) {
- return "<strong>";
-},"17":function(container,depth0,helpers,partials,data) {
- return "</strong>";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<td class='code"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "'><label for='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</label></td>\n<td>\n <select "
- + ((stack1 = (helpers.isArray || (depth0 && depth0.isArray) || alias2).call(alias1,depth0,{"name":"isArray","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " class=\"parameter "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\" name=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\" id=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\">\n\n"
- + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"unless","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n"
- + ((stack1 = helpers.each.call(alias1,((stack1 = (depth0 != null ? depth0.allowableValues : depth0)) != null ? stack1.descriptiveValues : stack1),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n </select>\n</td>\n<td class=\"markdown\">"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = ((helper = (helper = helpers.description || (depth0 != null ? depth0.description : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"description","hash":{},"data":data}) : helper))) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.required : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "</td>\n<td>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
-},"useData":true});
-templates['param_readonly'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <textarea class='body-textarea' readonly='readonly' name='"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</textarea>\n <div class=\"parameter-content-type\" />\n";
-},"3":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data})) != null ? stack1 : "");
-},"4":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " "
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\n";
-},"6":function(container,depth0,helpers,partials,data) {
- return " (empty)\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<td class='code'><label for='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</label></td>\n<td>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isBody : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
- + "</td>\n<td class=\"markdown\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
-},"useData":true});
-templates['param_readonly_required'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</textarea>\n";
-},"3":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data})) != null ? stack1 : "");
-},"4":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " "
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\n";
-},"6":function(container,depth0,helpers,partials,data) {
- return " (empty)\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<td class='code required'><label for='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</label></td>\n<td>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isBody : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data})) != null ? stack1 : "")
- + "</td>\n<td class=\"markdown\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
-},"useData":true});
-templates['param_required'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.isFile : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "");
-},"2":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <input type=\"file\" name='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'/>\n";
-},"4":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0["default"] : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "");
-},"5":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <div class=\"editor_holder\"></div>\n <textarea class='body-textarea required' placeholder='(required)' name='"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' id=\""
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0["default"] : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</textarea>\n <br />\n <div class=\"parameter-content-type\" />\n";
-},"7":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <textarea class='body-textarea required' placeholder='(required)' name='"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'></textarea>\n <div class=\"editor_holder\"></div>\n <br />\n <div class=\"parameter-content-type\" />\n";
-},"9":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.isFile : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.program(12, data, 0),"data":data})) != null ? stack1 : "");
-},"10":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <input class='parameter required' type='file' name='"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'/>\n";
-},"12":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = (helpers.renderTextParam || (depth0 && depth0.renderTextParam) || helpers.helperMissing).call(depth0 != null ? depth0 : {},depth0,{"name":"renderTextParam","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"13":function(container,depth0,helpers,partials,data) {
- return "";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<td class='code required'><label for='"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "'>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</label></td>\n<td>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isBody : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(9, data, 0),"data":data})) != null ? stack1 : "")
- + "</td>\n<td>\n <strong><span class=\"markdown\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</span></strong>\n</td>\n<td>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.paramType : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td><span class=\"model-signature\"></span></td>\n";
-},"useData":true});
-templates['parameter_content_type'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.consumes : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"2":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <option value=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</option>\n";
-},"4":function(container,depth0,helpers,partials,data) {
- return " <option value=\"application/json\">application/json</option>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<label for=\""
- + container.escapeExpression(((helper = (helper = helpers.parameterContentTypeId || (depth0 != null ? depth0.parameterContentTypeId : depth0)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"parameterContentTypeId","hash":{},"data":data}) : helper)))
- + "\" data-sw-translate>Parameter content type:</label>\n<select name=\"parameterContentType\" id=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.parameterContentTypeId : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\">\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.consumes : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "")
- + "</select>\n";
-},"useData":true});
-templates['popup'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var helper;
-
- return "<div class=\"api-popup-dialog-wrapper\">\n <div class=\"api-popup-title\">"
- + container.escapeExpression(((helper = (helper = helpers.title || (depth0 != null ? depth0.title : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"title","hash":{},"data":data}) : helper)))
- + "</div>\n <div class=\"api-popup-content\"></div>\n <p class=\"error-msg\"></p>\n <div class=\"api-popup-actions\">\n <button class=\"api-popup-cancel api-button gray\" type=\"button\">Cancel</button>\n </div>\n</div>\n<div class=\"api-popup-dialog-shadow\"></div>";
-},"useData":true});
-templates['resource'] = template({"1":function(container,depth0,helpers,partials,data) {
- return " : ";
-},"3":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " <li>\n <a href='"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.url : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' data-sw-translate>Raw</a>\n </li>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, options, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, buffer =
- "<div class='heading'>\n <h2>\n <a href='#!/"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' class=\"toggleEndpointList\" data-id=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</a> ";
- stack1 = ((helper = (helper = helpers.summary || (depth0 != null ? depth0.summary : depth0)) != null ? helper : alias2),(options={"name":"summary","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data}),(typeof helper === "function" ? helper.call(alias1,options) : helper));
- if (!helpers.summary) { stack1 = helpers.blockHelperMissing.call(depth0,stack1,options)}
- if (stack1 != null) { buffer += stack1; }
- return buffer + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.summary : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' id='endpointListTogger_"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "' class=\"toggleEndpointList\" data-id=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\" data-sw-translate>Show/Hide</a>\n </li>\n <li>\n <a href='#' class=\"collapseResource\" data-id=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\" data-sw-translate>\n List Operations\n </a>\n </li>\n <li>\n <a href='#' class=\"expandResource\" data-id=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\" data-sw-translate>\n Expand Operations\n </a>\n </li>\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.url : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </ul>\n</div>\n<ul class='endpoints' id='"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.id : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "_endpoint_list' style='display:none'>\n\n</ul>\n";
-},"useData":true});
-templates['response_content_type'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = helpers.each.call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.produces : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");
-},"2":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <option value=\""
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,depth0,{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</option>\n";
-},"4":function(container,depth0,helpers,partials,data) {
- return " <option value=\"application/json\">application/json</option>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
-
- return "<label data-sw-translate for=\""
- + alias4(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"responseContentTypeId","hash":{},"data":data}) : helper)))
- + "\">Response Content Type</label>\n<select name=\"responseContentType\" id=\""
- + alias4(((helper = (helper = helpers.responseContentTypeId || (depth0 != null ? depth0.responseContentTypeId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"responseContentTypeId","hash":{},"data":data}) : helper)))
- + "\">\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.produces : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "")
- + "</select>\n";
-},"useData":true});
-templates['signature'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {};
-
- return "\n<div>\n<ul class=\"signature-nav\">\n <li><a class=\"description-link\" href=\"#\" data-sw-translate>Model</a></li>\n <li><a class=\"snippet-link\" href=\"#\" data-sw-translate>Example Value</a></li>\n</ul>\n<div>\n\n<div class=\"signature-container\">\n <div class=\"description\">\n "
- + container.escapeExpression((helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.signature : depth0),{"name":"sanitize","hash":{},"data":data}))
- + "\n </div>\n\n <div class=\"snippet\">\n"
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.sampleJSON : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.sampleXML : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </div>\n</div>\n";
-},"2":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {};
-
- return " <div class=\"snippet_json\">\n <pre><code>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.sampleJSON : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</code></pre>\n "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isParam : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n </div>\n";
-},"3":function(container,depth0,helpers,partials,data) {
- return "<small class=\"notice\" data-sw-translate></small>";
-},"5":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {};
-
- return " <div class=\"snippet_xml\">\n <pre><code>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(alias1,(depth0 != null ? depth0.sampleXML : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</code></pre>\n "
- + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isParam : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + "\n </div>\n";
-},"7":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return " "
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.signature : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1;
-
- return ((stack1 = (helpers.ifCond || (depth0 && depth0.ifCond) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.sampleJSON : depth0),"||",(depth0 != null ? depth0.sampleXML : depth0),{"name":"ifCond","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "");
-},"useData":true});
-templates['status_code'] = template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return " <tr>\n <td>"
- + container.escapeExpression(((helper = (helper = helpers.key || (data && data.key)) != null ? helper : alias2),(typeof helper === "function" ? helper.call(alias1,{"name":"key","hash":{},"data":data}) : helper)))
- + "</td>\n <td>"
- + ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n <td>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.type : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n </tr>\n";
-},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
-
- return "<td width='15%' class='code'>"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.code : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td class=\"markdown\">"
- + ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.message : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
- + "</td>\n<td width='50%'><span class=\"model-signature\" /></td>\n<td class=\"headers\">\n <table>\n <tbody>\n"
- + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.headers : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
- + " </tbody>\n </table>\n</td>";
-},"useData":true});
-})();}
- /* jshint ignore:end */
-'use strict';
-
-
-$(function() {
-
- // Helper function for vertically aligning DOM elements
- // http://www.seodenver.com/simple-vertical-align-plugin-for-jquery/
- $.fn.vAlign = function() {
- return this.each(function(){
- var ah = $(this).height();
- var ph = $(this).parent().height();
- var mh = (ph - ah) / 2;
- $(this).css('margin-top', mh);
- });
- };
-
- $.fn.stretchFormtasticInputWidthToParent = function() {
- return this.each(function(){
- var p_width = $(this).closest("form").innerWidth();
- var p_padding = parseInt($(this).closest("form").css('padding-left') ,10) + parseInt($(this).closest('form').css('padding-right'), 10);
- var this_padding = parseInt($(this).css('padding-left'), 10) + parseInt($(this).css('padding-right'), 10);
- $(this).css('width', p_width - p_padding - this_padding);
- });
- };
-
- $('form.formtastic li.string input, form.formtastic textarea').stretchFormtasticInputWidthToParent();
-
- // Vertically center these paragraphs
- // Parent may need a min-height for this to work..
- $('ul.downplayed li div.content p').vAlign();
-
- // When a sandbox form is submitted..
- $("form.sandbox").submit(function(){
-
- var error_free = true;
-
- // Cycle through the forms required inputs
- $(this).find("input.required").each(function() {
-
- // Remove any existing error styles from the input
- $(this).removeClass('error');
-
- // Tack the error style on if the input is empty..
- if ($(this).val() === '') {
- $(this).addClass('error');
- $(this).wiggle();
- error_free = false;
- }
-
- });
-
- return error_free;
- });
-
-});
-
-function clippyCopiedCallback() {
- $('#api_key_copied').fadeIn().delay(1000).fadeOut();
-
- // var b = $("#clippy_tooltip_" + a);
- // b.length != 0 && (b.attr("title", "copied!").trigger("tipsy.reload"), setTimeout(function() {
- // b.attr("title", "copy to clipboard")
- // },
- // 500))
-}
-
-// Logging function that accounts for browsers that don't have window.console
-function log(){
- log.history = log.history || [];
- log.history.push(arguments);
- if(this.console){
- console.log( Array.prototype.slice.call(arguments)[0] );
- }
-}
-
-// Handle browsers that do console incorrectly (IE9 and below, see http://stackoverflow.com/a/5539378/7913)
-if (Function.prototype.bind && console && typeof console.log === "object") {
- [
- "log","info","warn","error","assert","dir","clear","profile","profileEnd"
- ].forEach(function (method) {
- console[method] = this.bind(console[method], console);
- }, Function.prototype.call);
-}
-
-window.Docs = {
-
- shebang: function() {
-
- // If shebang has an operation nickname in it..
- // e.g. /docs/#!/words/get_search
- var fragments = $.param.fragment().split('/');
- fragments.shift(); // get rid of the bang
-
- switch (fragments.length) {
- case 1:
- if (fragments[0].length > 0) { // prevent matching "#/"
- // Expand all operations for the resource and scroll to it
- var dom_id = 'resource_' + fragments[0];
-
- Docs.expandEndpointListForResource(fragments[0]);
- $("#"+dom_id).slideto({highlight: false});
- }
- break;
- case 2:
- // Refer to the endpoint DOM element, e.g. #words_get_search
-
- // Expand Resource
- Docs.expandEndpointListForResource(fragments[0]);
- $("#"+dom_id).slideto({highlight: false});
-
- // Expand operation
- var li_dom_id = fragments.join('_');
- var li_content_dom_id = li_dom_id + "_content";
-
-
- Docs.expandOperation($('#'+li_content_dom_id));
- $('#'+li_dom_id).slideto({highlight: false});
- break;
- }
- },
-
- toggleEndpointListForResource: function(resource) {
- var elem = $('li#resource_' + Docs.escapeResourceName(resource) + ' ul.endpoints');
- if (elem.is(':visible')) {
- $.bbq.pushState('#/', 2);
- Docs.collapseEndpointListForResource(resource);
- } else {
- $.bbq.pushState('#/' + resource, 2);
- Docs.expandEndpointListForResource(resource);
- }
- },
-
- // Expand resource
- expandEndpointListForResource: function(resource) {
- var resource = Docs.escapeResourceName(resource);
- if (resource == '') {
- $('.resource ul.endpoints').slideDown();
- return;
- }
-
- $('li#resource_' + resource).addClass('active');
-
- var elem = $('li#resource_' + resource + ' ul.endpoints');
- elem.slideDown();
- },
-
- // Collapse resource and mark as explicitly closed
- collapseEndpointListForResource: function(resource) {
- var resource = Docs.escapeResourceName(resource);
- if (resource == '') {
- $('.resource ul.endpoints').slideUp();
- return;
- }
-
- $('li#resource_' + resource).removeClass('active');
-
- var elem = $('li#resource_' + resource + ' ul.endpoints');
- elem.slideUp();
- },
-
- expandOperationsForResource: function(resource) {
- // Make sure the resource container is open..
- Docs.expandEndpointListForResource(resource);
-
- if (resource == '') {
- $('.resource ul.endpoints li.operation div.content').slideDown();
- return;
- }
-
- $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
- Docs.expandOperation($(this));
- });
- },
-
- collapseOperationsForResource: function(resource) {
- // Make sure the resource container is open..
- Docs.expandEndpointListForResource(resource);
-
- if (resource == '') {
- $('.resource ul.endpoints li.operation div.content').slideUp();
- return;
- }
-
- $('li#resource_' + Docs.escapeResourceName(resource) + ' li.operation div.content').each(function() {
- Docs.collapseOperation($(this));
- });
- },
-
- escapeResourceName: function(resource) {
- return resource.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g, "\\$&");
- },
-
- expandOperation: function(elem) {
- elem.slideDown();
- },
-
- collapseOperation: function(elem) {
- elem.slideUp();
- }
-};
-
-/*!
- * https://github.com/es-shims/es5-shim
- * @license es5-shim Copyright 2009-2015 by contributors, MIT License
- * see https://github.com/es-shims/es5-shim/blob/master/LICENSE
- */
-
-// vim: ts=4 sts=4 sw=4 expandtab
-
-// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
-;
-
-// UMD (Universal Module Definition)
-// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
-(function (root, factory) {
- 'use strict';
-
- /* global define, exports, module */
- if (typeof define === 'function' && define.amd) {
- // AMD. Register as an anonymous module.
- define(factory);
- } else if (typeof exports === 'object') {
- // Node. Does not work with strict CommonJS, but
- // only CommonJS-like enviroments that support module.exports,
- // like Node.
- module.exports = factory();
- } else {
- // Browser globals (root is window)
- root.returnExports = factory();
- }
-}(this, function () {
- /**
- * Brings an environment as close to ECMAScript 5 compliance
- * as is possible with the facilities of erstwhile engines.
- *
- * Annotated ES5: http://es5.github.com/ (specific links below)
- * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
- * Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/
- */
-
- // Shortcut to an often accessed properties, in order to avoid multiple
- // dereference that costs universally. This also holds a reference to known-good
- // functions.
- var $Array = Array;
- var ArrayPrototype = $Array.prototype;
- var $Object = Object;
- var ObjectPrototype = $Object.prototype;
- var $Function = Function;
- var FunctionPrototype = $Function.prototype;
- var $String = String;
- var StringPrototype = $String.prototype;
- var $Number = Number;
- var NumberPrototype = $Number.prototype;
- var array_slice = ArrayPrototype.slice;
- var array_splice = ArrayPrototype.splice;
- var array_push = ArrayPrototype.push;
- var array_unshift = ArrayPrototype.unshift;
- var array_concat = ArrayPrototype.concat;
- var array_join = ArrayPrototype.join;
- var call = FunctionPrototype.call;
- var apply = FunctionPrototype.apply;
- var max = Math.max;
- var min = Math.min;
-
- // Having a toString local variable name breaks in Opera so use to_string.
- var to_string = ObjectPrototype.toString;
-
- /* global Symbol */
- /* eslint-disable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
- var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { ret [...]
-
- var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; };
- var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; };
- /* eslint-enable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
-
- /* inlined from http://npmjs.com/define-properties */
- var supportsDescriptors = $Object.defineProperty && (function () {
- try {
- var obj = {};
- $Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
- for (var _ in obj) { // jscs:ignore disallowUnusedVariables
- return false;
- }
- return obj.x === obj;
- } catch (e) { /* this is ES3 */
- return false;
- }
- }());
- var defineProperties = (function (has) {
- // Define configurable, writable, and non-enumerable props
- // if they don't exist.
- var defineProperty;
- if (supportsDescriptors) {
- defineProperty = function (object, name, method, forceAssign) {
- if (!forceAssign && (name in object)) {
- return;
- }
- $Object.defineProperty(object, name, {
- configurable: true,
- enumerable: false,
- writable: true,
- value: method
- });
- };
- } else {
- defineProperty = function (object, name, method, forceAssign) {
- if (!forceAssign && (name in object)) {
- return;
- }
- object[name] = method;
- };
- }
- return function defineProperties(object, map, forceAssign) {
- for (var name in map) {
- if (has.call(map, name)) {
- defineProperty(object, name, map[name], forceAssign);
- }
- }
- };
- }(ObjectPrototype.hasOwnProperty));
-
- //
- // Util
- // ======
- //
-
- /* replaceable with https://npmjs.com/package/es-abstract /helpers/isPrimitive */
- var isPrimitive = function isPrimitive(input) {
- var type = typeof input;
- return input === null || (type !== 'object' && type !== 'function');
- };
-
- var isActualNaN = $Number.isNaN || function isActualNaN(x) {
- return x !== x;
- };
-
- var ES = {
- // ES5 9.4
- // http://es5.github.com/#x9.4
- // http://jsperf.com/to-integer
- /* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */
- ToInteger: function ToInteger(num) {
- var n = +num;
- if (isActualNaN(n)) {
- n = 0;
- } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
- n = (n > 0 || -1) * Math.floor(Math.abs(n));
- }
- return n;
- },
-
- /* replaceable with https://npmjs.com/package/es-abstract ES5.ToPrimitive */
- ToPrimitive: function ToPrimitive(input) {
- var val, valueOf, toStr;
- if (isPrimitive(input)) {
- return input;
- }
- valueOf = input.valueOf;
- if (isCallable(valueOf)) {
- val = valueOf.call(input);
- if (isPrimitive(val)) {
- return val;
- }
- }
- toStr = input.toString;
- if (isCallable(toStr)) {
- val = toStr.call(input);
- if (isPrimitive(val)) {
- return val;
- }
- }
- throw new TypeError();
- },
-
- // ES5 9.9
- // http://es5.github.com/#x9.9
- /* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */
- ToObject: function (o) {
- if (o == null) { // this matches both null and undefined
- throw new TypeError("can't convert " + o + ' to object');
- }
- return $Object(o);
- },
-
- /* replaceable with https://npmjs.com/package/es-abstract ES5.ToUint32 */
- ToUint32: function ToUint32(x) {
- return x >>> 0;
- }
- };
-
- //
- // Function
- // ========
- //
-
- // ES-5 15.3.4.5
- // http://es5.github.com/#x15.3.4.5
-
- var Empty = function Empty() {};
-
- defineProperties(FunctionPrototype, {
- bind: function bind(that) { // .length is 1
- // 1. Let Target be the this value.
- var target = this;
- // 2. If IsCallable(Target) is false, throw a TypeError exception.
- if (!isCallable(target)) {
- throw new TypeError('Function.prototype.bind called on incompatible ' + target);
- }
- // 3. Let A be a new (possibly empty) internal list of all of the
- // argument values provided after thisArg (arg1, arg2 etc), in order.
- // XXX slicedArgs will stand in for "A" if used
- var args = array_slice.call(arguments, 1); // for normal call
- // 4. Let F be a new native ECMAScript object.
- // 11. Set the [[Prototype]] internal property of F to the standard
- // built-in Function prototype object as specified in 15.3.3.1.
- // 12. Set the [[Call]] internal property of F as described in
- // 15.3.4.5.1.
- // 13. Set the [[Construct]] internal property of F as described in
- // 15.3.4.5.2.
- // 14. Set the [[HasInstance]] internal property of F as described in
- // 15.3.4.5.3.
- var bound;
- var binder = function () {
-
- if (this instanceof bound) {
- // 15.3.4.5.2 [[Construct]]
- // When the [[Construct]] internal method of a function object,
- // F that was created using the bind function is called with a
- // list of arguments ExtraArgs, the following steps are taken:
- // 1. Let target be the value of F's [[TargetFunction]]
- // internal property.
- // 2. If target has no [[Construct]] internal method, a
- // TypeError exception is thrown.
- // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
- // property.
- // 4. Let args be a new list containing the same values as the
- // list boundArgs in the same order followed by the same
- // values as the list ExtraArgs in the same order.
- // 5. Return the result of calling the [[Construct]] internal
- // method of target providing args as the arguments.
-
- var result = apply.call(
- target,
- this,
- array_concat.call(args, array_slice.call(arguments))
- );
- if ($Object(result) === result) {
- return result;
- }
- return this;
-
- } else {
- // 15.3.4.5.1 [[Call]]
- // When the [[Call]] internal method of a function object, F,
- // which was created using the bind function is called with a
- // this value and a list of arguments ExtraArgs, the following
- // steps are taken:
- // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
- // property.
- // 2. Let boundThis be the value of F's [[BoundThis]] internal
- // property.
- // 3. Let target be the value of F's [[TargetFunction]] internal
- // property.
- // 4. Let args be a new list containing the same values as the
- // list boundArgs in the same order followed by the same
- // values as the list ExtraArgs in the same order.
- // 5. Return the result of calling the [[Call]] internal method
- // of target providing boundThis as the this value and
- // providing args as the arguments.
-
- // equiv: target.call(this, ...boundArgs, ...args)
- return apply.call(
- target,
- that,
- array_concat.call(args, array_slice.call(arguments))
- );
-
- }
-
- };
-
- // 15. If the [[Class]] internal property of Target is "Function", then
- // a. Let L be the length property of Target minus the length of A.
- // b. Set the length own property of F to either 0 or L, whichever is
- // larger.
- // 16. Else set the length own property of F to 0.
-
- var boundLength = max(0, target.length - args.length);
-
- // 17. Set the attributes of the length own property of F to the values
- // specified in 15.3.5.1.
- var boundArgs = [];
- for (var i = 0; i < boundLength; i++) {
- array_push.call(boundArgs, '$' + i);
- }
-
- // XXX Build a dynamic function with desired amount of arguments is the only
- // way to set the length property of a function.
- // In environments where Content Security Policies enabled (Chrome extensions,
- // for ex.) all use of eval or Function costructor throws an exception.
- // However in all of these environments Function.prototype.bind exists
- // and so this code will never be executed.
- bound = $Function('binder', 'return function (' + array_join.call(boundArgs, ',') + '){ return binder.apply(this, arguments); }')(binder);
-
- if (target.prototype) {
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- // Clean up dangling references.
- Empty.prototype = null;
- }
-
- // TODO
- // 18. Set the [[Extensible]] internal property of F to true.
-
- // TODO
- // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
- // 20. Call the [[DefineOwnProperty]] internal method of F with
- // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
- // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
- // false.
- // 21. Call the [[DefineOwnProperty]] internal method of F with
- // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
- // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
- // and false.
-
- // TODO
- // NOTE Function objects created using Function.prototype.bind do not
- // have a prototype property or the [[Code]], [[FormalParameters]], and
- // [[Scope]] internal properties.
- // XXX can't delete prototype in pure-js.
-
- // 22. Return F.
- return bound;
- }
- });
-
- // _Please note: Shortcuts are defined after `Function.prototype.bind` as we
- // use it in defining shortcuts.
- var owns = call.bind(ObjectPrototype.hasOwnProperty);
- var toStr = call.bind(ObjectPrototype.toString);
- var arraySlice = call.bind(array_slice);
- var arraySliceApply = apply.bind(array_slice);
- var strSlice = call.bind(StringPrototype.slice);
- var strSplit = call.bind(StringPrototype.split);
- var strIndexOf = call.bind(StringPrototype.indexOf);
- var pushCall = call.bind(array_push);
- var isEnum = call.bind(ObjectPrototype.propertyIsEnumerable);
- var arraySort = call.bind(ArrayPrototype.sort);
-
- //
- // Array
- // =====
- //
-
- var isArray = $Array.isArray || function isArray(obj) {
- return toStr(obj) === '[object Array]';
- };
-
- // ES5 15.4.4.12
- // http://es5.github.com/#x15.4.4.13
- // Return len+argCount.
- // [bugfix, ielt8]
- // IE < 8 bug: [].unshift(0) === undefined but should be "1"
- var hasUnshiftReturnValueBug = [].unshift(0) !== 1;
- defineProperties(ArrayPrototype, {
- unshift: function () {
- array_unshift.apply(this, arguments);
- return this.length;
- }
- }, hasUnshiftReturnValueBug);
-
- // ES5 15.4.3.2
- // http://es5.github.com/#x15.4.3.2
- // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
- defineProperties($Array, { isArray: isArray });
-
- // The IsCallable() check in the Array functions
- // has been replaced with a strict check on the
- // internal class of the object to trap cases where
- // the provided function was actually a regular
- // expression literal, which in V8 and
- // JavaScriptCore is a typeof "function". Only in
- // V8 are regular expression literals permitted as
- // reduce parameters, so it is desirable in the
- // general case for the shim to match the more
- // strict and common behavior of rejecting regular
- // expressions.
-
- // ES5 15.4.4.18
- // http://es5.github.com/#x15.4.4.18
- // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
-
- // Check failure of by-index access of string characters (IE < 9)
- // and failure of `0 in boxedString` (Rhino)
- var boxedString = $Object('a');
- var splitString = boxedString[0] !== 'a' || !(0 in boxedString);
-
- var properlyBoxesContext = function properlyBoxed(method) {
- // Check node 0.6.21 bug where third parameter is not boxed
- var properlyBoxesNonStrict = true;
- var properlyBoxesStrict = true;
- var threwException = false;
- if (method) {
- try {
- method.call('foo', function (_, __, context) {
- if (typeof context !== 'object') {
- properlyBoxesNonStrict = false;
- }
- });
-
- method.call([1], function () {
- 'use strict';
-
- properlyBoxesStrict = typeof this === 'string';
- }, 'x');
- } catch (e) {
- threwException = true;
- }
- }
- return !!method && !threwException && properlyBoxesNonStrict && properlyBoxesStrict;
- };
-
- defineProperties(ArrayPrototype, {
- forEach: function forEach(callbackfn/*, thisArg*/) {
- var object = ES.ToObject(this);
- var self = splitString && isString(this) ? strSplit(this, '') : object;
- var i = -1;
- var length = ES.ToUint32(self.length);
- var T;
- if (arguments.length > 1) {
- T = arguments[1];
- }
-
- // If no callback function or if callback is not a callable function
- if (!isCallable(callbackfn)) {
- throw new TypeError('Array.prototype.forEach callback must be a function');
- }
-
- while (++i < length) {
- if (i in self) {
- // Invoke the callback function with call, passing arguments:
- // context, property value, property key, thisArg object
- if (typeof T === 'undefined') {
- callbackfn(self[i], i, object);
- } else {
- callbackfn.call(T, self[i], i, object);
- }
- }
- }
- }
- }, !properlyBoxesContext(ArrayPrototype.forEach));
-
- // ES5 15.4.4.19
- // http://es5.github.com/#x15.4.4.19
- // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
- defineProperties(ArrayPrototype, {
- map: function map(callbackfn/*, thisArg*/) {
- var object = ES.ToObject(this);
- var self = splitString && isString(this) ? strSplit(this, '') : object;
- var length = ES.ToUint32(self.length);
- var result = $Array(length);
- var T;
- if (arguments.length > 1) {
- T = arguments[1];
- }
-
- // If no callback function or if callback is not a callable function
- if (!isCallable(callbackfn)) {
- throw new TypeError('Array.prototype.map callback must be a function');
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self) {
- if (typeof T === 'undefined') {
- result[i] = callbackfn(self[i], i, object);
- } else {
- result[i] = callbackfn.call(T, self[i], i, object);
- }
- }
- }
- return result;
- }
- }, !properlyBoxesContext(ArrayPrototype.map));
-
- // ES5 15.4.4.20
- // http://es5.github.com/#x15.4.4.20
- // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
- defineProperties(ArrayPrototype, {
- filter: function filter(callbackfn/*, thisArg*/) {
- var object = ES.ToObject(this);
- var self = splitString && isString(this) ? strSplit(this, '') : object;
- var length = ES.ToUint32(self.length);
- var result = [];
- var value;
- var T;
- if (arguments.length > 1) {
- T = arguments[1];
- }
-
- // If no callback function or if callback is not a callable function
- if (!isCallable(callbackfn)) {
- throw new TypeError('Array.prototype.filter callback must be a function');
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self) {
- value = self[i];
- if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) {
- pushCall(result, value);
- }
- }
- }
- return result;
- }
- }, !properlyBoxesContext(ArrayPrototype.filter));
-
- // ES5 15.4.4.16
- // http://es5.github.com/#x15.4.4.16
- // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
- defineProperties(ArrayPrototype, {
- every: function every(callbackfn/*, thisArg*/) {
- var object = ES.ToObject(this);
- var self = splitString && isString(this) ? strSplit(this, '') : object;
- var length = ES.ToUint32(self.length);
- var T;
- if (arguments.length > 1) {
- T = arguments[1];
- }
-
- // If no callback function or if callback is not a callable function
- if (!isCallable(callbackfn)) {
- throw new TypeError('Array.prototype.every callback must be a function');
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self && !(typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
- return false;
- }
- }
- return true;
- }
- }, !properlyBoxesContext(ArrayPrototype.every));
-
- // ES5 15.4.4.17
- // http://es5.github.com/#x15.4.4.17
- // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
- defineProperties(ArrayPrototype, {
- some: function some(callbackfn/*, thisArg */) {
- var object = ES.ToObject(this);
- var self = splitString && isString(this) ? strSplit(this, '') : object;
- var length = ES.ToUint32(self.length);
- var T;
- if (arguments.length > 1) {
- T = arguments[1];
- }
-
- // If no callback function or if callback is not a callable function
- if (!isCallable(callbackfn)) {
- throw new TypeError('Array.prototype.some callback must be a function');
- }
-
- for (var i = 0; i < length; i++) {
- if (i in self && (typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
- return true;
- }
- }
- return false;
- }
- }, !properlyBoxesContext(ArrayPrototype.some));
-
- // ES5 15.4.4.21
- // http://es5.github.com/#x15.4.4.21
- // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
- var reduceCoercesToObject = false;
- if (ArrayPrototype.reduce) {
- reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) {
- return list;
- }) === 'object';
- }
- defineProperties(ArrayPrototype, {
- reduce: function reduce(callbackfn/*, initialValue*/) {
- var object = ES.ToObject(this);
- var self = splitString && isString(this) ? strSplit(this, '') : object;
- var length = ES.ToUint32(self.length);
-
- // If no callback function or if callback is not a callable function
- if (!isCallable(callbackfn)) {
- throw new TypeError('Array.prototype.reduce callback must be a function');
- }
-
- // no value to return if no initial value and an empty array
- if (length === 0 && arguments.length === 1) {
- throw new TypeError('reduce of empty array with no initial value');
- }
-
- var i = 0;
- var result;
- if (arguments.length >= 2) {
- result = arguments[1];
- } else {
- do {
- if (i in self) {
- result = self[i++];
- break;
- }
-
- // if array contains no values, no initial value to return
- if (++i >= length) {
- throw new TypeError('reduce of empty array with no initial value');
- }
- } while (true);
- }
-
- for (; i < length; i++) {
- if (i in self) {
- result = callbackfn(result, self[i], i, object);
- }
- }
-
- return result;
- }
- }, !reduceCoercesToObject);
-
- // ES5 15.4.4.22
- // http://es5.github.com/#x15.4.4.22
- // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
- var reduceRightCoercesToObject = false;
- if (ArrayPrototype.reduceRight) {
- reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) {
- return list;
- }) === 'object';
- }
- defineProperties(ArrayPrototype, {
- reduceRight: function reduceRight(callbackfn/*, initial*/) {
- var object = ES.ToObject(this);
- var self = splitString && isString(this) ? strSplit(this, '') : object;
- var length = ES.ToUint32(self.length);
-
- // If no callback function or if callback is not a callable function
- if (!isCallable(callbackfn)) {
- throw new TypeError('Array.prototype.reduceRight callback must be a function');
- }
-
- // no value to return if no initial value, empty array
- if (length === 0 && arguments.length === 1) {
- throw new TypeError('reduceRight of empty array with no initial value');
- }
-
- var result;
- var i = length - 1;
- if (arguments.length >= 2) {
- result = arguments[1];
- } else {
- do {
- if (i in self) {
- result = self[i--];
- break;
- }
-
- // if array contains no values, no initial value to return
- if (--i < 0) {
- throw new TypeError('reduceRight of empty array with no initial value');
- }
- } while (true);
- }
-
- if (i < 0) {
- return result;
- }
-
- do {
- if (i in self) {
- result = callbackfn(result, self[i], i, object);
- }
- } while (i--);
-
- return result;
- }
- }, !reduceRightCoercesToObject);
-
- // ES5 15.4.4.14
- // http://es5.github.com/#x15.4.4.14
- // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
- var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
- defineProperties(ArrayPrototype, {
- indexOf: function indexOf(searchElement/*, fromIndex */) {
- var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
- var length = ES.ToUint32(self.length);
-
- if (length === 0) {
- return -1;
- }
-
- var i = 0;
- if (arguments.length > 1) {
- i = ES.ToInteger(arguments[1]);
- }
-
- // handle negative indices
- i = i >= 0 ? i : max(0, length + i);
- for (; i < length; i++) {
- if (i in self && self[i] === searchElement) {
- return i;
- }
- }
- return -1;
- }
- }, hasFirefox2IndexOfBug);
-
- // ES5 15.4.4.15
- // http://es5.github.com/#x15.4.4.15
- // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
- var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1;
- defineProperties(ArrayPrototype, {
- lastIndexOf: function lastIndexOf(searchElement/*, fromIndex */) {
- var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
- var length = ES.ToUint32(self.length);
-
- if (length === 0) {
- return -1;
- }
- var i = length - 1;
- if (arguments.length > 1) {
- i = min(i, ES.ToInteger(arguments[1]));
- }
- // handle negative indices
- i = i >= 0 ? i : length - Math.abs(i);
- for (; i >= 0; i--) {
- if (i in self && searchElement === self[i]) {
- return i;
- }
- }
- return -1;
- }
- }, hasFirefox2LastIndexOfBug);
-
- // ES5 15.4.4.12
- // http://es5.github.com/#x15.4.4.12
- var spliceNoopReturnsEmptyArray = (function () {
- var a = [1, 2];
- var result = a.splice();
- return a.length === 2 && isArray(result) && result.length === 0;
- }());
- defineProperties(ArrayPrototype, {
- // Safari 5.0 bug where .splice() returns undefined
- splice: function splice(start, deleteCount) {
- if (arguments.length === 0) {
- return [];
- } else {
- return array_splice.apply(this, arguments);
- }
- }
- }, !spliceNoopReturnsEmptyArray);
-
- var spliceWorksWithEmptyObject = (function () {
- var obj = {};
- ArrayPrototype.splice.call(obj, 0, 0, 1);
- return obj.length === 1;
- }());
- defineProperties(ArrayPrototype, {
- splice: function splice(start, deleteCount) {
- if (arguments.length === 0) {
- return [];
- }
- var args = arguments;
- this.length = max(ES.ToInteger(this.length), 0);
- if (arguments.length > 0 && typeof deleteCount !== 'number') {
- args = arraySlice(arguments);
- if (args.length < 2) {
- pushCall(args, this.length - start);
- } else {
- args[1] = ES.ToInteger(deleteCount);
- }
- }
- return array_splice.apply(this, args);
- }
- }, !spliceWorksWithEmptyObject);
- var spliceWorksWithLargeSparseArrays = (function () {
- // Per https://github.com/es-shims/es5-shim/issues/295
- // Safari 7/8 breaks with sparse arrays of size 1e5 or greater
- var arr = new $Array(1e5);
- // note: the index MUST be 8 or larger or the test will false pass
- arr[8] = 'x';
- arr.splice(1, 1);
- // note: this test must be defined *after* the indexOf shim
- // per https://github.com/es-shims/es5-shim/issues/313
- return arr.indexOf('x') === 7;
- }());
- var spliceWorksWithSmallSparseArrays = (function () {
- // Per https://github.com/es-shims/es5-shim/issues/295
- // Opera 12.15 breaks on this, no idea why.
- var n = 256;
- var arr = [];
- arr[n] = 'a';
- arr.splice(n + 1, 0, 'b');
- return arr[n] === 'a';
- }());
- defineProperties(ArrayPrototype, {
- splice: function splice(start, deleteCount) {
- var O = ES.ToObject(this);
- var A = [];
- var len = ES.ToUint32(O.length);
- var relativeStart = ES.ToInteger(start);
- var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len);
- var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart);
-
- var k = 0;
- var from;
- while (k < actualDeleteCount) {
- from = $String(actualStart + k);
- if (owns(O, from)) {
- A[k] = O[from];
- }
- k += 1;
- }
-
- var items = arraySlice(arguments, 2);
- var itemCount = items.length;
- var to;
- if (itemCount < actualDeleteCount) {
- k = actualStart;
- var maxK = len - actualDeleteCount;
- while (k < maxK) {
- from = $String(k + actualDeleteCount);
- to = $String(k + itemCount);
- if (owns(O, from)) {
- O[to] = O[from];
- } else {
- delete O[to];
- }
- k += 1;
- }
- k = len;
- var minK = len - actualDeleteCount + itemCount;
- while (k > minK) {
- delete O[k - 1];
- k -= 1;
- }
- } else if (itemCount > actualDeleteCount) {
- k = len - actualDeleteCount;
- while (k > actualStart) {
- from = $String(k + actualDeleteCount - 1);
- to = $String(k + itemCount - 1);
- if (owns(O, from)) {
- O[to] = O[from];
- } else {
- delete O[to];
- }
- k -= 1;
- }
- }
- k = actualStart;
- for (var i = 0; i < items.length; ++i) {
- O[k] = items[i];
- k += 1;
- }
- O.length = len - actualDeleteCount + itemCount;
-
- return A;
- }
- }, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays);
-
- var originalJoin = ArrayPrototype.join;
- var hasStringJoinBug;
- try {
- hasStringJoinBug = Array.prototype.join.call('123', ',') !== '1,2,3';
- } catch (e) {
- hasStringJoinBug = true;
- }
- if (hasStringJoinBug) {
- defineProperties(ArrayPrototype, {
- join: function join(separator) {
- var sep = typeof separator === 'undefined' ? ',' : separator;
- return originalJoin.call(isString(this) ? strSplit(this, '') : this, sep);
- }
- }, hasStringJoinBug);
- }
-
- var hasJoinUndefinedBug = [1, 2].join(undefined) !== '1,2';
- if (hasJoinUndefinedBug) {
- defineProperties(ArrayPrototype, {
- join: function join(separator) {
- var sep = typeof separator === 'undefined' ? ',' : separator;
- return originalJoin.call(this, sep);
- }
- }, hasJoinUndefinedBug);
- }
-
- var pushShim = function push(item) {
- var O = ES.ToObject(this);
- var n = ES.ToUint32(O.length);
- var i = 0;
- while (i < arguments.length) {
- O[n + i] = arguments[i];
- i += 1;
- }
- O.length = n + i;
- return n + i;
- };
-
- var pushIsNotGeneric = (function () {
- var obj = {};
- var result = Array.prototype.push.call(obj, undefined);
- return result !== 1 || obj.length !== 1 || typeof obj[0] !== 'undefined' || !owns(obj, 0);
- }());
- defineProperties(ArrayPrototype, {
- push: function push(item) {
- if (isArray(this)) {
- return array_push.apply(this, arguments);
- }
- return pushShim.apply(this, arguments);
- }
- }, pushIsNotGeneric);
-
- // This fixes a very weird bug in Opera 10.6 when pushing `undefined
- var pushUndefinedIsWeird = (function () {
- var arr = [];
- var result = arr.push(undefined);
- return result !== 1 || arr.length !== 1 || typeof arr[0] !== 'undefined' || !owns(arr, 0);
- }());
- defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird);
-
- // ES5 15.2.3.14
- // http://es5.github.io/#x15.4.4.10
- // Fix boxed string bug
- defineProperties(ArrayPrototype, {
- slice: function (start, end) {
- var arr = isString(this) ? strSplit(this, '') : this;
- return arraySliceApply(arr, arguments);
- }
- }, splitString);
-
- var sortIgnoresNonFunctions = (function () {
- try {
- [1, 2].sort(null);
- [1, 2].sort({});
- return true;
- } catch (e) {}
- return false;
- }());
- var sortThrowsOnRegex = (function () {
- // this is a problem in Firefox 4, in which `typeof /a/ === 'function'`
- try {
- [1, 2].sort(/a/);
- return false;
- } catch (e) {}
- return true;
- }());
- var sortIgnoresUndefined = (function () {
- // applies in IE 8, for one.
- try {
- [1, 2].sort(undefined);
- return true;
- } catch (e) {}
- return false;
- }());
- defineProperties(ArrayPrototype, {
- sort: function sort(compareFn) {
- if (typeof compareFn === 'undefined') {
- return arraySort(this);
- }
- if (!isCallable(compareFn)) {
- throw new TypeError('Array.prototype.sort callback must be a function');
- }
- return arraySort(this, compareFn);
- }
- }, sortIgnoresNonFunctions || !sortIgnoresUndefined || !sortThrowsOnRegex);
-
- //
- // Object
- // ======
- //
-
- // ES5 15.2.3.14
- // http://es5.github.com/#x15.2.3.14
-
- // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
- var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString');
- var hasProtoEnumBug = isEnum(function () {}, 'prototype');
- var hasStringEnumBug = !owns('x', '0');
- var equalsConstructorPrototype = function (o) {
- var ctor = o.constructor;
- return ctor && ctor.prototype === o;
- };
- var blacklistedKeys = {
- $window: true,
- $console: true,
- $parent: true,
- $self: true,
- $frame: true,
- $frames: true,
- $frameElement: true,
- $webkitIndexedDB: true,
- $webkitStorageInfo: true,
- $external: true
- };
- var hasAutomationEqualityBug = (function () {
- /* globals window */
- if (typeof window === 'undefined') {
- return false;
- }
- for (var k in window) {
- try {
- if (!blacklistedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') {
- equalsConstructorPrototype(window[k]);
- }
- } catch (e) {
- return true;
- }
- }
- return false;
- }());
- var equalsConstructorPrototypeIfNotBuggy = function (object) {
- if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
- return equalsConstructorPrototype(object);
- }
- try {
- return equalsConstructorPrototype(object);
- } catch (e) {
- return false;
- }
- };
- var dontEnums = [
- 'toString',
- 'toLocaleString',
- 'valueOf',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'constructor'
- ];
- var dontEnumsLength = dontEnums.length;
-
- // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js
- // can be replaced with require('is-arguments') if we ever use a build process instead
- var isStandardArguments = function isArguments(value) {
- return toStr(value) === '[object Arguments]';
- };
- var isLegacyArguments = function isArguments(value) {
- return value !== null &&
- typeof value === 'object' &&
- typeof value.length === 'number' &&
- value.length >= 0 &&
- !isArray(value) &&
- isCallable(value.callee);
- };
- var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;
-
- defineProperties($Object, {
- keys: function keys(object) {
- var isFn = isCallable(object);
- var isArgs = isArguments(object);
- var isObject = object !== null && typeof object === 'object';
- var isStr = isObject && isString(object);
-
- if (!isObject && !isFn && !isArgs) {
- throw new TypeError('Object.keys called on a non-object');
- }
-
- var theKeys = [];
- var skipProto = hasProtoEnumBug && isFn;
- if ((isStr && hasStringEnumBug) || isArgs) {
- for (var i = 0; i < object.length; ++i) {
- pushCall(theKeys, $String(i));
- }
- }
-
- if (!isArgs) {
- for (var name in object) {
- if (!(skipProto && name === 'prototype') && owns(object, name)) {
- pushCall(theKeys, $String(name));
- }
- }
- }
-
- if (hasDontEnumBug) {
- var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
- for (var j = 0; j < dontEnumsLength; j++) {
- var dontEnum = dontEnums[j];
- if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) {
- pushCall(theKeys, dontEnum);
- }
- }
- }
- return theKeys;
- }
- });
-
- var keysWorksWithArguments = $Object.keys && (function () {
- // Safari 5.0 bug
- return $Object.keys(arguments).length === 2;
- }(1, 2));
- var keysHasArgumentsLengthBug = $Object.keys && (function () {
- var argKeys = $Object.keys(arguments);
- return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
- }(1));
- var originalKeys = $Object.keys;
- defineProperties($Object, {
- keys: function keys(object) {
- if (isArguments(object)) {
- return originalKeys(arraySlice(object));
- } else {
- return originalKeys(object);
- }
- }
- }, !keysWorksWithArguments || keysHasArgumentsLengthBug);
-
- //
- // Date
- // ====
- //
-
- var hasNegativeMonthYearBug = new Date(-3509827329600292).getUTCMonth() !== 0;
- var aNegativeTestDate = new Date(-1509842289600292);
- var aPositiveTestDate = new Date(1449662400000);
- var hasToUTCStringFormatBug = aNegativeTestDate.toUTCString() !== 'Mon, 01 Jan -45875 11:59:59 GMT';
- var hasToDateStringFormatBug;
- var hasToStringFormatBug;
- var timeZoneOffset = aNegativeTestDate.getTimezoneOffset();
- if (timeZoneOffset < -720) {
- hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875';
- hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
- } else {
- hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875';
- hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
- }
-
- var originalGetFullYear = call.bind(Date.prototype.getFullYear);
- var originalGetMonth = call.bind(Date.prototype.getMonth);
- var originalGetDate = call.bind(Date.prototype.getDate);
- var originalGetUTCFullYear = call.bind(Date.prototype.getUTCFullYear);
- var originalGetUTCMonth = call.bind(Date.prototype.getUTCMonth);
- var originalGetUTCDate = call.bind(Date.prototype.getUTCDate);
- var originalGetUTCDay = call.bind(Date.prototype.getUTCDay);
- var originalGetUTCHours = call.bind(Date.prototype.getUTCHours);
- var originalGetUTCMinutes = call.bind(Date.prototype.getUTCMinutes);
- var originalGetUTCSeconds = call.bind(Date.prototype.getUTCSeconds);
- var originalGetUTCMilliseconds = call.bind(Date.prototype.getUTCMilliseconds);
- var dayName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
- var monthName = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
- var daysInMonth = function daysInMonth(month, year) {
- return originalGetDate(new Date(year, month, 0));
- };
-
- defineProperties(Date.prototype, {
- getFullYear: function getFullYear() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var year = originalGetFullYear(this);
- if (year < 0 && originalGetMonth(this) > 11) {
- return year + 1;
- }
- return year;
- },
- getMonth: function getMonth() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var year = originalGetFullYear(this);
- var month = originalGetMonth(this);
- if (year < 0 && month > 11) {
- return 0;
- }
- return month;
- },
- getDate: function getDate() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var year = originalGetFullYear(this);
- var month = originalGetMonth(this);
- var date = originalGetDate(this);
- if (year < 0 && month > 11) {
- if (month === 12) {
- return date;
- }
- var days = daysInMonth(0, year + 1);
- return (days - date) + 1;
- }
- return date;
- },
- getUTCFullYear: function getUTCFullYear() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var year = originalGetUTCFullYear(this);
- if (year < 0 && originalGetUTCMonth(this) > 11) {
- return year + 1;
- }
- return year;
- },
- getUTCMonth: function getUTCMonth() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var year = originalGetUTCFullYear(this);
- var month = originalGetUTCMonth(this);
- if (year < 0 && month > 11) {
- return 0;
- }
- return month;
- },
- getUTCDate: function getUTCDate() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var year = originalGetUTCFullYear(this);
- var month = originalGetUTCMonth(this);
- var date = originalGetUTCDate(this);
- if (year < 0 && month > 11) {
- if (month === 12) {
- return date;
- }
- var days = daysInMonth(0, year + 1);
- return (days - date) + 1;
- }
- return date;
- }
- }, hasNegativeMonthYearBug);
-
- defineProperties(Date.prototype, {
- toUTCString: function toUTCString() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var day = originalGetUTCDay(this);
- var date = originalGetUTCDate(this);
- var month = originalGetUTCMonth(this);
- var year = originalGetUTCFullYear(this);
- var hour = originalGetUTCHours(this);
- var minute = originalGetUTCMinutes(this);
- var second = originalGetUTCSeconds(this);
- return dayName[day] + ', ' +
- (date < 10 ? '0' + date : date) + ' ' +
- monthName[month] + ' ' +
- year + ' ' +
- (hour < 10 ? '0' + hour : hour) + ':' +
- (minute < 10 ? '0' + minute : minute) + ':' +
- (second < 10 ? '0' + second : second) + ' GMT';
- }
- }, hasNegativeMonthYearBug || hasToUTCStringFormatBug);
-
- // Opera 12 has `,`
- defineProperties(Date.prototype, {
- toDateString: function toDateString() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var day = this.getDay();
- var date = this.getDate();
- var month = this.getMonth();
- var year = this.getFullYear();
- return dayName[day] + ' ' +
- monthName[month] + ' ' +
- (date < 10 ? '0' + date : date) + ' ' +
- year;
- }
- }, hasNegativeMonthYearBug || hasToDateStringFormatBug);
-
- // can't use defineProperties here because of toString enumeration issue in IE <= 8
- if (hasNegativeMonthYearBug || hasToStringFormatBug) {
- Date.prototype.toString = function toString() {
- if (!this || !(this instanceof Date)) {
- throw new TypeError('this is not a Date object.');
- }
- var day = this.getDay();
- var date = this.getDate();
- var month = this.getMonth();
- var year = this.getFullYear();
- var hour = this.getHours();
- var minute = this.getMinutes();
- var second = this.getSeconds();
- var timezoneOffset = this.getTimezoneOffset();
- var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60);
- var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60);
- return dayName[day] + ' ' +
- monthName[month] + ' ' +
- (date < 10 ? '0' + date : date) + ' ' +
- year + ' ' +
- (hour < 10 ? '0' + hour : hour) + ':' +
- (minute < 10 ? '0' + minute : minute) + ':' +
- (second < 10 ? '0' + second : second) + ' GMT' +
- (timezoneOffset > 0 ? '-' : '+') +
- (hoursOffset < 10 ? '0' + hoursOffset : hoursOffset) +
- (minutesOffset < 10 ? '0' + minutesOffset : minutesOffset);
- };
- if (supportsDescriptors) {
- $Object.defineProperty(Date.prototype, 'toString', {
- configurable: true,
- enumerable: false,
- writable: true
- });
- }
- }
-
- // ES5 15.9.5.43
- // http://es5.github.com/#x15.9.5.43
- // This function returns a String value represent the instance in time
- // represented by this Date object. The format of the String is the Date Time
- // string format defined in 15.9.1.15. All fields are present in the String.
- // The time zone is always UTC, denoted by the suffix Z. If the time value of
- // this object is not a finite Number a RangeError exception is thrown.
- var negativeDate = -62198755200000;
- var negativeYearString = '-000001';
- var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1;
- var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z';
-
- var getTime = call.bind(Date.prototype.getTime);
-
- defineProperties(Date.prototype, {
- toISOString: function toISOString() {
- if (!isFinite(this) || !isFinite(getTime(this))) {
- // Adope Photoshop requires the second check.
- throw new RangeError('Date.prototype.toISOString called on non-finite value.');
- }
-
- var year = originalGetUTCFullYear(this);
-
- var month = originalGetUTCMonth(this);
- // see https://github.com/es-shims/es5-shim/issues/111
- year += Math.floor(month / 12);
- month = (month % 12 + 12) % 12;
-
- // the date time string format is specified in 15.9.1.15.
- var result = [month + 1, originalGetUTCDate(this), originalGetUTCHours(this), originalGetUTCMinutes(this), originalGetUTCSeconds(this)];
- year = (
- (year < 0 ? '-' : (year > 9999 ? '+' : '')) +
- strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
- );
-
- for (var i = 0; i < result.length; ++i) {
- // pad months, days, hours, minutes, and seconds to have two digits.
- result[i] = strSlice('00' + result[i], -2);
- }
- // pad milliseconds to have three digits.
- return (
- year + '-' + arraySlice(result, 0, 2).join('-') +
- 'T' + arraySlice(result, 2).join(':') + '.' +
- strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z'
- );
- }
- }, hasNegativeDateBug || hasSafari51DateBug);
-
- // ES5 15.9.5.44
- // http://es5.github.com/#x15.9.5.44
- // This function provides a String representation of a Date object for use by
- // JSON.stringify (15.12.3).
- var dateToJSONIsSupported = (function () {
- try {
- return Date.prototype.toJSON &&
- new Date(NaN).toJSON() === null &&
- new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 &&
- Date.prototype.toJSON.call({ // generic
- toISOString: function () { return true; }
- });
- } catch (e) {
- return false;
- }
- }());
- if (!dateToJSONIsSupported) {
- Date.prototype.toJSON = function toJSON(key) {
- // When the toJSON method is called with argument key, the following
- // steps are taken:
-
- // 1. Let O be the result of calling ToObject, giving it the this
- // value as its argument.
- // 2. Let tv be ES.ToPrimitive(O, hint Number).
- var O = $Object(this);
- var tv = ES.ToPrimitive(O);
- // 3. If tv is a Number and is not finite, return null.
- if (typeof tv === 'number' && !isFinite(tv)) {
- return null;
- }
- // 4. Let toISO be the result of calling the [[Get]] internal method of
- // O with argument "toISOString".
- var toISO = O.toISOString;
- // 5. If IsCallable(toISO) is false, throw a TypeError exception.
- if (!isCallable(toISO)) {
- throw new TypeError('toISOString property is not callable');
- }
- // 6. Return the result of calling the [[Call]] internal method of
- // toISO with O as the this value and an empty argument list.
- return toISO.call(O);
-
- // NOTE 1 The argument is ignored.
-
- // NOTE 2 The toJSON function is intentionally generic; it does not
- // require that its this value be a Date object. Therefore, it can be
- // transferred to other kinds of objects for use as a method. However,
- // it does require that any such object have a toISOString method. An
- // object is free to use the argument key to filter its
- // stringification.
- };
- }
-
- // ES5 15.9.4.2
- // http://es5.github.com/#x15.9.4.2
- // based on work shared by Daniel Friesen (dantman)
- // http://gist.github.com/303249
- var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15;
- var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z'));
- var doesNotParseY2KNewYear = isNaN(Date.parse('2000-01-01T00:00:00.000Z'));
- if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
- // XXX global assignment won't work in embeddings that use
- // an alternate object for the context.
- /* global Date: true */
- /* eslint-disable no-undef */
- var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1;
- var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
- /* eslint-disable no-implicit-globals */
- Date = (function (NativeDate) {
- /* eslint-enable no-implicit-globals */
- /* eslint-enable no-undef */
- // Date.length === 7
- var DateShim = function Date(Y, M, D, h, m, s, ms) {
- var length = arguments.length;
- var date;
- if (this instanceof NativeDate) {
- var seconds = s;
- var millis = ms;
- if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) {
- // work around a Safari 8/9 bug where it treats the seconds as signed
- var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
- var sToShift = Math.floor(msToShift / 1e3);
- seconds += sToShift;
- millis -= sToShift * 1e3;
- }
- date = length === 1 && $String(Y) === Y ? // isString(Y)
- // We explicitly pass it through parse:
- new NativeDate(DateShim.parse(Y)) :
- // We have to manually make calls depending on argument
- // length here
- length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) :
- length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) :
- length >= 5 ? new NativeDate(Y, M, D, h, m) :
- length >= 4 ? new NativeDate(Y, M, D, h) :
- length >= 3 ? new NativeDate(Y, M, D) :
- length >= 2 ? new NativeDate(Y, M) :
- length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) :
- new NativeDate();
- } else {
- date = NativeDate.apply(this, arguments);
- }
- if (!isPrimitive(date)) {
- // Prevent mixups with unfixed Date object
- defineProperties(date, { constructor: DateShim }, true);
- }
- return date;
- };
-
- // 15.9.1.15 Date Time String Format.
- var isoDateExpression = new RegExp('^' +
- '(\\d{4}|[+-]\\d{6})' + // four-digit year capture or sign +
- // 6-digit extended year
- '(?:-(\\d{2})' + // optional month capture
- '(?:-(\\d{2})' + // optional day capture
- '(?:' + // capture hours:minutes:seconds.milliseconds
- 'T(\\d{2})' + // hours capture
- ':(\\d{2})' + // minutes capture
- '(?:' + // optional :seconds.milliseconds
- ':(\\d{2})' + // seconds capture
- '(?:(\\.\\d{1,}))?' + // milliseconds capture
- ')?' +
- '(' + // capture UTC offset component
- 'Z|' + // UTC capture
- '(?:' + // offset specifier +/-hours:minutes
- '([-+])' + // sign capture
- '(\\d{2})' + // hours offset capture
- ':(\\d{2})' + // minutes offset capture
- ')' +
- ')?)?)?)?' +
- '$');
-
- var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
-
- var dayFromMonth = function dayFromMonth(year, month) {
- var t = month > 1 ? 1 : 0;
- return (
- months[month] +
- Math.floor((year - 1969 + t) / 4) -
- Math.floor((year - 1901 + t) / 100) +
- Math.floor((year - 1601 + t) / 400) +
- 365 * (year - 1970)
- );
- };
-
- var toUTC = function toUTC(t) {
- var s = 0;
- var ms = t;
- if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
- // work around a Safari 8/9 bug where it treats the seconds as signed
- var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
- var sToShift = Math.floor(msToShift / 1e3);
- s += sToShift;
- ms -= sToShift * 1e3;
- }
- return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms));
- };
-
- // Copy any custom methods a 3rd party library may have added
- for (var key in NativeDate) {
- if (owns(NativeDate, key)) {
- DateShim[key] = NativeDate[key];
- }
- }
-
- // Copy "native" methods explicitly; they may be non-enumerable
- defineProperties(DateShim, {
- now: NativeDate.now,
- UTC: NativeDate.UTC
- }, true);
- DateShim.prototype = NativeDate.prototype;
- defineProperties(DateShim.prototype, {
- constructor: DateShim
- }, true);
-
- // Upgrade Date.parse to handle simplified ISO 8601 strings
- var parseShim = function parse(string) {
- var match = isoDateExpression.exec(string);
- if (match) {
- // parse months, days, hours, minutes, seconds, and milliseconds
- // provide default values if necessary
- // parse the UTC offset component
- var year = $Number(match[1]),
- month = $Number(match[2] || 1) - 1,
- day = $Number(match[3] || 1) - 1,
- hour = $Number(match[4] || 0),
- minute = $Number(match[5] || 0),
- second = $Number(match[6] || 0),
- millisecond = Math.floor($Number(match[7] || 0) * 1000),
- // When time zone is missed, local offset should be used
- // (ES 5.1 bug)
- // see https://bugs.ecmascript.org/show_bug.cgi?id=112
- isLocalTime = Boolean(match[4] && !match[8]),
- signOffset = match[9] === '-' ? 1 : -1,
- hourOffset = $Number(match[10] || 0),
- minuteOffset = $Number(match[11] || 0),
- result;
- var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0;
- if (
- hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) &&
- minute < 60 && second < 60 && millisecond < 1000 &&
- month > -1 && month < 12 && hourOffset < 24 &&
- minuteOffset < 60 && // detect invalid offsets
- day > -1 &&
- day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month))
- ) {
- result = (
- (dayFromMonth(year, month) + day) * 24 +
- hour +
- hourOffset * signOffset
- ) * 60;
- result = (
- (result + minute + minuteOffset * signOffset) * 60 +
- second
- ) * 1000 + millisecond;
- if (isLocalTime) {
- result = toUTC(result);
- }
- if (-8.64e15 <= result && result <= 8.64e15) {
- return result;
- }
- }
- return NaN;
- }
- return NativeDate.parse.apply(this, arguments);
- };
- defineProperties(DateShim, { parse: parseShim });
-
- return DateShim;
- }(Date));
- /* global Date: false */
- }
-
- // ES5 15.9.4.4
- // http://es5.github.com/#x15.9.4.4
- if (!Date.now) {
- Date.now = function now() {
- return new Date().getTime();
- };
- }
-
- //
- // Number
- // ======
- //
-
- // ES5.1 15.7.4.5
- // http://es5.github.com/#x15.7.4.5
- var hasToFixedBugs = NumberPrototype.toFixed && (
- (0.00008).toFixed(3) !== '0.000' ||
- (0.9).toFixed(0) !== '1' ||
- (1.255).toFixed(2) !== '1.25' ||
- (1000000000000000128).toFixed(0) !== '1000000000000000128'
- );
-
- var toFixedHelpers = {
- base: 1e7,
- size: 6,
- data: [0, 0, 0, 0, 0, 0],
- multiply: function multiply(n, c) {
- var i = -1;
- var c2 = c;
- while (++i < toFixedHelpers.size) {
- c2 += n * toFixedHelpers.data[i];
- toFixedHelpers.data[i] = c2 % toFixedHelpers.base;
- c2 = Math.floor(c2 / toFixedHelpers.base);
- }
- },
- divide: function divide(n) {
- var i = toFixedHelpers.size;
- var c = 0;
- while (--i >= 0) {
- c += toFixedHelpers.data[i];
- toFixedHelpers.data[i] = Math.floor(c / n);
- c = (c % n) * toFixedHelpers.base;
- }
- },
- numToString: function numToString() {
- var i = toFixedHelpers.size;
- var s = '';
- while (--i >= 0) {
- if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) {
- var t = $String(toFixedHelpers.data[i]);
- if (s === '') {
- s = t;
- } else {
- s += strSlice('0000000', 0, 7 - t.length) + t;
- }
- }
- }
- return s;
- },
- pow: function pow(x, n, acc) {
- return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc)));
- },
- log: function log(x) {
- var n = 0;
- var x2 = x;
- while (x2 >= 4096) {
- n += 12;
- x2 /= 4096;
- }
- while (x2 >= 2) {
- n += 1;
- x2 /= 2;
- }
- return n;
- }
- };
-
- var toFixedShim = function toFixed(fractionDigits) {
- var f, x, s, m, e, z, j, k;
-
- // Test for NaN and round fractionDigits down
- f = $Number(fractionDigits);
- f = isActualNaN(f) ? 0 : Math.floor(f);
-
- if (f < 0 || f > 20) {
- throw new RangeError('Number.toFixed called with invalid number of decimals');
- }
-
- x = $Number(this);
-
- if (isActualNaN(x)) {
- return 'NaN';
- }
-
- // If it is too big or small, return the string value of the number
- if (x <= -1e21 || x >= 1e21) {
- return $String(x);
- }
-
- s = '';
-
- if (x < 0) {
- s = '-';
- x = -x;
- }
-
- m = '0';
-
- if (x > 1e-21) {
- // 1e-21 < x < 1e21
- // -70 < log2(x) < 70
- e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69;
- z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1));
- z *= 0x10000000000000; // Math.pow(2, 52);
- e = 52 - e;
-
- // -18 < e < 122
- // x = z / 2 ^ e
- if (e > 0) {
- toFixedHelpers.multiply(0, z);
- j = f;
-
- while (j >= 7) {
- toFixedHelpers.multiply(1e7, 0);
- j -= 7;
- }
-
- toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0);
- j = e - 1;
-
- while (j >= 23) {
- toFixedHelpers.divide(1 << 23);
- j -= 23;
- }
-
- toFixedHelpers.divide(1 << j);
- toFixedHelpers.multiply(1, 1);
- toFixedHelpers.divide(2);
- m = toFixedHelpers.numToString();
- } else {
- toFixedHelpers.multiply(0, z);
- toFixedHelpers.multiply(1 << (-e), 0);
- m = toFixedHelpers.numToString() + strSlice('0.00000000000000000000', 2, 2 + f);
- }
- }
-
- if (f > 0) {
- k = m.length;
-
- if (k <= f) {
- m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m;
- } else {
- m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f);
- }
- } else {
- m = s + m;
- }
-
- return m;
- };
- defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs);
-
- var hasToPrecisionUndefinedBug = (function () {
- try {
- return 1.0.toPrecision(undefined) === '1';
- } catch (e) {
- return true;
- }
- }());
- var originalToPrecision = NumberPrototype.toPrecision;
- defineProperties(NumberPrototype, {
- toPrecision: function toPrecision(precision) {
- return typeof precision === 'undefined' ? originalToPrecision.call(this) : originalToPrecision.call(this, precision);
- }
- }, hasToPrecisionUndefinedBug);
-
- //
- // String
- // ======
- //
-
- // ES5 15.5.4.14
- // http://es5.github.com/#x15.5.4.14
-
- // [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
- // Many browsers do not split properly with regular expressions or they
- // do not perform the split correctly under obscure conditions.
- // See http://blog.stevenlevithan.com/archives/cross-browser-split
- // I've tested in many browsers and this seems to cover the deviant ones:
- // 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
- // '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
- // 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
- // [undefined, "t", undefined, "e", ...]
- // ''.split(/.?/) should be [], not [""]
- // '.'.split(/()()/) should be ["."], not ["", "", "."]
-
- if (
- 'ab'.split(/(?:ab)*/).length !== 2 ||
- '.'.split(/(.?)(.?)/).length !== 4 ||
- 'tesst'.split(/(s)*/)[1] === 't' ||
- 'test'.split(/(?:)/, -1).length !== 4 ||
- ''.split(/.?/).length ||
- '.'.split(/()()/).length > 1
- ) {
- (function () {
- var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
- var maxSafe32BitInt = Math.pow(2, 32) - 1;
-
- StringPrototype.split = function (separator, limit) {
- var string = String(this);
- if (typeof separator === 'undefined' && limit === 0) {
- return [];
- }
-
- // If `separator` is not a regex, use native split
- if (!isRegex(separator)) {
- return strSplit(this, separator, limit);
- }
-
- var output = [];
- var flags = (separator.ignoreCase ? 'i' : '') +
- (separator.multiline ? 'm' : '') +
- (separator.unicode ? 'u' : '') + // in ES6
- (separator.sticky ? 'y' : ''), // Firefox 3+ and ES6
- lastLastIndex = 0,
- // Make `global` and avoid `lastIndex` issues by working with a copy
- separator2, match, lastIndex, lastLength;
- var separatorCopy = new RegExp(separator.source, flags + 'g');
- if (!compliantExecNpcg) {
- // Doesn't need flags gy, but they don't hurt
- separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
- }
- /* Values for `limit`, per the spec:
- * If undefined: 4294967295 // maxSafe32BitInt
- * If 0, Infinity, or NaN: 0
- * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
- * If negative number: 4294967296 - Math.floor(Math.abs(limit))
- * If other: Type-convert, then use the above rules
- */
- var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit);
- match = separatorCopy.exec(string);
- while (match) {
- // `separatorCopy.lastIndex` is not reliable cross-browser
- lastIndex = match.index + match[0].length;
- if (lastIndex > lastLastIndex) {
- pushCall(output, strSlice(string, lastLastIndex, match.index));
- // Fix browsers whose `exec` methods don't consistently return `undefined` for
- // nonparticipating capturing groups
- if (!compliantExecNpcg && match.length > 1) {
- /* eslint-disable no-loop-func */
- match[0].replace(separator2, function () {
- for (var i = 1; i < arguments.length - 2; i++) {
- if (typeof arguments[i] === 'undefined') {
- match[i] = void 0;
- }
- }
- });
- /* eslint-enable no-loop-func */
- }
- if (match.length > 1 && match.index < string.length) {
- array_push.apply(output, arraySlice(match, 1));
- }
- lastLength = match[0].length;
- lastLastIndex = lastIndex;
- if (output.length >= splitLimit) {
- break;
- }
- }
- if (separatorCopy.lastIndex === match.index) {
- separatorCopy.lastIndex++; // Avoid an infinite loop
- }
- match = separatorCopy.exec(string);
- }
- if (lastLastIndex === string.length) {
- if (lastLength || !separatorCopy.test('')) {
- pushCall(output, '');
- }
- } else {
- pushCall(output, strSlice(string, lastLastIndex));
- }
- return output.length > splitLimit ? arraySlice(output, 0, splitLimit) : output;
- };
- }());
-
- // [bugfix, chrome]
- // If separator is undefined, then the result array contains just one String,
- // which is the this value (converted to a String). If limit is not undefined,
- // then the output array is truncated so that it contains no more than limit
- // elements.
- // "0".split(undefined, 0) -> []
- } else if ('0'.split(void 0, 0).length) {
- StringPrototype.split = function split(separator, limit) {
- if (typeof separator === 'undefined' && limit === 0) {
- return [];
- }
- return strSplit(this, separator, limit);
- };
- }
-
- var str_replace = StringPrototype.replace;
- var replaceReportsGroupsCorrectly = (function () {
- var groups = [];
- 'x'.replace(/x(.)?/g, function (match, group) {
- pushCall(groups, group);
- });
- return groups.length === 1 && typeof groups[0] === 'undefined';
- }());
-
- if (!replaceReportsGroupsCorrectly) {
- StringPrototype.replace = function replace(searchValue, replaceValue) {
- var isFn = isCallable(replaceValue);
- var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source);
- if (!isFn || !hasCapturingGroups) {
- return str_replace.call(this, searchValue, replaceValue);
- } else {
- var wrappedReplaceValue = function (match) {
- var length = arguments.length;
- var originalLastIndex = searchValue.lastIndex;
- searchValue.lastIndex = 0;
- var args = searchValue.exec(match) || [];
- searchValue.lastIndex = originalLastIndex;
- pushCall(args, arguments[length - 2], arguments[length - 1]);
- return replaceValue.apply(this, args);
- };
- return str_replace.call(this, searchValue, wrappedReplaceValue);
- }
- };
- }
-
- // ECMA-262, 3rd B.2.3
- // Not an ECMAScript standard, although ECMAScript 3rd Edition has a
- // non-normative section suggesting uniform semantics and it should be
- // normalized across all browsers
- // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
- var string_substr = StringPrototype.substr;
- var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
- defineProperties(StringPrototype, {
- substr: function substr(start, length) {
- var normalizedStart = start;
- if (start < 0) {
- normalizedStart = max(this.length + start, 0);
- }
- return string_substr.call(this, normalizedStart, length);
- }
- }, hasNegativeSubstrBug);
-
- // ES5 15.5.4.20
- // whitespace from: http://es5.github.io/#x15.5.4.20
- var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
- '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028' +
- '\u2029\uFEFF';
- var zeroWidth = '\u200b';
- var wsRegexChars = '[' + ws + ']';
- var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
- var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$');
- var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim());
- defineProperties(StringPrototype, {
- // http://blog.stevenlevithan.com/archives/faster-trim-javascript
- // http://perfectionkills.com/whitespace-deviations/
- trim: function trim() {
- if (typeof this === 'undefined' || this === null) {
- throw new TypeError("can't convert " + this + ' to object');
- }
- return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, '');
- }
- }, hasTrimWhitespaceBug);
- var trim = call.bind(String.prototype.trim);
-
- var hasLastIndexBug = StringPrototype.lastIndexOf && 'abcあい'.lastIndexOf('あい', 2) !== -1;
- defineProperties(StringPrototype, {
- lastIndexOf: function lastIndexOf(searchString) {
- if (typeof this === 'undefined' || this === null) {
- throw new TypeError("can't convert " + this + ' to object');
- }
- var S = $String(this);
- var searchStr = $String(searchString);
- var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN;
- var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos);
- var start = min(max(pos, 0), S.length);
- var searchLen = searchStr.length;
- var k = start + searchLen;
- while (k > 0) {
- k = max(0, k - searchLen);
- var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr);
- if (index !== -1) {
- return k + index;
- }
- }
- return -1;
- }
- }, hasLastIndexBug);
-
- var originalLastIndexOf = StringPrototype.lastIndexOf;
- defineProperties(StringPrototype, {
- lastIndexOf: function lastIndexOf(searchString) {
- return originalLastIndexOf.apply(this, arguments);
- }
- }, StringPrototype.lastIndexOf.length !== 1);
-
- // ES-5 15.1.2.2
- /* eslint-disable radix */
- if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
- /* eslint-enable radix */
- /* global parseInt: true */
- parseInt = (function (origParseInt) {
- var hexRegex = /^[\-+]?0[xX]/;
- return function parseInt(str, radix) {
- var string = trim(String(str));
- var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
- return origParseInt(string, defaultedRadix);
- };
- }(parseInt));
- }
-
- // https://es5.github.io/#x15.1.2.3
- if (1 / parseFloat('-0') !== -Infinity) {
- /* global parseFloat: true */
- parseFloat = (function (origParseFloat) {
- return function parseFloat(string) {
- var inputString = trim(String(string));
- var result = origParseFloat(inputString);
- return result === 0 && strSlice(inputString, 0, 1) === '-' ? -0 : result;
- };
- }(parseFloat));
- }
-
- if (String(new RangeError('test')) !== 'RangeError: test') {
- var errorToStringShim = function toString() {
- if (typeof this === 'undefined' || this === null) {
- throw new TypeError("can't convert " + this + ' to object');
- }
- var name = this.name;
- if (typeof name === 'undefined') {
- name = 'Error';
- } else if (typeof name !== 'string') {
- name = $String(name);
- }
- var msg = this.message;
- if (typeof msg === 'undefined') {
- msg = '';
- } else if (typeof msg !== 'string') {
- msg = $String(msg);
- }
- if (!name) {
- return msg;
- }
- if (!msg) {
- return name;
- }
- return name + ': ' + msg;
- };
- // can't use defineProperties here because of toString enumeration issue in IE <= 8
- Error.prototype.toString = errorToStringShim;
- }
-
- if (supportsDescriptors) {
- var ensureNonEnumerable = function (obj, prop) {
- if (isEnum(obj, prop)) {
- var desc = Object.getOwnPropertyDescriptor(obj, prop);
- if (desc.configurable) {
- desc.enumerable = false;
- Object.defineProperty(obj, prop, desc);
- }
- }
- };
- ensureNonEnumerable(Error.prototype, 'message');
- if (Error.prototype.message !== '') {
- Error.prototype.message = '';
- }
- ensureNonEnumerable(Error.prototype, 'name');
- }
-
- if (String(/a/mig) !== '/a/gim') {
- var regexToString = function toString() {
- var str = '/' + this.source + '/';
- if (this.global) {
- str += 'g';
- }
- if (this.ignoreCase) {
- str += 'i';
- }
- if (this.multiline) {
- str += 'm';
- }
- return str;
- };
- // can't use defineProperties here because of toString enumeration issue in IE <= 8
- RegExp.prototype.toString = regexToString;
- }
-}));
-
-'use strict';
-/*jslint eqeq: true*/
-
-Handlebars.registerHelper('sanitize', function (text) {
- var result;
-
- if (text === undefined) { return ''; }
-
- result = sanitizeHtml(text, {
- allowedTags: [ 'div', 'span', 'b', 'i', 'em', 'strong', 'a', 'br', 'table', 'tbody', 'tr', 'th', 'td' ],
- allowedAttributes: {
- 'div': [ 'class' ],
- 'span': [ 'class' ],
- 'table': [ 'class' ],
- 'td': [ 'class' ],
- 'th': [ 'colspan' ],
- 'a': [ 'href' ]
- }
- });
-
- return new Handlebars.SafeString(result);
-});
-
-Handlebars.registerHelper('renderTextParam', function(param) {
- var result, type = 'text', idAtt = '';
- var paramType = param.type || param.schema && param.schema.type || '';
- var isArray = paramType.toLowerCase() === 'array' || param.allowMultiple;
- var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
- var name = Handlebars.Utils.escapeExpression(param.name);
- var valueId = Handlebars.Utils.escapeExpression(param.valueId);
- paramType = Handlebars.Utils.escapeExpression(paramType);
-
- var dataVendorExtensions = Object.keys(param).filter(function(property) {
- // filter X-data- properties
- return property.match(/^X-data-/i) !== null;
- }).reduce(function(result, property) {
- // remove X- from property name, so it results in html attributes like data-foo='bar'
- return result += ' ' + property.substring(2, property.length) + '=\'' + param[property] + '\'';
- }, '');
-
- if(param.format && param.format === 'password') {
- type = 'password';
- }
-
- if(valueId) {
- idAtt = ' id=\'' + valueId + '\'';
- }
-
- if (defaultValue) {
- defaultValue = sanitizeHtml(defaultValue);
- } else {
- defaultValue = '';
- }
-
- if(isArray) {
- result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + name + '\'' + idAtt + dataVendorExtensions;
- result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
- result += defaultValue + '</textarea>';
- } else {
- var parameterClass = 'parameter';
- if(param.required) {
- parameterClass += ' required';
- }
- result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
- result += ' name=\'' + name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt + dataVendorExtensions;
- result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
- }
- return new Handlebars.SafeString(result);
-});
-
-Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
-
- switch (operator) {
- case '==':
- return (v1 == v2) ? options.fn(this) : options.inverse(this);
- case '===':
- return (v1 === v2) ? options.fn(this) : options.inverse(this);
- case '<':
- return (v1 < v2) ? options.fn(this) : options.inverse(this);
- case '<=':
- return (v1 <= v2) ? options.fn(this) : options.inverse(this);
- case '>':
- return (v1 > v2) ? options.fn(this) : options.inverse(this);
- case '>=':
- return (v1 >= v2) ? options.fn(this) : options.inverse(this);
- case '&&':
- return (v1 && v2) ? options.fn(this) : options.inverse(this);
- case '||':
- return (v1 || v2) ? options.fn(this) : options.inverse(this);
- default:
- return options.inverse(this);
- }
-});
-
-Handlebars.registerHelper('escape', function (value) {
- var text = Handlebars.Utils.escapeExpression(value);
-
- return new Handlebars.SafeString(text);
-});
-
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.sanitizeHtml=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if [...]
-var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset [...]
-}}module.exports={XML:decodeXMLStrict,HTML:decodeHTML,HTMLStrict:decodeHTMLStrict}},{"../maps/entities.json":25,"../maps/legacy.json":26,"../maps/xml.json":27,"./decode_codepoint.js":22}],22:[function(require,module,exports){var decodeMap=require("../maps/decode.json");module.exports=decodeCodePoint;function decodeCodePoint(codePoint){if(codePoint>=55296&&codePoint<=57343||codePoint>1114111){return"�"}if(codePoint in decodeMap){codePoint=decodeMap[codePoint]}var output="";if(codePoint>65 [...]
-}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._e [...]
-this._cbs.ontext(data)}};Tokenizer.prototype.reset=function(){Tokenizer.call(this,{xmlMode:this._xmlMode,decodeEntities:this._decodeEntities},this._cbs)};Tokenizer.prototype.getAbsoluteIndex=function(){return this._bufferOffset+this._index};Tokenizer.prototype._getSection=function(){return this._buffer.substring(this._sectionStart,this._index)};Tokenizer.prototype._emitToken=function(name){this._cbs[name](this._getSection());this._sectionStart=-1};Tokenizer.prototype._emitPartial=functio [...]
-state.pendingcb++;ret=writeOrBuffer(this,state,chunk,encoding,cb)}return ret};Writable.prototype.cork=function(){var state=this._writableState;state.corked++};Writable.prototype.uncork=function(){var state=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(encoding){if(typeof encoding==="string")enco [...]
-
-/**
- * swagger-client - swagger-client is a javascript client for use with swaggering APIs.
- * @version v2.1.29
- * @link http://swagger.io
- * @license Apache-2.0
- */
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SwaggerClient = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0 [...]
-'use strict';
-
-var auth = require('./lib/auth');
-var helpers = require('./lib/helpers');
-var SwaggerClient = require('./lib/client');
-var deprecationWrapper = function (url, options) {
- helpers.log('This is deprecated, use "new SwaggerClient" instead.');
-
- return new SwaggerClient(url, options);
-};
-
-/* Here for IE8 Support */
-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;
- };
-}
-
-/* Here for IE8 Support */
-if (!String.prototype.trim) {
- String.prototype.trim = function () {
- return this.replace(/^\s+|\s+$/g, '');
- };
-}
-
-/* Here for node 10.x support */
-if (!String.prototype.endsWith) {
- String.prototype.endsWith = function(suffix) {
- return this.indexOf(suffix, this.length - suffix.length) !== -1;
- };
-}
-
-module.exports = SwaggerClient;
-
-SwaggerClient.ApiKeyAuthorization = auth.ApiKeyAuthorization;
-SwaggerClient.PasswordAuthorization = auth.PasswordAuthorization;
-SwaggerClient.CookieAuthorization = auth.CookieAuthorization;
-SwaggerClient.SwaggerApi = deprecationWrapper;
-SwaggerClient.SwaggerClient = deprecationWrapper;
-SwaggerClient.SchemaMarkup = require('./lib/schema-markup');
-
-},{"./lib/auth":2,"./lib/client":3,"./lib/helpers":4,"./lib/schema-markup":7}],2:[function(require,module,exports){
-'use strict';
-
-var helpers = require('./helpers');
-var btoa = require('btoa'); // jshint ignore:line
-var CookieJar = require('cookiejar').CookieJar;
-var _ = {
- each: require('lodash-compat/collection/each'),
- includes: require('lodash-compat/collection/includes'),
- isObject: require('lodash-compat/lang/isObject'),
- isArray: require('lodash-compat/lang/isArray')
-};
-
-/**
- * SwaggerAuthorizations applies the correct authorization to an operation being executed
- */
-var SwaggerAuthorizations = module.exports.SwaggerAuthorizations = function (authz) {
- this.authz = authz || {};
-};
-
-/**
- * Add auths to the hash
- * Will overwrite any existing
- *
- */
-SwaggerAuthorizations.prototype.add = function (name, auth) {
- if(_.isObject(name)) {
- for (var key in name) {
- this.authz[key] = name[key];
- }
- } else if(typeof name === 'string' ){
- this.authz[name] = auth;
- }
-
- return auth;
-};
-
-SwaggerAuthorizations.prototype.remove = function (name) {
- return delete this.authz[name];
-};
-
-SwaggerAuthorizations.prototype.apply = function (obj, securities) {
- var status = true;
- var applyAll = !securities;
- var flattenedSecurities = [];
-
- // favor the object-level authorizations over global
- var authz = obj.clientAuthorizations || this.authz;
-
- // Securities could be [ {} ]
- _.each(securities, function (obj, key) {
-
- // Make sure we account for securities being [ str ]
- if(typeof key === 'string') {
- flattenedSecurities.push(key);
- }
-
- // Flatten keys in to our array
- _.each(obj, function (val, key) {
- flattenedSecurities.push(key);
- });
- });
-
- _.each(authz, function (auth, authName) {
- if(applyAll || _.includes(flattenedSecurities, authName)) {
- var newStatus = auth.apply(obj);
- status = status && !!newStatus; // logical ORs regarding status
- }
- });
-
- return status;
-};
-
-/**
- * ApiKeyAuthorization allows a query param or header to be injected
- */
-var ApiKeyAuthorization = module.exports.ApiKeyAuthorization = function (name, value, type) {
- this.name = name;
- this.value = value;
- this.type = type;
-};
-
-ApiKeyAuthorization.prototype.apply = function (obj) {
- if (this.type === 'query') {
- // see if already applied. If so, don't do it again
-
- var qp;
- if (obj.url.indexOf('?') > 0) {
- qp = obj.url.substring(obj.url.indexOf('?') + 1);
- var parts = qp.split('&');
- if(parts && parts.length > 0) {
- for(var i = 0; i < parts.length; i++) {
- var kv = parts[i].split('=');
- if(kv && kv.length > 0) {
- if (kv[0] === this.name) {
- // skip it
- return false;
- }
- }
- }
- }
- }
-
- 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') {
- obj.headers[this.name] = this.value;
- }
-
- return true;
- }
-};
-
-var CookieAuthorization = module.exports.CookieAuthorization = function (cookie) {
- this.cookie = cookie;
-};
-
-CookieAuthorization.prototype.apply = function (obj) {
- obj.cookieJar = obj.cookieJar || new CookieJar();
- obj.cookieJar.setCookie(this.cookie);
-
- return true;
-};
-
-/**
- * Password Authorization is a basic auth implementation
- */
-var PasswordAuthorization = module.exports.PasswordAuthorization = function (username, password) {
- if (arguments.length === 3) {
- helpers.log('PasswordAuthorization: the \'name\' argument has been removed, pass only username and password');
- username = arguments[1];
- password = arguments[2];
- }
- this.username = username;
- this.password = password;
-};
-
-PasswordAuthorization.prototype.apply = function (obj) {
- if(typeof obj.headers.Authorization === 'undefined') {
- obj.headers.Authorization = 'Basic ' + btoa(this.username + ':' + this.password);
- }
-
- return true;
-};
-
-},{"./helpers":4,"btoa":13,"cookiejar":18,"lodash-compat/collection/each":52,"lodash-compat/collection/includes":55,"lodash-compat/lang/isArray":140,"lodash-compat/lang/isObject":144}],3:[function(require,module,exports){
-'use strict';
-
-var _ = {
- bind: require('lodash-compat/function/bind'),
- cloneDeep: require('lodash-compat/lang/cloneDeep'),
- find: require('lodash-compat/collection/find'),
- forEach: require('lodash-compat/collection/forEach'),
- indexOf: require('lodash-compat/array/indexOf'),
- isArray: require('lodash-compat/lang/isArray'),
- isObject: require('lodash-compat/lang/isObject'),
- isFunction: require('lodash-compat/lang/isFunction'),
- isPlainObject: require('lodash-compat/lang/isPlainObject'),
- isUndefined: require('lodash-compat/lang/isUndefined')
-};
-var auth = require('./auth');
-var helpers = require('./helpers');
-var Model = require('./types/model');
-var Operation = require('./types/operation');
-var OperationGroup = require('./types/operationGroup');
-var Resolver = require('./resolver');
-var SwaggerHttp = require('./http');
-var SwaggerSpecConverter = require('./spec-converter');
-var Q = require('q');
-
-// We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the
-// following usage: 'client.{tagName}'
-var reservedClientTags = [
- 'apis',
- 'authorizationScheme',
- 'authorizations',
- 'basePath',
- 'build',
- 'buildFrom1_1Spec',
- 'buildFrom1_2Spec',
- 'buildFromSpec',
- 'clientAuthorizations',
- 'convertInfo',
- 'debug',
- 'defaultErrorCallback',
- 'defaultSuccessCallback',
- 'enableCookies',
- 'fail',
- 'failure',
- 'finish',
- 'help',
- 'host',
- 'idFromOp',
- 'info',
- 'initialize',
- 'isBuilt',
- 'isValid',
- 'modelPropertyMacro',
- 'models',
- 'modelsArray',
- 'options',
- 'parameterMacro',
- 'parseUri',
- 'progress',
- 'resourceCount',
- 'sampleModels',
- 'selfReflect',
- 'setConsolidatedModels',
- 'spec',
- 'supportedSubmitMethods',
- 'swaggerRequestHeaders',
- 'tagFromLabel',
- 'title',
- 'url',
- 'useJQuery',
- 'jqueryAjaxCache'
-];
-// We have to keep track of the function/property names to avoid collisions for tag names which are used to allow the
-// following usage: 'client.apis.{tagName}'
-var reservedApiTags = [
- 'apis',
- 'asCurl',
- 'description',
- 'externalDocs',
- 'help',
- 'label',
- 'name',
- 'operation',
- 'operations',
- 'operationsArray',
- 'path',
- 'tag'
-];
-var supportedOperationMethods = ['delete', 'get', 'head', 'options', 'patch', 'post', 'put'];
-var SwaggerClient = module.exports = function (url, options) {
- this.authorizations = null;
- this.authorizationScheme = null;
- this.basePath = null;
- this.debug = false;
- this.enableCookies = false;
- this.info = null;
- this.isBuilt = false;
- this.isValid = false;
- this.modelsArray = [];
- this.resourceCount = 0;
- this.url = null;
- this.useJQuery = false;
- this.jqueryAjaxCache = false;
- this.swaggerObject = {};
- this.deferredClient = undefined;
-
- this.clientAuthorizations = new auth.SwaggerAuthorizations();
-
- if (typeof url !== 'undefined') {
- return this.initialize(url, options);
- } else {
- return this;
- }
-};
-
-SwaggerClient.prototype.initialize = function (url, options) {
- this.models = {};
- this.sampleModels = {};
-
- if (typeof url === 'string') {
- this.url = url;
- } else if (_.isObject(url)) {
- options = url;
- this.url = options.url;
- }
-
- if(this.url && this.url.indexOf('http:') === -1 && this.url.indexOf('https:') === -1) {
- // no protocol, so we can only use window if it exists
- if(typeof(window) !== 'undefined' && window && window.location) {
- this.url = window.location.origin + this.url;
- }
- }
-
- options = options || {};
- this.clientAuthorizations.add(options.authorizations);
- this.swaggerRequestHeaders = options.swaggerRequestHeaders || 'application/json;charset=utf-8,*/*';
- this.defaultSuccessCallback = options.defaultSuccessCallback || null;
- this.defaultErrorCallback = options.defaultErrorCallback || null;
- this.modelPropertyMacro = options.modelPropertyMacro || null;
- this.connectionAgent = options.connectionAgent || null;
- this.parameterMacro = options.parameterMacro || null;
- this.usePromise = options.usePromise || null;
-
- // operation request timeout default
- this.timeout = options.timeout || null;
- // default to request timeout when not specified
- this.fetchSpecTimeout = typeof options.fetchSpecTimeout !== 'undefined' ?
- options.fetchSpecTimeout : options.timeout || null;
-
- if(this.usePromise) {
- this.deferredClient = Q.defer();
- }
-
- if (typeof options.success === 'function') {
- this.success = options.success;
- }
- if (options.useJQuery) {
- this.useJQuery = options.useJQuery;
- }
-
- if (options.jqueryAjaxCache) {
- this.jqueryAjaxCache = options.jqueryAjaxCache;
- }
-
- if (options.enableCookies) {
- this.enableCookies = options.enableCookies;
- }
-
- this.options = options || {};
-
- // maybe don't need this?
- this.options.timeout = this.timeout;
- this.options.fetchSpecTimeout = this.fetchSpecTimeout;
-
- this.supportedSubmitMethods = options.supportedSubmitMethods || [];
- this.failure = options.failure || function (err) { throw err; };
- this.progress = options.progress || function () {};
- this.spec = _.cloneDeep(options.spec); // Clone so we do not alter the provided document
-
- if (options.scheme) {
- this.scheme = options.scheme;
- }
-
- if (this.usePromise || typeof options.success === 'function') {
- this.ready = true;
- return this.build();
- }
-};
-
-SwaggerClient.prototype.build = function (mock) {
- if (this.isBuilt) {
- return this;
- }
-
- var self = this;
-
- if (this.spec) {
- this.progress('fetching resource list; Please wait.');
- } else {
- this.progress('fetching resource list: ' + this.url + '; Please wait.');
- }
-
- var obj = {
- useJQuery: this.useJQuery,
- jqueryAjaxCache: this.jqueryAjaxCache,
- connectionAgent: this.connectionAgent,
- enableCookies: this.enableCookies,
- url: this.url,
- method: 'get',
- headers: {
- accept: this.swaggerRequestHeaders
- },
- on: {
- error: function (response) {
- if (self.url.substring(0, 4) !== 'http') {
- return self.fail('Please specify the protocol for ' + self.url);
- } else if (response.errObj && (response.errObj.code === 'ECONNABORTED' || response.errObj.message.indexOf('timeout') !== -1)) {
- return self.fail('Request timed out after ' + self.fetchSpecTimeout + 'ms');
- } else if (response.status === 0) {
- return self.fail('Can\'t read from server. It may not have the appropriate access-control-origin settings.');
- } else if (response.status === 404) {
- return self.fail('Can\'t read swagger JSON from ' + self.url);
- } else {
- return self.fail(response.status + ' : ' + response.statusText + ' ' + self.url);
- }
- },
- response: function (resp) {
-
- var responseObj = resp.obj;
- if(!responseObj) {
- return self.fail('failed to parse JSON/YAML response');
- }
-
- self.swaggerVersion = responseObj.swaggerVersion;
- self.swaggerObject = responseObj;
-
- if (responseObj.swagger && parseInt(responseObj.swagger) === 2) {
- self.swaggerVersion = responseObj.swagger;
-
- new Resolver().resolve(responseObj, self.url, self.buildFromSpec, self);
-
- self.isValid = true;
- } else {
- var converter = new SwaggerSpecConverter();
- self.oldSwaggerObject = self.swaggerObject;
-
- converter.setDocumentationLocation(self.url);
- converter.convert(responseObj, self.clientAuthorizations, self.options, function(spec) {
- self.swaggerObject = spec;
- new Resolver().resolve(spec, self.url, self.buildFromSpec, self);
- self.isValid = true;
- });
- }
- }
- }
- };
-
- // only set timeout when specified
- if (this.fetchSpecTimeout) {
- obj.timeout = this.fetchSpecTimeout;
- }
-
- if (this.spec) {
- self.swaggerObject = this.spec;
- setTimeout(function () {
- new Resolver().resolve(self.spec, self.url, self.buildFromSpec, self);
- }, 10);
- } else {
- this.clientAuthorizations.apply(obj);
-
- if (mock) {
- return obj;
- }
-
- new SwaggerHttp().execute(obj, this.options);
- }
-
- return (this.usePromise) ? this.deferredClient.promise : this;
-};
-
-SwaggerClient.prototype.buildFromSpec = function (response) {
- if (this.isBuilt) {
- return this;
- }
-
- this.apis = {};
- this.apisArray = [];
- this.basePath = response.basePath || '';
- this.consumes = response.consumes;
- this.host = response.host || '';
- this.info = response.info || {};
- this.produces = response.produces;
- this.schemes = response.schemes || [];
- this.securityDefinitions = _.cloneDeep(response.securityDefinitions);
- this.security = response.security;
- this.title = response.title || '';
-
- var key, definedTags = {}, k, location, self = this, i;
-
- if (response.externalDocs) {
- this.externalDocs = response.externalDocs;
- }
-
- // legacy support
- this.authSchemes = this.securityDefinitions;
-
- if(this.securityDefinitions) {
- for(key in this.securityDefinitions) {
- var securityDefinition = this.securityDefinitions[key];
- securityDefinition.vendorExtensions = {};
- for(var ext in securityDefinition) {
- helpers.extractExtensions(ext, securityDefinition);
- if (ext === 'scopes') {
- var scopes = securityDefinition[ext];
- if(typeof scopes === 'object') {
- scopes.vendorExtensions = {};
- for (var s in scopes) {
- helpers.extractExtensions(s, scopes);
- if(s.indexOf('x-') === 0) {
- delete scopes[s];
- }
- }
- }
- }
- }
- }
- }
-
- if (Array.isArray(response.tags)) {
- definedTags = {};
-
- for (k = 0; k < response.tags.length; k++) {
- var t = _.cloneDeep(response.tags[k]);
- definedTags[t.name] = t;
- for(i in t) {
- if(i === 'externalDocs' && typeof t[i] === 'object') {
- for(var j in t[i]) {
- helpers.extractExtensions(j, t[i]);
- }
- }
- helpers.extractExtensions(i, t);
- }
- }
- }
-
-
- if (typeof this.url === 'string') {
- location = this.parseUri(this.url);
- if (typeof this.scheme === 'undefined' && typeof this.schemes === 'undefined' || this.schemes.length === 0) {
- if(typeof window !== 'undefined') {
- // use the window scheme
- this.scheme = window.location.protocol.replace(':','');
- }
- else {
- this.scheme = location.scheme || 'http';
- }
- } else if (typeof window !== 'undefined' && window.location.protocol.indexOf('chrome-extension') === 0) {
- // if it is chrome swagger ui extension scheme then let swagger doc url scheme decide the protocol
- this.scheme = location.scheme;
- } else if (typeof this.scheme === 'undefined') {
- if(typeof window !== 'undefined') {
- var scheme = window.location.protocol.replace(':','');
- if(scheme === 'https' && this.schemes.indexOf(scheme) === -1) {
- // can't call http from https served page in a browser!
- helpers.log('Cannot call a http server from https inside a browser!');
- this.scheme = 'http';
- }
- else if(this.schemes.indexOf(scheme) !== -1) {
- this.scheme = scheme;
- }
- else {
- if(this.schemes.indexOf('https') !== -1) {
- this.scheme = 'https';
- }
- else {
- this.scheme = 'http';
- }
- }
- }
- else {
- this.scheme = this.schemes[0] || location.scheme;
- }
- }
-
- if (typeof this.host === 'undefined' || this.host === '') {
- this.host = location.host;
-
- if (location.port) {
- this.host = this.host + ':' + location.port;
- }
- }
- }
- else {
- if (typeof this.schemes === 'undefined' || this.schemes.length === 0) {
- this.scheme = 'http';
- }
- else if (typeof this.scheme === 'undefined') {
- this.scheme = this.schemes[0];
- }
- }
-
- this.definitions = response.definitions;
-
- for (key in this.definitions) {
- var model = new Model(key, this.definitions[key], this.models, this.modelPropertyMacro);
-
- if (model) {
- this.models[key] = model;
- }
- }
-
- // get paths, create functions for each operationId
-
- // Bind help to 'client.apis'
- self.apis.help = _.bind(self.help, self);
-
- _.forEach(response.paths, function (pathObj, path) {
- // Only process a path if it's an object
- if (!_.isPlainObject(pathObj)) {
- return;
- }
-
- _.forEach(supportedOperationMethods, function (method) {
- var operation = pathObj[method];
-
- if (_.isUndefined(operation)) {
- // Operation does not exist
- return;
- } else if (!_.isPlainObject(operation)) {
- // Operation exists but it is not an Operation Object. Since this is invalid, log it.
- helpers.log('The \'' + method + '\' operation for \'' + path + '\' path is not an Operation Object');
-
- return;
- }
-
- var tags = operation.tags;
-
- if (_.isUndefined(tags) || !_.isArray(tags) || tags.length === 0) {
- tags = operation.tags = [ 'default' ];
- }
-
- var operationId = self.idFromOp(path, method, operation);
-
- var operationObject = new Operation(self,
- operation.scheme,
- operationId,
- method,
- path,
- operation,
- self.definitions,
- self.models,
- self.clientAuthorizations);
-
- operationObject.connectionAgent = self.connectionAgent;
- operationObject.vendorExtensions = {};
- for(i in operation) {
- helpers.extractExtensions(i, operationObject, operation[i]);
- }
- operationObject.externalDocs = operation.externalDocs;
- if(operationObject.externalDocs) {
- operationObject.externalDocs = _.cloneDeep(operationObject.externalDocs);
- operationObject.externalDocs.vendorExtensions = {};
- for(i in operationObject.externalDocs) {
- helpers.extractExtensions(i, operationObject.externalDocs);
- }
- }
-
- // bind self operation's execute command to the api
- _.forEach(tags, function (tag) {
- var clientProperty = _.indexOf(reservedClientTags, tag) > -1 ? '_' + tag : tag;
- var apiProperty = _.indexOf(reservedApiTags, tag) > -1 ? '_' + tag : tag;
- var operationGroup = self[clientProperty];
-
- if (clientProperty !== tag) {
- helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient function/property name. Use \'client.' +
- clientProperty + '\' or \'client.apis.' + tag + '\' instead of \'client.' + tag + '\'.');
- }
-
- if (apiProperty !== tag) {
- helpers.log('The \'' + tag + '\' tag conflicts with a SwaggerClient operation function/property name. Use ' +
- '\'client.apis.' + apiProperty + '\' instead of \'client.apis.' + tag + '\'.');
- }
-
- if (_.indexOf(reservedApiTags, operationId) > -1) {
- helpers.log('The \'' + operationId + '\' operationId conflicts with a SwaggerClient operation ' +
- 'function/property name. Use \'client.apis.' + apiProperty + '._' + operationId +
- '\' instead of \'client.apis.' + apiProperty + '.' + operationId + '\'.');
-
- operationId = '_' + operationId;
- operationObject.nickname = operationId; // So 'client.apis.[tag].operationId.help() works properly
- }
-
- if (_.isUndefined(operationGroup)) {
- operationGroup = self[clientProperty] = self.apis[apiProperty] = {};
-
- operationGroup.operations = {};
- operationGroup.label = apiProperty;
- operationGroup.apis = {};
-
- var tagDef = definedTags[tag];
-
- if (!_.isUndefined(tagDef)) {
- operationGroup.description = tagDef.description;
- operationGroup.externalDocs = tagDef.externalDocs;
- operationGroup.vendorExtensions = tagDef.vendorExtensions;
- }
-
- self[clientProperty].help = _.bind(self.help, operationGroup);
- self.apisArray.push(new OperationGroup(tag, operationGroup.description, operationGroup.externalDocs, operationObject));
- }
-
- operationId = self.makeUniqueOperationId(operationId, self.apis[apiProperty]);
-
- // Bind tag help
- if (!_.isFunction(operationGroup.help)) {
- operationGroup.help = _.bind(self.help, operationGroup);
- }
-
- // bind to the apis object
- self.apis[apiProperty][operationId] = operationGroup[operationId] = _.bind(operationObject.execute,
- operationObject);
- self.apis[apiProperty][operationId].help = operationGroup[operationId].help = _.bind(operationObject.help,
- operationObject);
- self.apis[apiProperty][operationId].asCurl = operationGroup[operationId].asCurl = _.bind(operationObject.asCurl,
- operationObject);
-
- operationGroup.apis[operationId] = operationGroup.operations[operationId] = operationObject;
-
- // legacy UI feature
- var api = _.find(self.apisArray, function (api) {
- return api.tag === tag;
- });
-
- if (api) {
- api.operationsArray.push(operationObject);
- }
- });
- });
- });
-
- // sort the apisArray according to the tags
- var sortedApis = [];
- _.forEach(Object.keys(definedTags), function (tag) {
- var pos;
- for(pos in self.apisArray) {
- var _api = self.apisArray[pos];
- if(_api && tag === _api.name) {
- sortedApis.push(_api);
- self.apisArray[pos] = null;
- }
- }
- });
- // add anything left
- _.forEach(self.apisArray, function (api) {
- if(api) {
- sortedApis.push(api);
- }
- });
- self.apisArray = sortedApis;
-
- _.forEach(response.definitions, function (definitionObj, definition) {
- definitionObj.id = definition.toLowerCase();
- definitionObj.name = definition;
- self.modelsArray.push(definitionObj);
- });
-
- this.isBuilt = true;
-
- if (this.usePromise) {
- this.isValid = true;
- this.isBuilt = true;
- this.deferredClient.resolve(this);
-
- return this.deferredClient.promise;
- }
-
- if (this.success) {
- this.success();
- }
-
- return this;
-};
-
-SwaggerClient.prototype.makeUniqueOperationId = function(operationId, api) {
- var count = 0;
- var name = operationId;
-
- // make unique across this operation group
- while(true) {
- var matched = false;
- _.forEach(api.operations, function (operation) {
- if(operation.nickname === name) {
- matched = true;
- }
- });
- if(!matched) {
- return name;
- }
- name = operationId + '_' + count;
- count ++;
- }
-
- return operationId;
-};
-
-SwaggerClient.prototype.parseUri = function (uri) {
- var urlParseRE = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/;
- var parts = urlParseRE.exec(uri);
-
- return {
- scheme: parts[4] ? parts[4].replace(':','') : undefined,
- host: parts[11],
- port: parts[12],
- path: parts[15]
- };
-};
-
-SwaggerClient.prototype.help = function (dontPrint) {
- var output = '';
-
- if (this instanceof SwaggerClient) {
- _.forEach(this.apis, function (api, name) {
- if (_.isPlainObject(api)) {
- output += 'operations for the \'' + name + '\' tag\n';
-
- _.forEach(api.operations, function (operation, name) {
- output += ' * ' + name + ': ' + operation.summary + '\n';
- });
- }
- });
- } else if (this instanceof OperationGroup || _.isPlainObject(this)) {
- output += 'operations for the \'' + this.label + '\' tag\n';
-
- _.forEach(this.apis, function (operation, name) {
- output += ' * ' + name + ': ' + operation.summary + '\n';
- });
- }
-
- if (dontPrint) {
- return output;
- } else {
- helpers.log(output);
-
- return output;
- }
-};
-
-SwaggerClient.prototype.tagFromLabel = function (label) {
- return label;
-};
-
-SwaggerClient.prototype.idFromOp = function (path, httpMethod, op) {
- if(!op || !op.operationId) {
- op = op || {};
- op.operationId = httpMethod + '_' + path;
- }
- var opId = op.operationId.replace(/[\s!@#$%^&*()_+=\[{\]};:<>|.\/?,\\'""-]/g, '_') || (path.substring(1) + '_' + httpMethod);
-
- opId = opId.replace(/((_){2,})/g, '_');
- opId = opId.replace(/^(_)*/g, '');
- opId = opId.replace(/([_])*$/g, '');
-
- return opId;
-};
-
-SwaggerClient.prototype.setHost = function (host) {
- this.host = host;
-
- if(this.apis) {
- _.forEach(this.apis, function(api) {
- if(api.operations) {
- _.forEach(api.operations, function(operation) {
- operation.host = host;
- });
- }
- });
- }
-};
-
-SwaggerClient.prototype.setBasePath = function (basePath) {
- this.basePath = basePath;
-
- if(this.apis) {
- _.forEach(this.apis, function(api) {
- if(api.operations) {
- _.forEach(api.operations, function(operation) {
- operation.basePath = basePath;
- });
- }
- });
- }
-};
-
-SwaggerClient.prototype.setSchemes = function (schemes) {
- this.schemes = schemes;
-
- if(schemes && schemes.length > 0) {
- if(this.apis) {
- _.forEach(this.apis, function (api) {
- if (api.operations) {
- _.forEach(api.operations, function (operation) {
- operation.scheme = schemes[0];
- });
- }
- });
- }
- }
-};
-
-SwaggerClient.prototype.fail = function (message) {
- if (this.usePromise) {
- this.deferredClient.reject(message);
- return this.deferredClient.promise;
- } else {
- if (this.failure) {
- this.failure(message);
- }
- else {
- this.failure(message);
- }
- }
-};
-
-},{"./auth":2,"./helpers":4,"./http":5,"./resolver":6,"./spec-converter":8,"./types/model":9,"./types/operation":10,"./types/operationGroup":11,"lodash-compat/array/indexOf":49,"lodash-compat/collection/find":53,"lodash-compat/collection/forEach":54,"lodash-compat/function/bind":58,"lodash-compat/lang/cloneDeep":138,"lodash-compat/lang/isArray":140,"lodash-compat/lang/isFunction":142,"lodash-compat/lang/isObject":144,"lodash-compat/lang/isPlainObject":145,"lodash-compat/lang/isUndefined" [...]
-(function (process){
-'use strict';
-
-var _ = {
- isPlainObject: require('lodash-compat/lang/isPlainObject'),
- indexOf: require('lodash-compat/array/indexOf')
-};
-
-module.exports.__bind = function (fn, me) {
- return function(){
- return fn.apply(me, arguments);
- };
-};
-
-var log = module.exports.log = function() {
- // Only log if available and we're not testing
- if (console && process.env.NODE_ENV !== 'test') {
- console.log(Array.prototype.slice.call(arguments)[0]);
- }
-};
-
-module.exports.fail = function (message) {
- log(message);
-};
-
-module.exports.optionHtml = function (label, value) {
- return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
-};
-
-var resolveSchema = module.exports.resolveSchema = function (schema) {
- if (_.isPlainObject(schema.schema)) {
- schema = resolveSchema(schema.schema);
- }
-
- return schema;
-};
-
-module.exports.simpleRef = function (name) {
- if (typeof name === 'undefined') {
- return null;
- }
-
- if (name.indexOf('#/definitions/') === 0) {
- return name.substring('#/definitions/'.length);
- } else {
- return name;
- }
-};
-
-/**
- * helper to remove extensions and add them to an object
- *
- * @param keyname
- * @param obj
- */
-module.exports.extractExtensions = function (keyname, obj, value) {
- if(!keyname || !obj) {
- return;
- }
-
- if (typeof keyname === 'string' && keyname.indexOf('x-') === 0) {
- obj.vendorExtensions = obj.vendorExtensions || {};
- if(value) {
- obj.vendorExtensions[keyname] = value;
- }
- else {
- obj.vendorExtensions[keyname] = obj[keyname];
- }
- }
-};
-}).call(this,require('_process'))
-
-},{"_process":12,"lodash-compat/array/indexOf":49,"lodash-compat/lang/isPlainObject":145}],5:[function(require,module,exports){
-(function (Buffer){
-'use strict';
-
-var helpers = require('./helpers');
-var request = require('superagent');
-var jsyaml = require('js-yaml');
-var _ = {
- isObject: require('lodash-compat/lang/isObject'),
- keys: require('lodash-compat/object/keys')
-};
-
-/*
- * JQueryHttpClient is a light-weight, node or browser HTTP client
- */
-var JQueryHttpClient = function () {
- this.type = 'JQueryHttpClient';
-};
-
-/*
- * SuperagentHttpClient is a light-weight, node or browser HTTP client
- */
-var SuperagentHttpClient = function () {
- this.type = 'SuperagentHttpClient';
-};
-
-/**
- * SwaggerHttp is a wrapper for executing requests
- */
-var SwaggerHttp = module.exports = function () {};
-
-SwaggerHttp.prototype.execute = function (obj, opts) {
- var client;
-
- if(opts && opts.client) {
- client = opts.client;
- }
- else {
- client = new SuperagentHttpClient(opts);
- }
- client.opts = opts || {};
-
- if (opts && opts.requestAgent) {
- request = opts.requestAgent;
- }
-
- // legacy support
- var hasJQuery = false;
- if(typeof window !== 'undefined') {
- if(typeof window.jQuery !== 'undefined') {
- hasJQuery = true;
- }
- }
- // OPTIONS support
- if(obj.method.toLowerCase() === 'options' && client.type === 'SuperagentHttpClient') {
- log('forcing jQuery as OPTIONS are not supported by SuperAgent');
- obj.useJQuery = true;
- }
- if(this.isInternetExplorer() && (obj.useJQuery === false || !hasJQuery )) {
- throw new Error('Unsupported configuration! JQuery is required but not available');
- }
- if ((obj && obj.useJQuery === true) || this.isInternetExplorer() && hasJQuery) {
- client = new JQueryHttpClient(opts);
- }
-
- var success = obj.on.response;
- var error = obj.on.error;
-
- var requestInterceptor = function(data) {
- if(opts && opts.requestInterceptor) {
- data = opts.requestInterceptor.apply(data);
- }
- return data;
- };
-
- var responseInterceptor = function(data) {
- if(opts && opts.responseInterceptor) {
- data = opts.responseInterceptor.apply(data, [obj]);
- }
- return success(data);
- };
-
- var errorInterceptor = function(data) {
- if(opts && opts.responseInterceptor) {
- data = opts.responseInterceptor.apply(data, [obj]);
- }
- error(data);
- };
-
- obj.on.error = function(data) {
- errorInterceptor(data);
- };
-
- obj.on.response = function(data) {
- if(data && data.status >= 400) {
- errorInterceptor(data);
- }
- else {
- responseInterceptor(data);
- }
- };
-
- if (_.isObject(obj) && _.isObject(obj.body)) {
- // special processing for file uploads via jquery
- if (obj.body.type && obj.body.type === 'formData'){
- if(opts.useJQuery) {
- obj.contentType = false;
- obj.processData = false;
- delete obj.headers['Content-Type'];
- }
- }
- }
-
- obj = requestInterceptor(obj) || obj;
- if (obj.beforeSend) {
- obj.beforeSend(function(_obj) {
- client.execute(_obj || obj);
- });
- } else {
- client.execute(obj);
- }
-
- return (obj.deferred) ? obj.deferred.promise : obj;
-};
-
-SwaggerHttp.prototype.isInternetExplorer = function () {
- var detectedIE = false;
-
- if (typeof navigator !== 'undefined' && navigator.userAgent) {
- var nav = navigator.userAgent.toLowerCase();
-
- if (nav.indexOf('msie') !== -1) {
- var version = parseInt(nav.split('msie')[1]);
-
- if (version <= 8) {
- detectedIE = true;
- }
- }
- }
-
- return detectedIE;
-};
-
-JQueryHttpClient.prototype.execute = function (obj) {
- var jq = this.jQuery || (typeof window !== 'undefined' && window.jQuery);
- var cb = obj.on;
- var request = obj;
-
- if(typeof jq === 'undefined' || jq === false) {
- throw new Error('Unsupported configuration! JQuery is required but not available');
- }
-
- obj.type = obj.method;
- obj.cache = obj.jqueryAjaxCache;
- obj.data = obj.body;
- delete obj.jqueryAjaxCache;
- delete obj.useJQuery;
- delete obj.body;
-
- obj.complete = function (response) {
- var headers = {};
- var 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;
- }
-
- var name = toSplit.substring(0, separator).trim();
- var value = toSplit.substring(separator + 1).trim();
-
- headers[name] = value;
- }
-
- var out = {
- url: request.url,
- method: request.method,
- status: response.status,
- statusText: response.statusText,
- data: response.responseText,
- headers: headers
- };
-
- try {
- var possibleObj = response.responseJSON || jsyaml.safeLoad(response.responseText);
- out.obj = (typeof possibleObj === 'string') ? {} : possibleObj;
- } catch (ex) {
- // do not set out.obj
- helpers.log('unable to parse JSON/YAML content');
- }
-
- // I can throw, or parse null?
- out.obj = out.obj || null;
-
- 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);
- }
- };
-
- jq.support.cors = true;
-
- return jq.ajax(obj);
-};
-
-SuperagentHttpClient.prototype.execute = function (obj) {
- var method = obj.method.toLowerCase();
- var timeout = obj.timeout;
-
- if (method === 'delete') {
- method = 'del';
- }
- var headers = obj.headers || {};
-
- var r = request[method](obj.url);
-
- if (obj.connectionAgent) {
- r.agent(obj.connectionAgent);
- }
-
- if (timeout) {
- r.timeout(timeout);
- }
-
- if (obj.enableCookies) {
- r.withCredentials();
- }
-
- var accept = obj.headers.Accept;
-
- if(this.binaryRequest(accept)) {
- r.on('request', function () {
- if(this.xhr) {
- this.xhr.responseType = 'blob';
- }
- });
- }
-
- if(obj.body) {
- if(_.isObject(obj.body)) {
- var contentType = obj.headers['Content-Type'] || '';
- if (contentType.indexOf('multipart/form-data') === 0) {
- delete headers['Content-Type'];
- if({}.toString.apply(obj.body) === '[object FormData]') {
- r.send(obj.body);
- }
- else {
- var keyname, value, v;
- for (keyname in obj.body) {
- value = obj.body[keyname];
- if(Array.isArray(value)) {
- for(v in value) {
- r.field(keyname, v);
- }
- }
- else {
- r.field(keyname, value);
- }
- }
- }
- }
- else if (_.isObject(obj.body)) {
- // non multipart/form-data
- obj.body = JSON.stringify(obj.body);
- r.send(obj.body);
- }
- }
- else {
- r.send(obj.body);
- }
- }
-
- var name;
- for (name in headers) {
- r.set(name, headers[name]);
- }
-
- if(typeof r.buffer === 'function') {
- r.buffer(); // force superagent to populate res.text with the raw response data
- }
-
- r.end(function (err, res) {
- res = res || {
- status: 0,
- headers: {error: 'no response from server'}
- };
- var response = {
- url: obj.url,
- method: obj.method,
- headers: res.headers
- };
- var cb;
-
- if (!err && res.error) {
- err = res.error;
- }
-
- if (err && obj.on && obj.on.error) {
- response.errObj = err;
- response.status = res ? res.status : 500;
- response.statusText = res ? res.text : err.message;
- if (res.headers && res.headers['content-type']) {
- if (res.headers['content-type'].indexOf('application/json') >= 0) {
- try {
- response.obj = JSON.parse(response.statusText);
- }
- catch (e) {
- response.obj = null;
- }
- }
- }
- cb = obj.on.error;
- } else if (res && obj.on && obj.on.response) {
- var possibleObj;
-
- // Already parsed by by superagent?
- if (res.body && _.keys(res.body).length > 0) {
- possibleObj = res.body;
- } else {
- try {
- possibleObj = jsyaml.safeLoad(res.text);
- // can parse into a string... which we don't need running around in the system
- possibleObj = (typeof possibleObj === 'string') ? null : possibleObj;
- } catch (e) {
- helpers.log('cannot parse JSON/YAML content');
- }
- }
-
- // null means we can't parse into object
- if(typeof Buffer === 'function' && Buffer.isBuffer(possibleObj)) {
- response.data = possibleObj;
- }
- else {
- response.obj = (typeof possibleObj === 'object') ? possibleObj : null;
- }
-
- response.status = res.status;
- response.statusText = res.text;
- cb = obj.on.response;
- }
- if (res.xhr && res.xhr.response) {
- response.data = res.xhr.response;
- }
- else if(!response.data) {
- response.data = response.statusText;
- }
-
- if (cb) {
- cb(response);
- }
- });
-};
-
-SuperagentHttpClient.prototype. binaryRequest = function (accept) {
- if(!accept) {
- return false;
- }
- return (/^image/i).test(accept)
- || (/^application\/pdf/).test(accept)
- || (/^application\/octet-stream/).test(accept);
-};
-
-}).call(this,require("buffer").Buffer)
-
-},{"./helpers":4,"buffer":14,"js-yaml":19,"lodash-compat/lang/isObject":144,"lodash-compat/object/keys":149,"superagent":158}],6:[function(require,module,exports){
-'use strict';
-
-var SwaggerHttp = require('./http');
-var _ = {
- isObject: require('lodash-compat/lang/isObject'),
- cloneDeep: require('lodash-compat/lang/cloneDeep'),
- isArray: require('lodash-compat/lang/isArray'),
- isString: require('lodash-compat/lang/isString')
-};
-
-
-/**
- * Resolves a spec's remote references
- */
-var Resolver = module.exports = function () {
- this.failedUrls = [];
- this.resolverCache = {};
- this.pendingUrls = {};
-};
-
-Resolver.prototype.processAllOf = function(root, name, definition, resolutionTable, unresolvedRefs, spec) {
- var i, location, property;
-
- definition['x-resolved-from'] = [ '#/definitions/' + name ];
- var allOf = definition.allOf;
- // the refs go first
- allOf.sort(function(a, b) {
- if(a.$ref && b.$ref) { return 0; }
- else if(a.$ref) { return -1; }
- else { return 1; }
- });
- for (i = 0; i < allOf.length; i++) {
- property = allOf[i];
- location = '/definitions/' + name + '/allOf';
- this.resolveInline(root, spec, property, resolutionTable, unresolvedRefs, location);
- }
-};
-
-Resolver.prototype.resolve = function (spec, arg1, arg2, arg3) {
- this.spec = spec;
- var root = arg1, callback = arg2, scope = arg3, opts = {}, location, i;
- if(typeof arg1 === 'function') {
- root = null;
- callback = arg1;
- scope = arg2;
- }
- var _root = root, modelName;
- this.scope = (scope || this);
- this.iteration = this.iteration || 0;
-
- if(this.scope.options && this.scope.options.requestInterceptor){
- opts.requestInterceptor = this.scope.options.requestInterceptor;
- }
-
- if(this.scope.options && this.scope.options.responseInterceptor){
- opts.responseInterceptor = this.scope.options.responseInterceptor;
- }
-
- var name, path, property, propertyName, parameter, done, counter;
- var processedCalls = 0, resolvedRefs = {}, unresolvedRefs = {};
- var resolutionTable = []; // store objects for dereferencing
-
- spec.definitions = spec.definitions || {};
- // definitions
- for (name in spec.definitions) {
- var definition = spec.definitions[name];
- if(definition.$ref) {
- this.resolveInline(root, spec, definition, resolutionTable, unresolvedRefs, definition);
- }
- else {
- for (propertyName in definition.properties) {
- property = definition.properties[propertyName];
- if (_.isArray(property.allOf)) {
- this.processAllOf(root, name, property, resolutionTable, unresolvedRefs, spec);
- }
- else {
- this.resolveTo(root, property, resolutionTable, '/definitions');
- }
- }
-
- if (definition.allOf) {
- this.processAllOf(root, name, definition, resolutionTable, unresolvedRefs, spec);
- }
- }
- }
-
- // shared parameters
- spec.parameters = spec.parameters || {};
- for(name in spec.parameters) {
- parameter = spec.parameters[name];
- if (parameter.in === 'body' && parameter.schema) {
- if(_.isArray(parameter.schema.allOf)) {
- // move to a definition
- modelName = 'inline_model';
- var _name = modelName;
- done = false; counter = 0;
- while(!done) {
- if(typeof spec.definitions[_name] === 'undefined') {
- done = true;
- break;
- }
- _name = modelName + '_' + counter;
- counter ++;
- }
- spec.definitions[_name] = { allOf: parameter.schema.allOf };
- delete parameter.schema.allOf;
- parameter.schema.$ref = '#/definitions/' + _name;
- this.processAllOf(root, _name, spec.definitions[_name], resolutionTable, unresolvedRefs, spec);
- }
- else {
- this.resolveTo(root, parameter.schema, resolutionTable, location);
- }
- }
-
- if (parameter.$ref) {
- // parameter reference
- this.resolveInline(root, spec, parameter, resolutionTable, unresolvedRefs, parameter.$ref);
- }
- }
-
- // operations
- for (name in spec.paths) {
- var method, operation, responseCode;
- path = spec.paths[name];
-
- if(typeof path === 'object') {
- for (method in path) {
- // operation reference
- if (method === '$ref') {
- // location = path[method];
- location = '/paths' + name;
- this.resolveInline(root, spec, path, resolutionTable, unresolvedRefs, location);
- }
- else {
- operation = path[method];
- var sharedParameters = path.parameters || [];
- var parameters = operation.parameters || [];
-
- sharedParameters.forEach(function(parameter) {
- parameters.unshift(parameter);
- });
-
- if (method !== 'parameters' && _.isObject(operation)) {
- operation.parameters = operation.parameters || parameters;
- }
-
- for (i in parameters) {
- parameter = parameters[i];
- location = '/paths' + name + '/' + method + '/parameters';
-
- if (parameter.in === 'body' && parameter.schema) {
- if (_.isArray(parameter.schema.allOf)) {
- // move to a definition
- modelName = 'inline_model';
- name = modelName;
- done = false;
- counter = 0;
- while (!done) {
- if (typeof spec.definitions[name] === 'undefined') {
- done = true;
- break;
- }
- name = modelName + '_' + counter;
- counter++;
- }
- spec.definitions[name] = {allOf: parameter.schema.allOf};
- delete parameter.schema.allOf;
- parameter.schema.$ref = '#/definitions/' + name;
- this.processAllOf(root, name, spec.definitions[name], resolutionTable, unresolvedRefs, spec);
- }
- else {
- this.resolveTo(root, parameter.schema, resolutionTable, location);
- }
- }
-
- if (parameter.$ref) {
- // parameter reference
- this.resolveInline(root, spec, parameter, resolutionTable, unresolvedRefs, parameter.$ref);
- }
- }
-
- for (responseCode in operation.responses) {
- var response = operation.responses[responseCode];
- location = '/paths' + name + '/' + method + '/responses/' + responseCode;
-
- if (_.isObject(response)) {
- if (response.$ref) {
- // response reference
- this.resolveInline(root, spec, response, resolutionTable, unresolvedRefs, location);
- }
- if (response.schema) {
- var responseObj = response;
- if (_.isArray(responseObj.schema.allOf)) {
- // move to a definition
- modelName = 'inline_model';
- name = modelName;
- done = false;
- counter = 0;
- while (!done) {
- if (typeof spec.definitions[name] === 'undefined') {
- done = true;
- break;
- }
- name = modelName + '_' + counter;
- counter++;
- }
- spec.definitions[name] = {allOf: responseObj.schema.allOf};
- delete responseObj.schema.allOf;
- delete responseObj.schema.type;
- responseObj.schema.$ref = '#/definitions/' + name;
- this.processAllOf(root, name, spec.definitions[name], resolutionTable, unresolvedRefs, spec);
- }
- else if ('array' === responseObj.schema.type) {
- if (responseObj.schema.items && responseObj.schema.items.$ref) {
- // response reference
- this.resolveInline(root, spec, responseObj.schema.items, resolutionTable, unresolvedRefs, location);
- }
- }
- else {
- this.resolveTo(root, response.schema, resolutionTable, location);
- }
- }
- }
- }
- }
- }
- // clear them out to avoid multiple resolutions
- path.parameters = [];
- }
- }
-
- var expectedCalls = 0, toResolve = [];
- // if the root is same as obj[i].root we can resolve locally
- var all = resolutionTable;
-
- var parts;
- for(i = 0; i < all.length; i++) {
- var a = all[i];
- if(root === a.root) {
- if(a.resolveAs === 'ref') {
- // resolve any path walking
- var joined = ((a.root || '') + '/' + a.key).split('/');
- var normalized = [];
- var url = '';
- var k;
-
- if(a.key.indexOf('../') >= 0) {
- for(var j = 0; j < joined.length; j++) {
- if(joined[j] === '..') {
- normalized = normalized.slice(0, normalized.length-1);
- }
- else {
- normalized.push(joined[j]);
- }
- }
- for(k = 0; k < normalized.length; k ++) {
- if(k > 0) {
- url += '/';
- }
- url += normalized[k];
- }
- // we now have to remote resolve this because the path has changed
- a.root = url;
- toResolve.push(a);
- }
- else {
- parts = a.key.split('#');
- if(parts.length === 2) {
- if(parts[0].indexOf('http:') === 0 || parts[0].indexOf('https:') === 0) {
- a.root = parts[0];
- }
- location = parts[1].split('/');
- var r;
- var s = spec;
- for(k = 0; k < location.length; k++) {
- var part = location[k];
- if(part !== '') {
- s = s[part];
- if(typeof s !== 'undefined') {
- r = s;
- }
- else {
- r = null;
- break;
- }
- }
- }
- if(r === null) {
- // must resolve this too
- toResolve.push(a);
- }
- }
- }
- }
- else {
- if (a.resolveAs === 'inline') {
- if(a.key && a.key.indexOf('#') === -1 && a.key.charAt(0) !== '/') {
- // handle relative schema
- parts = a.root.split('/');
- location = '';
- for(i = 0; i < parts.length - 1; i++) {
- location += parts[i] + '/';
- }
- location += a.key;
- a.root = location;
- a.location = '';
- }
- toResolve.push(a);
- }
- }
- }
- else {
- toResolve.push(a);
- }
- }
- expectedCalls = toResolve.length;
-
- // resolve anything that is local
-
- var lock = {};
- for(var ii = 0; ii < toResolve.length; ii++) {
- (function(item, spec, self, lock, ii) {
- if(!item.root || item.root === root) {
- // local resolve
- self.resolveItem(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, item);
- processedCalls += 1;
-
- if(processedCalls === expectedCalls) {
- self.finish(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback, true);
- }
- }
- else if(self.failedUrls.indexOf(item.root) === -1) {
- var obj = {
- useJQuery: false, // TODO
- url: item.root,
- method: 'get',
- headers: {
- accept: self.scope.swaggerRequestHeaders || 'application/json'
- },
- on: {
- error: function (error) {
- processedCalls += 1;
- console.log('failed url: ' + obj.url);
- self.failedUrls.push(obj.url);
- if (lock) {
- delete lock[item.root];
- }
- unresolvedRefs[item.key] = {
- root: item.root,
- location: item.location
- };
-
- if (processedCalls === expectedCalls) {
- self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
- }
- }, // jshint ignore:line
- response: function (response) {
- var swagger = response.obj;
- if (lock) {
- delete lock[item.root];
- }
- if (self.resolverCache) {
- self.resolverCache[item.root] = swagger;
- }
- self.resolveItem(swagger, item.root, resolutionTable, resolvedRefs, unresolvedRefs, item);
- processedCalls += 1;
-
- if (processedCalls === expectedCalls) {
- self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
- }
- }
- } // jshint ignore:line
- };
-
- // apply timeout only when specified
- if (scope && scope.fetchSpecTimeout) {
- obj.timeout = scope.fetchSpecTimeout;
- }
-
- if (scope && scope.clientAuthorizations) {
- scope.clientAuthorizations.apply(obj);
- }
-
- (function waitForUnlock() {
- setTimeout(function() {
- if (lock[obj.url]) {
- waitForUnlock();
- }
- else {
- var cached = self.resolverCache[obj.url];
- if (_.isObject(cached)) {
- obj.on.response({obj: cached});
- }
- else {
- lock[obj.url] = true;
- new SwaggerHttp().execute(obj, opts);
- }
- }
- }, 0);
- })();
- }
-
- else {
- processedCalls += 1;
- unresolvedRefs[item.key] = {
- root: item.root,
- location: item.location
- };
- if (processedCalls === expectedCalls) {
- self.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
- }
- }
- }(toResolve[ii], spec, this, lock, ii));
- }
-
- if (Object.keys(toResolve).length === 0) {
- this.finish(spec, _root, resolutionTable, resolvedRefs, unresolvedRefs, callback);
- }
-};
-
-Resolver.prototype.resolveItem = function(spec, root, resolutionTable, resolvedRefs, unresolvedRefs, item) {
- var path = item.location;
- var location = spec, parts = path.split('/');
- if(path !== '') {
- for (var j = 0; j < parts.length; j++) {
- var segment = parts[j];
- if (segment.indexOf('~1') !== -1) {
- segment = parts[j].replace(/~0/g, '~').replace(/~1/g, '/');
- if (segment.charAt(0) !== '/') {
- segment = '/' + segment;
- }
- }
- if (typeof location === 'undefined' || location === null) {
- break;
- }
- if (segment === '' && j === (parts.length - 1) && parts.length > 1) {
- location = null;
- break;
- }
- if (segment.length > 0) {
- location = location[segment];
- }
- }
- }
- var resolved = item.key;
- parts = item.key.split('/');
- var resolvedName = parts[parts.length-1];
-
- if(resolvedName.indexOf('#') >= 0) {
- resolvedName = resolvedName.split('#')[1];
- }
-
- if (location !== null && typeof location !== 'undefined') {
- resolvedRefs[resolved] = {
- name: resolvedName,
- obj: location,
- key: item.key,
- root: item.root
- };
- } else {
- unresolvedRefs[resolved] = {
- root: item.root,
- location: item.location
- };
- }
-};
-
-Resolver.prototype.finish = function (spec, root, resolutionTable, resolvedRefs, unresolvedRefs, callback, localResolve) {
- // walk resolution table and replace with resolved refs
- var ref, abs;
- for (ref in resolutionTable) {
- var item = resolutionTable[ref];
-
- var key = item.key;
- var resolvedTo = resolvedRefs[key];
- if (resolvedTo) {
- spec.definitions = spec.definitions || {};
- if (item.resolveAs === 'ref') {
- if (localResolve !== true) {
- // don't retain root for local definitions
- for (key in resolvedTo.obj) {
- abs = this.retainRoot(key, resolvedTo.obj[key], item.root);
- resolvedTo.obj[key] = abs;
- }
- }
- spec.definitions[resolvedTo.name] = resolvedTo.obj;
- item.obj.$ref = '#/definitions/' + resolvedTo.name;
- } else if (item.resolveAs === 'inline') {
- var targetObj = item.obj;
- targetObj['x-resolved-from'] = [ item.key ];
- delete targetObj.$ref;
-
- for (key in resolvedTo.obj) {
- abs = resolvedTo.obj[key];
-
- if (localResolve !== true) {
- // don't retain root for local definitions
- abs = this.retainRoot(key, resolvedTo.obj[key], item.root);
- }
- targetObj[key] = abs;
- }
- }
- }
- }
- var existingUnresolved = this.countUnresolvedRefs(spec);
-
- if(existingUnresolved === 0 || this.iteration > 5) {
- this.resolveAllOf(spec.definitions);
- this.resolverCache = null;
- callback.call(this.scope, spec, unresolvedRefs);
- }
- else {
- this.iteration += 1;
- this.resolve(spec, root, callback, this.scope);
- }
-};
-
-Resolver.prototype.countUnresolvedRefs = function(spec) {
- var i;
- var refs = this.getRefs(spec);
- var keys = [];
- var unresolvedKeys = [];
- for(i in refs) {
- if(i.indexOf('#') === 0) {
- keys.push(i.substring(1));
- }
- else {
- unresolvedKeys.push(i);
- }
- }
-
- // verify possible keys
- for (i = 0; i < keys.length; i++) {
- var part = keys[i];
- var parts = part.split('/');
- var obj = spec;
-
- for (var k = 0; k < parts.length; k++) {
- var key = parts[k];
- if(key !== '') {
- obj = obj[key];
- if(typeof obj === 'undefined') {
- unresolvedKeys.push(part);
- break;
- }
- }
- }
- }
- return unresolvedKeys.length;
-};
-
-Resolver.prototype.getRefs = function(spec, obj) {
- obj = obj || spec;
- var output = {};
- for(var key in obj) {
- if (!obj.hasOwnProperty(key)) {
- continue;
- }
- var item = obj[key];
- if(key === '$ref' && typeof item === 'string') {
- output[item] = null;
- }
- else if(_.isObject(item)) {
- var o = this.getRefs(item);
- for(var k in o) {
- output[k] = null;
- }
- }
- }
- return output;
-};
-
-function splitUrl(url) {
- var result = {};
- var proto = /[a-z]+:\/\//i.exec(url);
- if (proto) {
- result.proto = proto[0].slice(0, -3);
- url = url.slice(result.proto.length + 1);
- }
- if (url.slice(0, 2) === '//') {
- result.domain = url.slice(2).split('/')[0];
- url = url.slice(2 + result.domain.length);
- }
- var p = url.split('#');
- if (p[0].length) {
- result.path = p[0];
- }
- if (p.length > 1) {
- result.fragment = p.slice(1).join('#');
- }
- return result;
-}
-
-function unsplitUrl(url) {
- var result = url.path;
- if (result === undefined) {
- result = '';
- }
- if (url.fragment !== undefined) {
- result += '#' + url.fragment;
- }
- if (url.domain !== undefined) {
- if (result.slice(0, 1) === '/') {
- result = result.slice(1);
- }
- result = '//' + url.domain + '/' + result;
- if (url.proto !== undefined) {
- result = url.proto + ':' + result;
- }
- }
- return result;
-}
-
-function joinUrl(base, rel) {
- var relsp = splitUrl(rel);
- if (relsp.domain !== undefined) {
- return rel;
- }
- var result = splitUrl(base);
- if (relsp.path === undefined) {
- // change only fragment part
- result.fragment = relsp.fragment;
- } else if (relsp.path.slice(0, 1) === '/') {
- // relative to domain
- result.path = relsp.path;
- result.fragment = relsp.fragment;
- } else {
- // relative to path
- var path = result.path === undefined ? [] : result.path.split('/');
- var relpath = relsp.path.split('/');
- if (path.length) {
- path.pop();
- }
- while (relpath[0] === '..' || relpath[0] === '.') {
- if (relpath[0] === '..') {
- path.pop();
- }
- relpath.shift();
- }
- result.path = path.concat(relpath).join('/');
- result.fragment = relsp.fragment;
- }
- return unsplitUrl(result);
-}
-
-Resolver.prototype.retainRoot = function(origKey, obj, root) {
- // walk object and look for relative $refs
- if(_.isObject(obj)) {
- for(var key in obj) {
- var item = obj[key];
- if (key === '$ref' && typeof item === 'string') {
- obj[key] = joinUrl(root, item);
- }
- else if (_.isObject(item)) {
- this.retainRoot(key, item, root);
- }
- }
- }
- else if(_.isString(obj) && origKey === '$ref') {
- obj = joinUrl(root, obj);
- }
- return obj;
-};
-
-/**
- * immediately in-lines local refs, queues remote refs
- * for inline resolution
- */
-Resolver.prototype.resolveInline = function (root, spec, property, resolutionTable, unresolvedRefs, location) {
- var key = property.$ref, ref = property.$ref, i, p, p2, rs;
- var rootTrimmed = false;
-
- root = root || ''; // Guard against .split. @fehguy, you'll need to check if this logic fits
- // More imporantly is how do we gracefully handle relative urls, when provided just a 'spec', not a 'url' ?
-
- if (ref) {
- if(ref.indexOf('../') === 0) {
- // reset root
- p = ref.split('../');
- p2 = root.split('/');
- ref = '';
- for(i = 0; i < p.length; i++) {
- if(p[i] === '') {
- p2 = p2.slice(0, p2.length-1);
- }
- else {
- ref += p[i];
- }
- }
- root = '';
- for(i = 0; i < p2.length - 1; i++) {
- if(i > 0) { root += '/'; }
- root += p2[i];
- }
- rootTrimmed = true;
- }
- if(ref.indexOf('#') >= 0) {
- if(ref.indexOf('/') === 0) {
- rs = ref.split('#');
- p = root.split('//');
- p2 = p[1].split('/');
- root = p[0] + '//' + p2[0] + rs[0];
- location = rs[1];
- }
- else {
- rs = ref.split('#');
- if(rs[0] !== '') {
- p2 = root.split('/');
- p2 = p2.slice(0, p2.length - 1);
- if(!rootTrimmed) {
- root = '';
- for (var k = 0; k < p2.length; k++) {
- if(k > 0) { root += '/'; }
- root += p2[k];
- }
- }
- root += '/' + ref.split('#')[0];
- }
- location = rs[1];
- }
- }
- if (ref.indexOf('http:') === 0 || ref.indexOf('https:') === 0) {
- if(ref.indexOf('#') >= 0) {
- root = ref.split('#')[0];
- location = ref.split('#')[1];
- }
- else {
- root = ref;
- location = '';
- }
- resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
- } else if (ref.indexOf('#') === 0) {
- location = ref.split('#')[1];
- resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
- } else if (ref.indexOf('/') === 0 && ref.indexOf('#') === -1) {
- location = ref;
- var matches = root.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
- if(matches) {
- root = matches[0] + ref.substring(1);
- location = '';
- }
- resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
- }
- else {
- resolutionTable.push({obj: property, resolveAs: 'inline', root: root, key: key, location: location});
- }
- }
- else if (property.type === 'array') {
- this.resolveTo(root, property.items, resolutionTable, location);
- }
-};
-
-Resolver.prototype.resolveTo = function (root, property, resolutionTable, location) {
- var sp, i;
- var ref = property.$ref;
- var lroot = root;
- if ((typeof ref !== 'undefined') && (ref !== null)) {
- if(ref.indexOf('#') >= 0) {
- var parts = ref.split('#');
-
- // #/definitions/foo
- // foo.json#/bar
- if(parts[0] && ref.indexOf('/') === 0) {
-
- }
- else if(parts[0] && (parts[0].indexOf('http:') === 0 || parts[0].indexOf('https:') === 0)) {
- lroot = parts[0];
- ref = parts[1];
- }
- else if(parts[0] && parts[0].length > 0) {
- // relative file
- sp = root.split('/');
- lroot = '';
- for(i = 0; i < sp.length - 1; i++) {
- lroot += sp[i] + '/';
- }
- lroot += parts[0];
- }
- else {
-
- }
-
- location = parts[1];
- }
- else if (ref.indexOf('http:') === 0 || ref.indexOf('https:') === 0) {
- lroot = ref;
- location = '';
- }
- else {
- // relative file
- sp = root.split('/');
- lroot = '';
- for(i = 0; i < sp.length - 1; i++) {
- lroot += sp[i] + '/';
- }
- lroot += ref;
- location = '';
- }
- resolutionTable.push({
- obj: property, resolveAs: 'ref', root: lroot, key: ref, location: location
- });
- } else if (property.type === 'array') {
- var items = property.items;
- this.resolveTo(root, items, resolutionTable, location);
- } else {
- if(property && (property.properties || property.additionalProperties)) {
- var name = this.uniqueName('inline_model');
- if (property.title) {
- name = this.uniqueName(property.title);
- }
- delete property.title;
- this.spec.definitions[name] = _.cloneDeep(property);
- property.$ref = '#/definitions/' + name;
- delete property.type;
- delete property.properties;
- }
- }
-};
-
-Resolver.prototype.uniqueName = function(base) {
- var name = base;
- var count = 0;
- while(true) {
- if(!_.isObject(this.spec.definitions[name])) {
- return name;
- }
- name = base + '_' + count;
- count++;
- }
-};
-
-Resolver.prototype.resolveAllOf = function(spec, obj, depth) {
- depth = depth || 0;
- obj = obj || spec;
- var name;
- for(var key in obj) {
- if (!obj.hasOwnProperty(key)) {
- continue;
- }
- var item = obj[key];
- if(item === null) {
- throw new TypeError('Swagger 2.0 does not support null types (' + obj + '). See https://github.com/swagger-api/swagger-spec/issues/229.');
- }
- if(typeof item === 'object') {
- this.resolveAllOf(spec, item, depth + 1);
- }
- if(item && typeof item.allOf !== 'undefined') {
- var allOf = item.allOf;
- if(_.isArray(allOf)) {
- var output = _.cloneDeep(item);
- delete output.allOf;
-
- output['x-composed'] = true;
- if (typeof item['x-resolved-from'] !== 'undefined') {
- output['x-resolved-from'] = item['x-resolved-from'];
- }
-
- for(var i = 0; i < allOf.length; i++) {
- var component = allOf[i];
- var source = 'self';
- if(typeof component['x-resolved-from'] !== 'undefined') {
- source = component['x-resolved-from'][0];
- }
-
- for(var part in component) {
- if(!output.hasOwnProperty(part)) {
- output[part] = _.cloneDeep(component[part]);
- if(part === 'properties') {
- for(name in output[part]) {
- output[part][name]['x-resolved-from'] = source;
- }
- }
- }
- else {
- if(part === 'properties') {
- var properties = component[part];
- for(name in properties) {
- output.properties[name] = _.cloneDeep(properties[name]);
- var resolvedFrom = properties[name]['x-resolved-from'];
- if (typeof resolvedFrom === 'undefined' || resolvedFrom === 'self') {
- resolvedFrom = source;
- }
- output.properties[name]['x-resolved-from'] = resolvedFrom;
- }
- }
- else if(part === 'required') {
- // merge & dedup the required array
- var a = output.required.concat(component[part]);
- for(var k = 0; k < a.length; ++k) {
- for(var j = k + 1; j < a.length; ++j) {
- if(a[k] === a[j]) { a.splice(j--, 1); }
- }
- }
- output.required = a;
- }
- else if(part === 'x-resolved-from') {
- output['x-resolved-from'].push(source);
- }
- else {
- // TODO: need to merge this property
- // console.log('what to do with ' + part)
- }
- }
- }
- }
- obj[key] = output;
- }
- }
- }
-};
-
-},{"./http":5,"lodash-compat/lang/cloneDeep":138,"lodash-compat/lang/isArray":140,"lodash-compat/lang/isObject":144,"lodash-compat/lang/isString":146}],7:[function(require,module,exports){
-'use strict';
-
-var Helpers = require('./helpers');
-
-var _ = {
- isPlainObject: require('lodash-compat/lang/isPlainObject'),
- isUndefined: require('lodash-compat/lang/isUndefined'),
- isArray: require('lodash-compat/lang/isArray'),
- isObject: require('lodash-compat/lang/isObject'),
- isEmpty: require('lodash-compat/lang/isEmpty'),
- map: require('lodash-compat/collection/map'),
- indexOf: require('lodash-compat/array/indexOf'),
- cloneDeep: require('lodash-compat/lang/cloneDeep'),
- keys: require('lodash-compat/object/keys'),
- forEach: require('lodash-compat/collection/forEach')
-};
-
-var optionHtml = module.exports.optionHtml = function (label, value) {
- return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
-};
-
-module.exports.typeFromJsonSchema = function (type, format) {
- var str;
-
- if (type === 'integer' && format === 'int32') {
- str = 'integer';
- } else if (type === 'integer' && format === 'int64') {
- str = 'long';
- } else if (type === 'integer' && typeof format === 'undefined') {
- str = 'long';
- } else if (type === 'string' && format === 'date-time') {
- str = 'date-time';
- } else if (type === 'string' && format === 'date') {
- str = 'date';
- } else if (type === 'number' && format === 'float') {
- str = 'float';
- } else if (type === 'number' && format === 'double') {
- str = 'double';
- } else if (type === 'number' && typeof format === 'undefined') {
- str = 'double';
- } else if (type === 'boolean') {
- str = 'boolean';
- } else if (type === 'string') {
- str = 'string';
- }
-
- return str;
-};
-
-var getStringSignature = module.exports.getStringSignature = function (obj, baseComponent) {
- var str = '';
-
- if (typeof obj.$ref !== 'undefined') {
- str += Helpers.simpleRef(obj.$ref);
- } else if (typeof obj.type === 'undefined') {
- str += 'object';
- } else if (obj.type === 'array') {
- if (baseComponent) {
- str += getStringSignature((obj.items || obj.$ref || {}));
- } else {
- str += 'Array[';
- str += getStringSignature((obj.items || obj.$ref || {}));
- str += ']';
- }
- } else if (obj.type === 'integer' && obj.format === 'int32') {
- str += 'integer';
- } else if (obj.type === 'integer' && obj.format === 'int64') {
- str += 'long';
- } else if (obj.type === 'integer' && typeof obj.format === 'undefined') {
- str += 'long';
- } else if (obj.type === 'string' && obj.format === 'date-time') {
- str += 'date-time';
- } else if (obj.type === 'string' && obj.format === 'date') {
- str += 'date';
- } else if (obj.type === 'string' && typeof obj.format === 'undefined') {
- str += 'string';
- } else if (obj.type === 'number' && obj.format === 'float') {
- str += 'float';
- } else if (obj.type === 'number' && obj.format === 'double') {
- str += 'double';
- } else if (obj.type === 'number' && typeof obj.format === 'undefined') {
- str += 'double';
- } else if (obj.type === 'boolean') {
- str += 'boolean';
- } else if (obj.$ref) {
- str += Helpers.simpleRef(obj.$ref);
- } else {
- str += obj.type;
- }
-
- return str;
-};
-
-var schemaToJSON = module.exports.schemaToJSON = function (schema, models, modelsToIgnore, modelPropertyMacro) {
- // Resolve the schema (Handle nested schemas)
- schema = Helpers.resolveSchema(schema);
-
- if(typeof modelPropertyMacro !== 'function') {
- modelPropertyMacro = function(prop){
- return (prop || {}).default;
- };
- }
-
- modelsToIgnore= modelsToIgnore || {};
-
- var type = schema.type || 'object';
- var format = schema.format;
- var model;
- var output;
-
- if (!_.isUndefined(schema.example)) {
- output = schema.example;
- } else if (_.isUndefined(schema.items) && _.isArray(schema.enum)) {
- output = schema.enum[0];
- }
-
- if (_.isUndefined(output)) {
- if (schema.$ref) {
- model = models[Helpers.simpleRef(schema.$ref)];
-
- if (!_.isUndefined(model)) {
- if (_.isUndefined(modelsToIgnore[model.name])) {
- modelsToIgnore[model.name] = model;
- output = schemaToJSON(model.definition, models, modelsToIgnore, modelPropertyMacro);
- delete modelsToIgnore[model.name];
- } else {
- if (model.type === 'array') {
- output = [];
- } else {
- output = {};
- }
- }
- }
- } else if (!_.isUndefined(schema.default)) {
- output = schema.default;
- } else if (type === 'string') {
- if (format === 'date-time') {
- output = new Date().toISOString();
- } else if (format === 'date') {
- output = new Date().toISOString().split('T')[0];
- } else {
- output = 'string';
- }
- } else if (type === 'integer') {
- output = 0;
- } else if (type === 'number') {
- output = 0.0;
- } else if (type === 'boolean') {
- output = true;
- } else if (type === 'object') {
- output = {};
-
- _.forEach(schema.properties, function (property, name) {
- var cProperty = _.cloneDeep(property);
-
- // Allow macro to set the default value
- cProperty.default = modelPropertyMacro(property);
-
- output[name] = schemaToJSON(cProperty, models, modelsToIgnore, modelPropertyMacro);
- });
- } else if (type === 'array') {
- output = [];
-
- if (_.isArray(schema.items)) {
- _.forEach(schema.items, function (item) {
- output.push(schemaToJSON(item, models, modelsToIgnore, modelPropertyMacro));
- });
- } else if (_.isPlainObject(schema.items)) {
- output.push(schemaToJSON(schema.items, models, modelsToIgnore, modelPropertyMacro));
- } else if (_.isUndefined(schema.items)) {
- output.push({});
- } else {
- Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process');
- }
- }
- }
-
- return output;
-};
-
-module.exports.schemaToHTML =function (name, schema, models, modelPropertyMacro) {
- var strongOpen = '<span class="strong">';
- var strongClose = '</span>';
-
- // Allow for ignoring the 'name' argument.... shifting the rest
- if(_.isObject(arguments[0])) {
- name = void 0;
- schema = arguments[0];
- models = arguments[1];
- modelPropertyMacro = arguments[2];
- }
-
- models = models || {};
-
- // Resolve the schema (Handle nested schemas)
- schema = Helpers.resolveSchema(schema);
-
- // Return for empty object
- if(_.isEmpty(schema)) {
- return strongOpen + 'Empty' + strongClose;
- }
-
- // Dereference $ref from 'models'
- if(typeof schema.$ref === 'string') {
- name = Helpers.simpleRef(schema.$ref);
- schema = models[name];
- if(typeof schema === 'undefined')
- {
- return strongOpen + name + ' is not defined!' + strongClose;
- }
- }
-
- if(typeof name !== 'string') {
- name = schema.title || 'Inline Model';
- }
-
- // If we are a Model object... adjust accordingly
- if(schema.definition) {
- schema = schema.definition;
- }
-
- if(typeof modelPropertyMacro !== 'function') {
- modelPropertyMacro = function(prop){
- return (prop || {}).default;
- };
- }
-
- var references = {};
- var seenModels = [];
- var inlineModels = 0;
-
-
-
- // Generate current HTML
- var html = processModel(schema, name);
-
- // Generate references HTML
- while (_.keys(references).length > 0) {
- /* jshint ignore:start */
- _.forEach(references, function (schema, name) {
- var seenModel = _.indexOf(seenModels, name) > -1;
-
- delete references[name];
-
- if (!seenModel) {
- seenModels.push(name);
-
- html += '<br />' + processModel(schema, name);
- }
- });
- /* jshint ignore:end */
- }
-
- return html;
-
- /////////////////////////////////
-
- function addReference(schema, name, skipRef) {
- var modelName = name;
- var model;
-
- if (schema.$ref) {
- modelName = schema.title || Helpers.simpleRef(schema.$ref);
- model = models[modelName];
- } else if (_.isUndefined(name)) {
- modelName = schema.title || 'Inline Model ' + (++inlineModels);
- model = {definition: schema};
- }
-
- if (skipRef !== true) {
- references[modelName] = _.isUndefined(model) ? {} : model.definition;
- }
-
- return modelName;
- }
-
- function primitiveToHTML(schema) {
- var html = '<span class="propType">';
- var type = schema.type || 'object';
-
- if (schema.$ref) {
- html += addReference(schema, Helpers.simpleRef(schema.$ref));
- } else if (type === 'object') {
- if (!_.isUndefined(schema.properties)) {
- html += addReference(schema);
- } else {
- html += 'object';
- }
- } else if (type === 'array') {
- html += 'Array[';
-
- if (_.isArray(schema.items)) {
- html += _.map(schema.items, addReference).join(',');
- } else if (_.isPlainObject(schema.items)) {
- if (_.isUndefined(schema.items.$ref)) {
- if (!_.isUndefined(schema.items.type) && _.indexOf(['array', 'object'], schema.items.type) === -1) {
- html += schema.items.type;
- } else {
- html += addReference(schema.items);
- }
- } else {
- html += addReference(schema.items, Helpers.simpleRef(schema.items.$ref));
- }
- } else {
- Helpers.log('Array type\'s \'items\' schema is not an array or an object, cannot process');
- html += 'object';
- }
-
- html += ']';
- } else {
- html += schema.type;
- }
-
- html += '</span>';
-
- return html;
- }
-
- function primitiveToOptionsHTML(schema, html) {
- var options = '';
- var type = schema.type || 'object';
- var isArray = type === 'array';
-
- if (isArray) {
- if (_.isPlainObject(schema.items) && !_.isUndefined(schema.items.type)) {
- type = schema.items.type;
- } else {
- type = 'object';
- }
- }
-
- if (!_.isUndefined(schema.default)) {
- options += optionHtml('Default', schema.default);
- }
-
- switch (type) {
- case 'string':
- if (schema.minLength) {
- options += optionHtml('Min. Length', schema.minLength);
- }
-
- if (schema.maxLength) {
- options += optionHtml('Max. Length', schema.maxLength);
- }
-
- if (schema.pattern) {
- options += optionHtml('Reg. Exp.', schema.pattern);
- }
- break;
- case 'integer':
- case 'number':
- if (schema.minimum) {
- options += optionHtml('Min. Value', schema.minimum);
- }
-
- if (schema.exclusiveMinimum) {
- options += optionHtml('Exclusive Min.', 'true');
- }
-
- if (schema.maximum) {
- options += optionHtml('Max. Value', schema.maximum);
- }
-
- if (schema.exclusiveMaximum) {
- options += optionHtml('Exclusive Max.', 'true');
- }
-
- if (schema.multipleOf) {
- options += optionHtml('Multiple Of', schema.multipleOf);
- }
-
- break;
- }
-
- if (isArray) {
- if (schema.minItems) {
- options += optionHtml('Min. Items', schema.minItems);
- }
-
- if (schema.maxItems) {
- options += optionHtml('Max. Items', schema.maxItems);
- }
-
- if (schema.uniqueItems) {
- options += optionHtml('Unique Items', 'true');
- }
-
- if (schema.collectionFormat) {
- options += optionHtml('Coll. Format', schema.collectionFormat);
- }
- }
-
- if (_.isUndefined(schema.items)) {
- if (_.isArray(schema.enum)) {
- var enumString;
-
- if (type === 'number' || type === 'integer') {
- enumString = schema.enum.join(', ');
- } else {
- enumString = '"' + schema.enum.join('", "') + '"';
- }
-
- options += optionHtml('Enum', enumString);
- }
- }
-
- if (options.length > 0) {
- html = '<span class="propWrap">' + html + '<table class="optionsWrapper"><tr><th colspan="2">' + type + '</th></tr>' + options + '</table></span>';
- }
-
- return html;
- }
-
- function processModel(schema, name) {
- var type = schema.type || 'object';
- var isArray = schema.type === 'array';
- var html = strongOpen + name + ' ' + (isArray ? '[' : '{') + strongClose;
-
- if (name) {
- seenModels.push(name);
- }
-
- if (isArray) {
- if (_.isArray(schema.items)) {
- html += '<div>' + _.map(schema.items, function (item) {
- var type = item.type || 'object';
-
- if (_.isUndefined(item.$ref)) {
- if (_.indexOf(['array', 'object'], type) > -1) {
- if (type === 'object' && _.isUndefined(item.properties)) {
- return 'object';
- } else {
- return addReference(item);
- }
- } else {
- return primitiveToOptionsHTML(item, type);
- }
- } else {
- return addReference(item, Helpers.simpleRef(item.$ref));
- }
- }).join(',</div><div>');
- } else if (_.isPlainObject(schema.items)) {
- if (_.isUndefined(schema.items.$ref)) {
- if (_.indexOf(['array', 'object'], schema.items.type || 'object') > -1) {
- if ((_.isUndefined(schema.items.type) || schema.items.type === 'object') && _.isUndefined(schema.items.properties)) {
- html += '<div>object</div>';
- } else {
- html += '<div>' + addReference(schema.items) + '</div>';
- }
- } else {
- html += '<div>' + primitiveToOptionsHTML(schema.items, schema.items.type) + '</div>';
- }
- } else {
- html += '<div>' + addReference(schema.items, Helpers.simpleRef(schema.items.$ref)) + '</div>';
- }
- } else {
- Helpers.log('Array type\'s \'items\' property is not an array or an object, cannot process');
- html += '<div>object</div>';
- }
- } else {
- if (schema.$ref) {
- html += '<div>' + addReference(schema, name) + '</div>';
- } else if (type === 'object') {
- if (_.isPlainObject(schema.properties)) {
- var contents = _.map(schema.properties, function (property, name) {
- var propertyIsRequired = (_.indexOf(schema.required, name) >= 0);
- var cProperty = _.cloneDeep(property);
-
- var requiredClass = propertyIsRequired ? 'required' : '';
- var html = '<span class="propName ' + requiredClass + '">' + name + '</span> (';
- var model;
- var propDescription;
-
- // Allow macro to set the default value
- cProperty.default = modelPropertyMacro(cProperty);
-
- // Resolve the schema (Handle nested schemas)
- cProperty = Helpers.resolveSchema(cProperty);
-
- propDescription = property.description || cProperty.description;
-
- // We need to handle property references to primitives (Issue 339)
- if (!_.isUndefined(cProperty.$ref)) {
- model = models[Helpers.simpleRef(cProperty.$ref)];
-
- if (!_.isUndefined(model) && _.indexOf([undefined, 'array', 'object'], model.definition.type) === -1) {
- // Use referenced schema
- cProperty = Helpers.resolveSchema(model.definition);
- }
- }
-
- html += primitiveToHTML(cProperty);
-
- if(!propertyIsRequired) {
- html += ', <span class="propOptKey">optional</span>';
- }
-
- if(property.readOnly) {
- html += ', <span class="propReadOnly">read only</span>';
- }
-
- html += ')';
-
- if (!_.isUndefined(propDescription)) {
- html += ': ' + '<span class="propDesc">' + propDescription + '</span>';
- }
-
- if (cProperty.enum) {
- html += ' = <span class="propVals">[\'' + cProperty.enum.join('\', \'') + '\']</span>';
- }
-
- return '<div' + (property.readOnly ? ' class="readOnly"' : '') + '>' + primitiveToOptionsHTML(cProperty, html);
- }).join(',</div>');
-
- if (contents) {
- html += contents + '</div>';
- }
- }
- } else {
- html += '<div>' + primitiveToOptionsHTML(schema, type) + '</div>';
- }
- }
-
- return html + strongOpen + (isArray ? ']' : '}') + strongClose;
- }
-};
-},{"./helpers":4,"lodash-compat/array/indexOf":49,"lodash-compat/collection/forEach":54,"lodash-compat/collection/map":56,"lodash-compat/lang/cloneDeep":138,"lodash-compat/lang/isArray":140,"lodash-compat/lang/isEmpty":141,"lodash-compat/lang/isObject":144,"lodash-compat/lang/isPlainObject":145,"lodash-compat/lang/isUndefined":148,"lodash-compat/object/keys":149}],8:[function(require,module,exports){
-'use strict';
-
-var SwaggerHttp = require('./http');
-var _ = {
- isObject: require('lodash-compat/lang/isObject')
-};
-
-var SwaggerSpecConverter = module.exports = function () {
- this.errors = [];
- this.warnings = [];
- this.modelMap = {};
-};
-
-SwaggerSpecConverter.prototype.setDocumentationLocation = function (location) {
- this.docLocation = location;
-};
-
-/**
- * converts a resource listing OR api declaration
- **/
-SwaggerSpecConverter.prototype.convert = function (obj, clientAuthorizations, opts, callback) {
- // not a valid spec
- if(!obj || !Array.isArray(obj.apis)) {
- return this.finish(callback, null);
- }
- this.clientAuthorizations = clientAuthorizations;
-
- // create a new swagger object to return
- var swagger = { swagger: '2.0' };
-
- swagger.originalVersion = obj.swaggerVersion;
-
- // add the info
- this.apiInfo(obj, swagger);
-
- // add security definitions
- this.securityDefinitions(obj, swagger);
-
- // take basePath into account
- if (obj.basePath) {
- this.setDocumentationLocation(obj.basePath);
- }
-
- // see if this is a single-file swagger definition
- var isSingleFileSwagger = false;
- var i;
- for(i = 0; i < obj.apis.length; i++) {
- var api = obj.apis[i];
- if(Array.isArray(api.operations)) {
- isSingleFileSwagger = true;
- }
- }
- if(isSingleFileSwagger) {
- this.declaration(obj, swagger);
- this.finish(callback, swagger);
- }
- else {
- this.resourceListing(obj, swagger, opts, callback);
- }
-};
-
-SwaggerSpecConverter.prototype.declaration = function(obj, swagger) {
- var name, i, p, pos;
- if(!obj.apis) {
- return;
- }
-
- if (obj.basePath.indexOf('http://') === 0) {
- p = obj.basePath.substring('http://'.length);
- pos = p.indexOf('/');
- if (pos > 0) {
- swagger.host = p.substring(0, pos);
- swagger.basePath = p.substring(pos);
- }
- else {
- swagger.host = p;
- swagger.basePath = '/';
- }
- } else if (obj.basePath.indexOf('https://') === 0) {
- p = obj.basePath.substring('https://'.length);
- pos = p.indexOf('/');
- if (pos > 0) {
- swagger.host = p.substring(0, pos);
- swagger.basePath = p.substring(pos);
- }
- else {
- swagger.host = p;
- swagger.basePath = '/';
- }
- } else {
- swagger.basePath = obj.basePath;
- }
-
- var resourceLevelAuth;
- if(obj.authorizations) {
- resourceLevelAuth = obj.authorizations;
- }
- if(obj.consumes) {
- swagger.consumes = obj.consumes;
- }
- if(obj.produces) {
- swagger.produces = obj.produces;
- }
-
- // build a mapping of id to name for 1.0 model resolutions
- if(_.isObject(obj)) {
- for(name in obj.models) {
- var existingModel = obj.models[name];
- var key = (existingModel.id || name);
- this.modelMap[key] = name;
- }
- }
-
- for(i = 0; i < obj.apis.length; i++) {
- var api = obj.apis[i];
- var path = api.path;
- var operations = api.operations;
- this.operations(path, obj.resourcePath, operations, resourceLevelAuth, swagger);
- }
-
- var models = obj.models || {};
- this.models(models, swagger);
-};
-
-SwaggerSpecConverter.prototype.models = function(obj, swagger) {
- if(!_.isObject(obj)) {
- return;
- }
- var name;
-
- swagger.definitions = swagger.definitions || {};
- for(name in obj) {
- var existingModel = obj[name];
- var _required = [];
- var schema = { properties: {}};
- var propertyName;
- for(propertyName in existingModel.properties) {
- var existingProperty = existingModel.properties[propertyName];
- var property = {};
- this.dataType(existingProperty, property);
- if(existingProperty.description) {
- property.description = existingProperty.description;
- }
- if(existingProperty['enum']) {
- property['enum'] = existingProperty['enum'];
- }
- if(typeof existingProperty.required === 'boolean' && existingProperty.required === true) {
- _required.push(propertyName);
- }
- if(typeof existingProperty.required === 'string' && existingProperty.required === 'true') {
- _required.push(propertyName);
- }
- schema.properties[propertyName] = property;
- }
- if(_required.length > 0) {
- schema.required = _required;
- } else {
- schema.required = existingModel.required;
- }
- swagger.definitions[name] = schema;
- }
-};
-
-SwaggerSpecConverter.prototype.extractTag = function(resourcePath) {
- var pathString = resourcePath || 'default';
- if(pathString.indexOf('http:') === 0 || pathString.indexOf('https:') === 0) {
- pathString = pathString.split(['/']);
- pathString = pathString[pathString.length -1].substring();
- }
- if(pathString.endsWith('.json')) {
- pathString = pathString.substring(0, pathString.length - '.json'.length);
- }
- return pathString.replace('/','');
-};
-
-SwaggerSpecConverter.prototype.operations = function(path, resourcePath, obj, resourceLevelAuth, swagger) {
- if(!Array.isArray(obj)) {
- return;
- }
- var i;
-
- if(!swagger.paths) {
- swagger.paths = {};
- }
-
- var pathObj = swagger.paths[path] || {};
- var tag = this.extractTag(resourcePath);
- swagger.tags = swagger.tags || [];
- var matched = false;
- for(i = 0; i < swagger.tags.length; i++) {
- var tagObject = swagger.tags[i];
- if(tagObject.name === tag) {
- matched = true;
- }
- }
- if(!matched) {
- swagger.tags.push({name: tag});
- }
-
- for(i = 0; i < obj.length; i++) {
- var existingOperation = obj[i];
- var method = (existingOperation.method || existingOperation.httpMethod).toLowerCase();
- var operation = {tags: [tag]};
- var existingAuthorizations = existingOperation.authorizations;
-
- if(existingAuthorizations && Object.keys(existingAuthorizations).length === 0) {
- existingAuthorizations = resourceLevelAuth;
- }
-
- if(typeof existingAuthorizations !== 'undefined') {
- var scopesObject;
- for(var key in existingAuthorizations) {
- operation.security = operation.security || [];
- var scopes = existingAuthorizations[key];
- if(scopes) {
- var securityScopes = [];
- for(var j in scopes) {
- securityScopes.push(scopes[j].scope);
- }
- scopesObject = {};
- scopesObject[key] = securityScopes;
- operation.security.push(scopesObject);
- }
- else {
- scopesObject = {};
- scopesObject[key] = [];
- operation.security.push(scopesObject);
- }
- }
- }
-
- if(existingOperation.consumes) {
- operation.consumes = existingOperation.consumes;
- }
- else if(swagger.consumes) {
- operation.consumes = swagger.consumes;
- }
- if(existingOperation.produces) {
- operation.produces = existingOperation.produces;
- }
- else if(swagger.produces) {
- operation.produces = swagger.produces;
- }
- if(existingOperation.summary) {
- operation.summary = existingOperation.summary;
- }
- if(existingOperation.notes) {
- operation.description = existingOperation.notes;
- }
- if(existingOperation.nickname) {
- operation.operationId = existingOperation.nickname;
- }
- if(existingOperation.deprecated) {
- operation.deprecated = existingOperation.deprecated;
- }
-
- this.authorizations(existingAuthorizations, swagger);
- this.parameters(operation, existingOperation.parameters, swagger);
- this.responseMessages(operation, existingOperation, swagger);
-
- pathObj[method] = operation;
- }
-
- swagger.paths[path] = pathObj;
-};
-
-SwaggerSpecConverter.prototype.responseMessages = function(operation, existingOperation) {
- if(!_.isObject(existingOperation)) {
- return;
- }
- // build default response from the operation (1.x)
- var defaultResponse = {};
- this.dataType(existingOperation, defaultResponse);
- // TODO: look into the real problem of rendering responses in swagger-ui
- // ....should reponseType have an implicit schema?
- if(!defaultResponse.schema && defaultResponse.type) {
- defaultResponse = {schema: defaultResponse};
- }
-
- operation.responses = operation.responses || {};
-
- // grab from responseMessages (1.2)
- var has200 = false;
- if(Array.isArray(existingOperation.responseMessages)) {
- var i;
- var existingResponses = existingOperation.responseMessages;
- for(i = 0; i < existingResponses.length; i++) {
- var existingResponse = existingResponses[i];
- var response = { description: existingResponse.message };
- if(existingResponse.code === 200) {
- has200 = true;
- }
- // Convert responseModel -> schema{$ref: responseModel}
- if(existingResponse.responseModel) {
- response.schema = {'$ref': '#/definitions/' + existingResponse.responseModel};
- }
- operation.responses['' + existingResponse.code] = response;
- }
- }
-
- if(has200) {
- operation.responses['default'] = defaultResponse;
- }
- else {
- operation.responses['200'] = defaultResponse;
- }
-};
-
-SwaggerSpecConverter.prototype.authorizations = function(obj) {
- // TODO
- if(!_.isObject(obj)) {
- return;
- }
-};
-
-SwaggerSpecConverter.prototype.parameters = function(operation, obj) {
- if(!Array.isArray(obj)) {
- return;
- }
- var i;
- for(i = 0; i < obj.length; i++) {
- var existingParameter = obj[i];
- var parameter = {};
- parameter.name = existingParameter.name;
- parameter.description = existingParameter.description;
- parameter.required = existingParameter.required;
- parameter.in = existingParameter.paramType;
-
- // per #168
- if(parameter.in === 'body') {
- parameter.name = 'body';
- }
- if(parameter.in === 'form') {
- parameter.in = 'formData';
- }
-
- if(existingParameter.enum) {
- parameter.enum = existingParameter.enum;
- }
-
- if(existingParameter.allowMultiple === true || existingParameter.allowMultiple === 'true') {
- var innerType = {};
- this.dataType(existingParameter, innerType);
- parameter.type = 'array';
- parameter.items = innerType;
-
- if(existingParameter.allowableValues) {
- var av = existingParameter.allowableValues;
- if(av.valueType === 'LIST') {
- parameter['enum'] = av.values;
- }
- }
- }
- else {
- this.dataType(existingParameter, parameter);
- }
- if(typeof existingParameter.defaultValue !== 'undefined') {
- parameter.default = existingParameter.defaultValue;
- }
-
- operation.parameters = operation.parameters || [];
- operation.parameters.push(parameter);
- }
-};
-
-SwaggerSpecConverter.prototype.dataType = function(source, target) {
- if(!_.isObject(source)) {
- return;
- }
-
- if(source.minimum) {
- target.minimum = source.minimum;
- }
- if(source.maximum) {
- target.maximum = source.maximum;
- }
- if (source.format) {
- target.format = source.format;
- }
-
- // default can be 'false'
- if(typeof source.defaultValue !== 'undefined') {
- target.default = source.defaultValue;
- }
-
- var jsonSchemaType = this.toJsonSchema(source);
- if(jsonSchemaType) {
- target = target || {};
- if(jsonSchemaType.type) {
- target.type = jsonSchemaType.type;
- }
- if(jsonSchemaType.format) {
- target.format = jsonSchemaType.format;
- }
- if(jsonSchemaType.$ref) {
- target.schema = {$ref: jsonSchemaType.$ref};
- }
- if(jsonSchemaType.items) {
- target.items = jsonSchemaType.items;
- }
- }
-};
-
-SwaggerSpecConverter.prototype.toJsonSchema = function(source) {
- if(!source) {
- return 'object';
- }
- var detectedType = (source.type || source.dataType || source.responseClass || '');
- var lcType = detectedType.toLowerCase();
- var format = (source.format || '').toLowerCase();
-
- if(lcType.indexOf('list[') === 0) {
- var innerType = detectedType.substring(5, detectedType.length - 1);
- var jsonType = this.toJsonSchema({type: innerType});
- return {type: 'array', items: jsonType};
- } else if(lcType === 'int' || (lcType === 'integer' && format === 'int32')) {
- {return {type: 'integer', format: 'int32'};}
- } else if(lcType === 'long' || (lcType === 'integer' && format === 'int64')) {
- {return {type: 'integer', format: 'int64'};}
- } else if(lcType === 'integer') {
- {return {type: 'integer', format: 'int64'};}
- } else if(lcType === 'float' || (lcType === 'number' && format === 'float')) {
- {return {type: 'number', format: 'float'};}
- } else if(lcType === 'double' || (lcType === 'number' && format === 'double')) {
- {return {type: 'number', format: 'double'};}
- } else if((lcType === 'string' && format === 'date-time') || (lcType === 'date')) {
- {return {type: 'string', format: 'date-time'};}
- } else if(lcType === 'string') {
- {return {type: 'string'};}
- } else if(lcType === 'file') {
- {return {type: 'file'};}
- } else if(lcType === 'boolean') {
- {return {type: 'boolean'};}
- } else if(lcType === 'boolean') {
- {return {type: 'boolean'};}
- } else if(lcType === 'array' || lcType === 'list') {
- if(source.items) {
- var it = this.toJsonSchema(source.items);
- return {type: 'array', items: it};
- }
- else {
- return {type: 'array', items: {type: 'object'}};
- }
- } else if(source.$ref) {
- return {$ref: this.modelMap[source.$ref] ? '#/definitions/' + this.modelMap[source.$ref] : source.$ref};
- } else if(lcType === 'void' || lcType === '') {
- {return {};}
- } else if (this.modelMap[source.type]) {
- // If this a model using `type` instead of `$ref`, that's fine.
- return {$ref: '#/definitions/' + this.modelMap[source.type]};
- } else {
- // Unknown model type or 'object', pass it along.
- return {type: source.type};
- }
-};
-
-SwaggerSpecConverter.prototype.resourceListing = function(obj, swagger, opts, callback) {
- var i;
- var processedCount = 0; // jshint ignore:line
- var self = this; // jshint ignore:line
- var expectedCount = obj.apis.length;
- var _swagger = swagger; // jshint ignore:line
- var _opts = {};
-
- if(opts && opts.requestInterceptor){
- _opts.requestInterceptor = opts.requestInterceptor;
- }
-
- if(opts && opts.responseInterceptor){
- _opts.responseInterceptor = opts.responseInterceptor;
- }
-
- var swaggerRequestHeaders = 'application/json';
-
- if(opts && opts.swaggerRequestHeaders) {
- swaggerRequestHeaders = opts.swaggerRequestHeaders;
- }
-
- if(expectedCount === 0) {
- this.finish(callback, swagger);
- }
-
- for(i = 0; i < expectedCount; i++) {
- var api = obj.apis[i];
- var path = api.path;
- var absolutePath = this.getAbsolutePath(obj.swaggerVersion, this.docLocation, path);
-
- if(api.description) {
- swagger.tags = swagger.tags || [];
- swagger.tags.push({
- name : this.extractTag(api.path),
- description : api.description || ''
- });
- }
- var http = {
- url: absolutePath,
- headers: { accept: swaggerRequestHeaders },
- on: {},
- method: 'get',
- timeout: opts.timeout
- };
- /* jshint ignore:start */
- http.on.response = function(data) {
- processedCount += 1;
- var obj = data.obj;
- if(obj) {
- self.declaration(obj, _swagger);
- }
- if(processedCount === expectedCount) {
- self.finish(callback, _swagger);
- }
- };
- http.on.error = function(data) {
- console.error(data);
- processedCount += 1;
- if(processedCount === expectedCount) {
- self.finish(callback, _swagger);
- }
- };
- /* jshint ignore:end */
-
- if(this.clientAuthorizations && typeof this.clientAuthorizations.apply === 'function') {
- this.clientAuthorizations.apply(http);
- }
-
- new SwaggerHttp().execute(http, _opts);
- }
-};
-
-SwaggerSpecConverter.prototype.getAbsolutePath = function(version, docLocation, path) {
- if(version === '1.0') {
- if(docLocation.endsWith('.json')) {
- // get root path
- var pos = docLocation.lastIndexOf('/');
- if(pos > 0) {
- docLocation = docLocation.substring(0, pos);
- }
- }
- }
-
- var location = docLocation;
- if(path.indexOf('http:') === 0 || path.indexOf('https:') === 0) {
- location = path;
- }
- else {
- if(docLocation.endsWith('/')) {
- location = docLocation.substring(0, docLocation.length - 1);
- }
- location += path;
- }
- location = location.replace('{format}', 'json');
- return location;
-};
-
-SwaggerSpecConverter.prototype.securityDefinitions = function(obj, swagger) {
- if(obj.authorizations) {
- var name;
- for(name in obj.authorizations) {
- var isValid = false;
- var securityDefinition = {
- vendorExtensions: {}
- };
- var definition = obj.authorizations[name];
- if(definition.type === 'apiKey') {
- securityDefinition.type = 'apiKey';
- securityDefinition.in = definition.passAs;
- securityDefinition.name = definition.keyname || name;
- isValid = true;
- }
- else if(definition.type === 'basicAuth') {
- securityDefinition.type = 'basicAuth';
- isValid = true;
- }
- else if(definition.type === 'oauth2') {
- var existingScopes = definition.scopes || [];
- var scopes = {};
- var i;
- for(i in existingScopes) {
- var scope = existingScopes[i];
- scopes[scope.scope] = scope.description;
- }
- securityDefinition.type = 'oauth2';
- if(i > 0) {
- securityDefinition.scopes = scopes;
- }
- if(definition.grantTypes) {
- if(definition.grantTypes.implicit) {
- var implicit = definition.grantTypes.implicit;
- securityDefinition.flow = 'implicit';
- securityDefinition.authorizationUrl = implicit.loginEndpoint;
- isValid = true;
- }
- /* jshint ignore:start */
- if(definition.grantTypes['authorization_code']) {
- if(!securityDefinition.flow) {
- // cannot set if flow is already defined
- var authCode = definition.grantTypes['authorization_code'];
- securityDefinition.flow = 'accessCode';
- securityDefinition.authorizationUrl = authCode.tokenRequestEndpoint.url;
- securityDefinition.tokenUrl = authCode.tokenEndpoint.url;
- isValid = true;
- }
- }
- /* jshint ignore:end */
- }
- }
- if(isValid) {
- swagger.securityDefinitions = swagger.securityDefinitions || {};
- swagger.securityDefinitions[name] = securityDefinition;
- }
- }
- }
-};
-
-SwaggerSpecConverter.prototype.apiInfo = function(obj, swagger) {
- // info section
- if(obj.info) {
- var info = obj.info;
- swagger.info = {};
-
- if(info.contact) {
- swagger.info.contact = {};
- swagger.info.contact.email = info.contact;
- }
- if(info.description) {
- swagger.info.description = info.description;
- }
- if(info.title) {
- swagger.info.title = info.title;
- }
- if(info.termsOfServiceUrl) {
- swagger.info.termsOfService = info.termsOfServiceUrl;
- }
- if(info.license || info.licenseUrl) {
- swagger.license = {};
- if(info.license) {
- swagger.license.name = info.license;
- }
- if(info.licenseUrl) {
- swagger.license.url = info.licenseUrl;
- }
- }
- }
- else {
- this.warnings.push('missing info section');
- }
-};
-
-SwaggerSpecConverter.prototype.finish = function (callback, obj) {
- callback(obj);
-};
-
-},{"./http":5,"lodash-compat/lang/isObject":144}],9:[function(require,module,exports){
-'use strict';
-
-var log = require('../helpers').log;
-var _ = {
- isPlainObject: require('lodash-compat/lang/isPlainObject'),
- isString: require('lodash-compat/lang/isString'),
-};
-
-var SchemaMarkup = require('../schema-markup.js');
-var jsyaml = require('js-yaml');
-
-var Model = module.exports = function (name, definition, models, modelPropertyMacro) {
- this.definition = definition || {};
- this.isArray = definition.type === 'array';
- this.models = models || {};
- this.name = name || definition.title || 'Inline Model';
- this.modelPropertyMacro = modelPropertyMacro || function (property) {
- return property.default;
- };
-
- return this;
-};
-
-// Note! This function will be removed in 2.2.x!
-Model.prototype.createJSONSample = Model.prototype.getSampleValue = function (modelsToIgnore) {
- modelsToIgnore = modelsToIgnore || {};
-
- modelsToIgnore[this.name] = this;
-
- // Response support
- if (this.examples && _.isPlainObject(this.examples) && this.examples['application/json']) {
- this.definition.example = this.examples['application/json'];
-
- if (_.isString(this.definition.example)) {
- this.definition.example = jsyaml.safeLoad(this.definition.example);
- }
- } else if (!this.definition.example) {
- this.definition.example = this.examples;
- }
-
- return SchemaMarkup.schemaToJSON(this.definition, this.models, modelsToIgnore, this.modelPropertyMacro);
-};
-
-Model.prototype.getMockSignature = function () {
- return SchemaMarkup.schemaToHTML(this.name, this.definition, this.models, this.modelPropertyMacro);
-};
-
-},{"../helpers":4,"../schema-markup.js":7,"js-yaml":19,"lodash-compat/lang/isPlainObject":145,"lodash-compat/lang/isString":146}],10:[function(require,module,exports){
-'use strict';
-
-var _ = {
- cloneDeep: require('lodash-compat/lang/cloneDeep'),
- isUndefined: require('lodash-compat/lang/isUndefined'),
- isEmpty: require('lodash-compat/lang/isEmpty'),
- isObject: require('lodash-compat/lang/isObject')
-};
-var helpers = require('../helpers');
-var Model = require('./model');
-var SwaggerHttp = require('../http');
-var Q = require('q');
-
-var Operation = module.exports = function (parent, scheme, operationId, httpMethod, path, args, definitions, models, clientAuthorizations) {
- var errors = [];
-
- parent = parent || {};
- args = args || {};
-
- if(parent && parent.options) {
- this.client = parent.options.client || null;
- this.requestInterceptor = parent.options.requestInterceptor || null;
- this.responseInterceptor = parent.options.responseInterceptor || null;
- this.requestAgent = parent.options.requestAgent;
- }
- this.authorizations = args.security;
- this.basePath = parent.basePath || '/';
- this.clientAuthorizations = clientAuthorizations;
- this.consumes = args.consumes || parent.consumes || ['application/json'];
- this.produces = args.produces || parent.produces || ['application/json'];
- this.deprecated = args.deprecated;
- this.description = args.description;
- this.host = parent.host;
- this.method = (httpMethod || errors.push('Operation ' + operationId + ' is missing method.'));
- this.models = models || {};
- this.nickname = (operationId || errors.push('Operations must have a nickname.'));
- this.operation = args;
- this.operations = {};
- this.parameters = args !== null ? (args.parameters || []) : {};
- this.parent = parent;
- this.path = (path || errors.push('Operation ' + this.nickname + ' is missing path.'));
- this.responses = (args.responses || {});
- this.scheme = scheme || parent.scheme || 'http';
- this.schemes = args.schemes || parent.schemes;
- this.security = args.security || parent.security;
- this.summary = args.summary || '';
- this.timeout = parent.timeout;
- this.type = null;
- this.useJQuery = parent.useJQuery;
- this.jqueryAjaxCache = parent.jqueryAjaxCache;
- this.enableCookies = parent.enableCookies;
-
- var key;
-
- if(!this.host) {
- if(typeof window !== 'undefined') {
- this.host = window.location.host;
- }
- else {
- this.host = 'localhost';
- }
- }
- this.parameterMacro = parent.parameterMacro || function (operation, parameter) {
- return parameter.default;
- };
-
- this.inlineModels = [];
-
- if(this.basePath !== '/' && this.basePath.slice(-1) === '/') {
- this.basePath = this.basePath.slice(0, -1);
- }
-
- if (typeof this.deprecated === 'string') {
- switch(this.deprecated.toLowerCase()) {
- case 'true': case 'yes': case '1': {
- this.deprecated = true;
- break;
- }
-
- case 'false': case 'no': case '0': case null: {
- this.deprecated = false;
- break;
- }
-
- default: this.deprecated = Boolean(this.deprecated);
- }
- }
-
- var i, model;
-
- if (definitions) {
- // add to global models
- for (key in definitions) {
- model = new Model(key, definitions[key], this.models, parent.modelPropertyMacro);
-
- if (model) {
- this.models[key] = model;
- }
- }
- }
- else {
- definitions = {};
- }
-
- for (i = 0; i < this.parameters.length; i++) {
- var d, param = this.parameters[i];
-
- // Allow macro to set the default value
- param.default = this.parameterMacro(this, param);
-
- if (param.type === 'array') {
- param.isList = true;
- param.allowMultiple = true;
- }
-
- var innerType = this.getType(param);
-
- if (innerType && innerType.toString().toLowerCase() === 'boolean') {
- param.allowableValues = {};
- param.isList = true;
- param['enum'] = [true, false]; // use actual primitives
- }
-
- for(key in param) {
- helpers.extractExtensions(key, param);
- }
- if(typeof param['x-example'] !== 'undefined') {
- d = param['x-example'];
- param.default = d;
- }
- if(param['x-examples']) {
- d = param['x-examples'].default;
- if(typeof d !== 'undefined') {
- param.default = d;
- }
- }
-
- var enumValues = param['enum'] || (param.items && param.items['enum']);
-
- if (typeof enumValues !== 'undefined') {
- var id;
-
- param.allowableValues = {};
- param.allowableValues.values = [];
- param.allowableValues.descriptiveValues = [];
-
- for (id = 0; id < enumValues.length; id++) {
- var value = enumValues[id];
- var isDefault = (value === param.default || value+'' === param.default);
-
- param.allowableValues.values.push(value);
- // Always have string for descriptive values....
- param.allowableValues.descriptiveValues.push({value : value+'', isDefault: isDefault});
- }
- }
-
- if (param.type === 'array') {
- innerType = [innerType];
-
- if (typeof param.allowableValues === 'undefined') {
- // can't show as a list if no values to select from
- delete param.isList;
- delete param.allowMultiple;
- }
- }
-
- param.modelSignature = {type: innerType, definitions: this.models};
- param.signature = this.getModelSignature(innerType, this.models).toString();
- param.sampleJSON = this.getModelSampleJSON(innerType, this.models);
- param.responseClassSignature = param.signature;
- }
-
- var keyname, defaultResponseCode, response, responses = this.responses;
-
- if (responses['200']) {
- response = responses['200'];
- defaultResponseCode = '200';
- } else if (responses['201']) {
- response = responses['201'];
- defaultResponseCode = '201';
- } else if (responses['202']) {
- response = responses['202'];
- defaultResponseCode = '202';
- } else if (responses['203']) {
- response = responses['203'];
- defaultResponseCode = '203';
- } else if (responses['204']) {
- response = responses['204'];
- defaultResponseCode = '204';
- } else if (responses['205']) {
- response = responses['205'];
- defaultResponseCode = '205';
- } else if (responses['206']) {
- response = responses['206'];
- defaultResponseCode = '206';
- } else if (responses['default']) {
- response = responses['default'];
- defaultResponseCode = 'default';
- }
-
- for(keyname in responses) {
- helpers.extractExtensions(keyname, responses);
- if(typeof keyname === 'string' && keyname.indexOf('x-') === -1) {
- var responseObject = responses[keyname];
- if(typeof responseObject === 'object' && typeof responseObject.headers === 'object') {
- var headers = responseObject.headers;
- for(var headerName in headers) {
- var header = headers[headerName];
- if(typeof header === 'object') {
- for(var headerKey in header) {
- helpers.extractExtensions(headerKey, header);
- }
- }
- }
- }
- }
- }
-
- if (response) {
- for(keyname in response) {
- helpers.extractExtensions(keyname, response);
- }
- }
-
- if (response && response.schema) {
- var resolvedModel = this.resolveModel(response.schema, definitions);
- var successResponse;
-
- delete responses[defaultResponseCode];
-
- if (resolvedModel) {
- this.successResponse = {};
- successResponse = this.successResponse[defaultResponseCode] = resolvedModel;
- } else if (!response.schema.type || response.schema.type === 'object' || response.schema.type === 'array') {
- // Inline model
- this.successResponse = {};
- successResponse = this.successResponse[defaultResponseCode] = new Model(undefined, response.schema || {}, this.models, parent.modelPropertyMacro);
- } else {
- // Primitive
- this.successResponse = {};
- successResponse = this.successResponse[defaultResponseCode] = response.schema;
- }
-
- if (successResponse) {
- successResponse.vendorExtensions = response.vendorExtensions;
- // Attach response properties
- if (response.description) {
- successResponse.description = response.description;
- }
-
- if (response.examples) {
- successResponse.examples = response.examples;
- }
-
- if (response.headers) {
- successResponse.headers = response.headers;
- }
- }
-
- this.type = response;
- }
-
- if (errors.length > 0) {
- if (this.resource && this.resource.api && this.resource.api.fail) {
- this.resource.api.fail(errors);
- }
- }
-
- return this;
-};
-
-Operation.prototype.isDefaultArrayItemValue = function(value, param) {
- if (param.default && Array.isArray(param.default)) {
- return param.default.indexOf(value) !== -1;
- }
- return value === param.default;
-};
-
-Operation.prototype.getType = function (param) {
- var type = param.type;
- var format = param.format;
- var isArray = false;
- var str;
-
- if (type === 'integer' && format === 'int32') {
- str = 'integer';
- } else if (type === 'integer' && format === 'int64') {
- str = 'long';
- } else if (type === 'integer') {
- str = 'integer';
- } else if (type === 'string') {
- if (format === 'date-time') {
- str = 'date-time';
- } else if (format === 'date') {
- str = 'date';
- } else {
- str = 'string';
- }
- } else if (type === 'number' && format === 'float') {
- str = 'float';
- } else if (type === 'number' && format === 'double') {
- str = 'double';
- } else if (type === 'number') {
- str = 'double';
- } else if (type === 'boolean') {
- str = 'boolean';
- } else if (type === 'array') {
- isArray = true;
-
- if (param.items) {
- str = this.getType(param.items);
- }
- } else if (type === 'file') {
- str = 'file';
- }
-
- if (param.$ref) {
- str = helpers.simpleRef(param.$ref);
- }
-
- var schema = param.schema;
-
- if (schema) {
- var ref = schema.$ref;
-
- if (ref) {
- ref = helpers.simpleRef(ref);
-
- if (isArray) {
- return [ ref ];
- } else {
- return ref;
- }
- } else {
- // If inline schema, we add it our interal hash -> which gives us it's ID (int)
- if(schema.type === 'object') {
- return this.addInlineModel(schema);
- }
- return this.getType(schema);
- }
- }
- if (isArray) {
- return [ str ];
- } else {
- return str;
- }
-};
-
-/**
- * adds an inline schema (model) to a hash, where we can ref it later
- * @param {object} schema a schema
- * @return {number} the ID of the schema being added, or null
- **/
-Operation.prototype.addInlineModel = function (schema) {
- var len = this.inlineModels.length;
- var model = this.resolveModel(schema, {});
- if(model) {
- this.inlineModels.push(model);
- return 'Inline Model '+len; // return string ref of the inline model (used with #getInlineModel)
- }
- return null; // report errors?
-};
-
-/**
- * gets the internal ref to an inline model
- * @param {string} inline_str a string reference to an inline model
- * @return {Model} the model being referenced. Or null
- **/
-Operation.prototype.getInlineModel = function(inlineStr) {
- if(/^Inline Model \d+$/.test(inlineStr)) {
- var id = parseInt(inlineStr.substr('Inline Model'.length).trim(),10); //
- var model = this.inlineModels[id];
- return model;
- }
- // I'm returning null here, should I rather throw an error?
- return null;
-};
-
-Operation.prototype.resolveModel = function (schema, definitions) {
- if (typeof schema.$ref !== 'undefined') {
- var ref = schema.$ref;
-
- if (ref.indexOf('#/definitions/') === 0) {
- ref = ref.substring('#/definitions/'.length);
- }
-
- if (definitions[ref]) {
- return new Model(ref, definitions[ref], this.models, this.parent.modelPropertyMacro);
- }
- // schema must at least be an object to get resolved to an inline Model
- } else if (schema && typeof schema === 'object' &&
- (schema.type === 'object' || _.isUndefined(schema.type))) {
- return new Model(undefined, schema, this.models, this.parent.modelPropertyMacro);
- }
-
- return null;
-};
-
-Operation.prototype.help = function (dontPrint) {
- var out = this.nickname + ': ' + this.summary + '\n';
-
- for (var i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
- var typeInfo = param.signature;
-
- out += '\n * ' + param.name + ' (' + typeInfo + '): ' + param.description;
- }
-
- if (typeof dontPrint === 'undefined') {
- helpers.log(out);
- }
-
- return out;
-};
-
-Operation.prototype.getModelSignature = function (type, definitions) {
- var isPrimitive, listType;
-
- if (type instanceof Array) {
- listType = true;
- type = type[0];
- }
-
- // Convert undefined to string of 'undefined'
- if (typeof type === 'undefined') {
- type = 'undefined';
- isPrimitive = true;
-
- } else if (definitions[type]){
- // a model def exists?
- type = definitions[type]; /* Model */
- isPrimitive = false;
-
- } else if (this.getInlineModel(type)) {
- type = this.getInlineModel(type); /* Model */
- isPrimitive = false;
-
- } else {
- // We default to primitive
- isPrimitive = true;
- }
-
- if (isPrimitive) {
- if (listType) {
- return 'Array[' + type + ']';
- } else {
- return type.toString();
- }
- } else {
- if (listType) {
- return 'Array[' + type.getMockSignature() + ']';
- } else {
- return type.getMockSignature();
- }
- }
-};
-
-Operation.prototype.supportHeaderParams = function () {
- return true;
-};
-
-Operation.prototype.supportedSubmitMethods = function () {
- return this.parent.supportedSubmitMethods;
-};
-
-Operation.prototype.getHeaderParams = function (args) {
- var headers = this.setContentTypes(args, {});
- var headerParamsByLowerCase = {};
-
- for (var i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
-
- if (param.in === 'header') {
- headerParamsByLowerCase[param.name.toLowerCase()] = param;
- }
- }
-
- for (var arg in args) {
- var headerParam = headerParamsByLowerCase[arg.toLowerCase()];
- if (typeof headerParam !== 'undefined') {
- var value = args[arg];
-
- if (Array.isArray(value)) {
- value = value.toString();
- }
-
- headers[headerParam.name] = value;
- }
- }
-
- return headers;
-};
-
-Operation.prototype.urlify = function (args, maskPasswords) {
- var formParams = {};
- var requestUrl = this.path.replace(/#.*/, ''); // remove URL fragment
- var querystring = ''; // grab params from the args, build the querystring along the way
-
- for (var i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
-
- if (typeof args[param.name] !== 'undefined') {
- var isPassword;
- if(param.type === 'string' && param.format === 'password' && maskPasswords) {
- isPassword = true;
- }
-
- if (param.in === 'path') {
- var reg = new RegExp('\{' + param.name + '\}', 'gi');
- var value = args[param.name];
-
- if (Array.isArray(value)) {
- value = this.encodePathCollection(param.collectionFormat, param.name, value, isPassword);
- } else {
- value = this.encodePathParam(value, isPassword);
- }
-
- requestUrl = requestUrl.replace(reg, value);
- } else if (param.in === 'query' && typeof args[param.name] !== 'undefined') {
- if (querystring === '' && requestUrl.indexOf('?') < 0) {
- querystring += '?';
- } else {
- querystring += '&';
- }
-
- if (typeof param.collectionFormat !== 'undefined') {
- var qp = args[param.name];
-
- if (Array.isArray(qp)) {
- querystring += this.encodeQueryCollection(param.collectionFormat, param.name, qp, isPassword);
- } else {
- querystring += this.encodeQueryKey(param.name) + '=' + this.encodeQueryParam(args[param.name], isPassword);
- }
- } else {
- querystring += this.encodeQueryKey(param.name) + '=' + this.encodeQueryParam(args[param.name], isPassword);
- }
- } else if (param.in === 'formData') {
- formParams[param.name] = args[param.name];
- }
- }
- }
- var url = this.scheme + '://' + this.host;
-
- if (this.basePath !== '/') {
- url += this.basePath;
- }
- return url + requestUrl + querystring;
-};
-
-Operation.prototype.getMissingParams = function (args) {
- var missingParams = []; // check required params, track the ones that are missing
- var i;
-
- for (i = 0; i < this.parameters.length; i++) {
- var param = this.parameters[i];
-
- if (param.required === true) {
- if (typeof args[param.name] === 'undefined') {
- missingParams = param.name;
- }
- }
- }
-
- return missingParams;
-};
-
-Operation.prototype.getBody = function (headers, args, opts) {
- var formParams = {}, hasFormParams, param, body, key, value, hasBody = false;
-
- // look at each param and put form params in an object
- for (var i = 0; i < this.parameters.length; i++) {
- param = this.parameters[i];
- if (typeof args[param.name] !== 'undefined') {
- var isPassword;
- if(param.type === 'string' && param.format === 'password') {
- isPassword = 'password';
- }
- if (param.in === 'body') {
- body = args[param.name];
- } else if (param.in === 'formData') {
- formParams[param.name] = {
- param: param,
- value: args[param.name],
- password: isPassword
- };
- hasFormParams = true;
- }
- }
- else {
- if(param.in === 'body') {
- hasBody = true;
- }
- }
- }
-
- // if body is null and hasBody is true, AND a JSON body is requested, send empty {}
- if(hasBody && typeof body === 'undefined') {
- var contentType = headers['Content-Type'];
- if(contentType && contentType.indexOf('application/json') === 0) {
- body = '{}';
- }
- }
-
- var isMultiPart = false;
- if(headers['Content-Type'] && headers['Content-Type'].indexOf('multipart/form-data') >= 0) {
- isMultiPart = true;
- }
-
- // handle form params
- if (hasFormParams && !isMultiPart) {
- var encoded = '';
-
- for (key in formParams) {
- param = formParams[key].param;
- value = formParams[key].value;
- var password;
-
- if(opts && opts.maskPasswords) {
- password = formParams[key].password;
- }
-
- if (typeof value !== 'undefined') {
- if (Array.isArray(value)) {
- if (encoded !== '') {
- encoded += '&';
- }
- encoded += this.encodeQueryCollection(param.collectionFormat, key, value, password);
- }
- else {
- if (encoded !== '') {
- encoded += '&';
- }
-
- encoded += encodeURIComponent(key) + '=' + mask(encodeURIComponent(value), password);
- }
- }
- }
-
- body = encoded;
- } else if (isMultiPart) {
- var bodyParam;
- if (typeof FormData === 'function') {
- bodyParam = new FormData();
-
- bodyParam.type = 'formData';
-
- for (key in formParams) {
- param = formParams[key].param;
- value = args[key];
-
- if (typeof value !== 'undefined') {
- if({}.toString.apply(value) === '[object File]') {
- bodyParam.append(key, value);
- }
- else if (value.type === 'file' && value.value) {
- bodyParam.append(key, value.value);
- } else {
- if (Array.isArray(value)) {
- if(param.collectionFormat === 'multi') {
- bodyParam.delete(key);
- for(var v in value) {
- bodyParam.append(key, value[v]);
- }
- }
- else {
- bodyParam.append(key, this.encodeQueryCollection(param.collectionFormat, key, value).split('=').slice(1).join('='));
- }
- }
- else {
- bodyParam.append(key, value);
- }
- }
- }
- }
- body = bodyParam;
- }
- else {
- bodyParam = {};
- for (key in formParams) {
- value = args[key];
- if (Array.isArray(value)) {
- var delimeter;
- var format = param.collectionFormat || 'multi';
- if(format === 'ssv') {
- delimeter = ' ';
- }
- else if(format === 'pipes') {
- delimeter = '|';
- }
- else if(format === 'tsv') {
- delimeter = '\t';
- }
- else if(format === 'multi') {
- bodyParam[key] = value;
- break;
- }
- else {
- delimeter = ',';
- }
- var data;
- value.forEach(function(v) {
- if(data) {
- data += delimeter;
- }
- else {
- data = '';
- }
- data += v;
- });
- bodyParam[key] = data;
- }
- else {
- bodyParam[key] = value;
- }
- }
- body = bodyParam;
- }
- headers['Content-Type'] = 'multipart/form-data';
- }
-
- return body;
-};
-
-/**
- * gets sample response for a single operation
- **/
-Operation.prototype.getModelSampleJSON = function (type, models) {
- var listType, sampleJson, innerType;
- models = models || {};
-
- listType = (type instanceof Array);
- innerType = listType ? type[0] : type;
-
- if(models[innerType]) {
- sampleJson = models[innerType].createJSONSample();
- } else if (this.getInlineModel(innerType)){
- sampleJson = this.getInlineModel(innerType).createJSONSample(); // may return null, if type isn't correct
- }
-
-
- if (sampleJson) {
- sampleJson = listType ? [sampleJson] : sampleJson;
-
- if (typeof sampleJson === 'string') {
- return sampleJson;
- } else if (_.isObject(sampleJson)) {
- var t = sampleJson;
-
- if (sampleJson instanceof Array && sampleJson.length > 0) {
- t = sampleJson[0];
- }
-
- if (t.nodeName && typeof t === 'Node') {
- var xmlString = new XMLSerializer().serializeToString(t);
-
- return this.formatXml(xmlString);
- } else {
- return JSON.stringify(sampleJson, null, 2);
- }
- } else {
- return sampleJson;
- }
- }
-};
-
-/**
- * legacy binding
- **/
-Operation.prototype.do = function (args, opts, callback, error, parent) {
- return this.execute(args, opts, callback, error, parent);
-};
-
-/**
- * executes an operation
- **/
-Operation.prototype.execute = function (arg1, arg2, arg3, arg4, parent) {
- var args = arg1 || {};
- var opts = {}, success, error, deferred, timeout;
-
- if (_.isObject(arg2)) {
- opts = arg2;
- success = arg3;
- error = arg4;
- }
-
- timeout = typeof opts.timeout !== 'undefined' ? opts.timeout : this.timeout;
-
- if(this.client) {
- opts.client = this.client;
- }
-
- if(this.requestAgent) {
- opts.requestAgent = this.requestAgent;
- }
-
- // add the request interceptor from parent, if none sent from client
- if(!opts.requestInterceptor && this.requestInterceptor ) {
- opts.requestInterceptor = this.requestInterceptor ;
- }
-
- if(!opts.responseInterceptor && this.responseInterceptor) {
- opts.responseInterceptor = this.responseInterceptor;
- }
-
- if (typeof arg2 === 'function') {
- success = arg2;
- error = arg3;
- }
-
- if (this.parent.usePromise) {
- deferred = Q.defer();
- } else {
- success = (success || this.parent.defaultSuccessCallback || helpers.log);
- error = (error || this.parent.defaultErrorCallback || helpers.log);
- }
-
- if (typeof opts.useJQuery === 'undefined') {
- opts.useJQuery = this.useJQuery;
- }
-
- if (typeof opts.jqueryAjaxCache === 'undefined') {
- opts.jqueryAjaxCache = this.jqueryAjaxCache;
- }
-
- if (typeof opts.enableCookies === 'undefined') {
- opts.enableCookies = this.enableCookies;
- }
-
- var missingParams = this.getMissingParams(args);
-
- if (missingParams.length > 0) {
- var message = 'missing required params: ' + missingParams;
-
- helpers.fail(message);
-
- if (this.parent.usePromise) {
- deferred.reject(message);
- return deferred.promise;
- } else {
- error(message, parent);
- return {};
- }
- }
-
- var allHeaders = this.getHeaderParams(args);
- var contentTypeHeaders = this.setContentTypes(args, opts);
- var headers = {}, attrname;
-
- for (attrname in allHeaders) { headers[attrname] = allHeaders[attrname]; }
- for (attrname in contentTypeHeaders) { headers[attrname] = contentTypeHeaders[attrname]; }
-
- var body = this.getBody(contentTypeHeaders, args, opts);
- var url = this.urlify(args, opts.maskPasswords);
-
- if(url.indexOf('.{format}') > 0) {
- if(headers) {
- var format = headers.Accept || headers.accept;
- if(format && format.indexOf('json') > 0) {
- url = url.replace('.{format}', '.json');
- }
- else if(format && format.indexOf('xml') > 0) {
- url = url.replace('.{format}', '.xml');
- }
- }
- }
-
- var obj = {
- url: url,
- method: this.method.toUpperCase(),
- body: body,
- enableCookies: opts.enableCookies,
- useJQuery: opts.useJQuery,
- jqueryAjaxCache: opts.jqueryAjaxCache,
- deferred: deferred,
- headers: headers,
- clientAuthorizations: opts.clientAuthorizations,
- operation: this,
- connectionAgent: this.connectionAgent,
- on: {
- response: function (response) {
- if (deferred) {
- deferred.resolve(response);
- return deferred.promise;
- } else {
- return success(response, parent);
- }
- },
- error: function (response) {
- if (deferred) {
- deferred.reject(response);
- return deferred.promise;
- } else {
- return error(response, parent);
- }
- }
- }
- };
-
- if (timeout) {
- obj.timeout = timeout;
- }
-
- this.clientAuthorizations.apply(obj, this.operation.security);
- if (opts.mock === true) {
- return obj;
- } else {
- return new SwaggerHttp().execute(obj, opts);
- }
-};
-
-function itemByPriority(col, itemPriority) {
-
- // No priorities? return first...
- if(_.isEmpty(itemPriority)) {
- return col[0];
- }
-
- for (var i = 0, len = itemPriority.length; i < len; i++) {
- if(col.indexOf(itemPriority[i]) > -1) {
- return itemPriority[i];
- }
- }
-
- // Otherwise return first
- return col[0];
-}
-
-Operation.prototype.setContentTypes = function (args, opts) {
- // default type
- var allDefinedParams = this.parameters;
- var body;
- var consumes = args.parameterContentType || itemByPriority(this.consumes, ['application/json', 'application/yaml']);
- var accepts = opts.responseContentType || itemByPriority(this.produces, ['application/json', 'application/yaml']);
- var definedFileParams = [];
- var definedFormParams = [];
- var headers = {};
- var i;
-
- // get params from the operation and set them in definedFileParams, definedFormParams, headers
- for (i = 0; i < allDefinedParams.length; i++) {
- var param = allDefinedParams[i];
-
- if (param.in === 'formData') {
- if (param.type === 'file') {
- definedFileParams.push(param);
- } else {
- definedFormParams.push(param);
- }
- } else if (param.in === 'header' && opts) {
- var key = param.name;
- var headerValue = opts[param.name];
-
- if (typeof opts[param.name] !== 'undefined') {
- headers[key] = headerValue;
- }
- } else if (param.in === 'body' && typeof args[param.name] !== 'undefined') {
- body = args[param.name];
- }
- }
-
- // if there's a body, need to set the consumes header via requestContentType
- var hasBody = body || definedFileParams.length || definedFormParams.length;
- if (this.method === 'post' || this.method === 'put' || this.method === 'patch' ||
- ((this.method === 'delete' || this.method === 'get') && hasBody)) {
- if (opts.requestContentType) {
- consumes = opts.requestContentType;
- }
- // if any form params, content type must be set
- if (definedFormParams.length > 0) {
- consumes = undefined;
- if (opts.requestContentType) { // override if set
- consumes = opts.requestContentType;
- } else if (definedFileParams.length > 0) { // if a file, must be multipart/form-data
- consumes = 'multipart/form-data';
- } else {
- if (this.consumes && this.consumes.length > 0) {
- // use the consumes setting
- for(var c in this.consumes) {
- var chk = this.consumes[c];
- if(chk.indexOf('application/x-www-form-urlencoded') === 0 || chk.indexOf('multipart/form-data') === 0) {
- consumes = chk;
- }
- }
- }
- }
- if(typeof consumes === 'undefined') {
- // default to x-www-from-urlencoded
- consumes = 'application/x-www-form-urlencoded';
- }
- }
- }
- else {
- consumes = null;
- }
-
- if (consumes && this.consumes) {
- if (this.consumes.indexOf(consumes) === -1) {
- helpers.log('server doesn\'t consume ' + consumes + ', try ' + JSON.stringify(this.consumes));
- }
- }
-
- if (!this.matchesAccept(accepts)) {
- helpers.log('server can\'t produce ' + accepts);
- }
-
- if ((consumes && body !== '') || (consumes === 'application/x-www-form-urlencoded')) {
- headers['Content-Type'] = consumes;
- }
- else if(this.consumes && this.consumes.length > 0 && this.consumes[0] === 'application/x-www-form-urlencoded') {
- headers['Content-Type'] = this.consumes[0];
- }
-
- if (accepts) {
- headers.Accept = accepts;
- }
-
- return headers;
-};
-
-/**
- * Returns true if the request accepts header matches anything in this.produces.
- * If this.produces contains * / *, ignore the accept header.
- * @param {string=} accepts The client request accept header.
- * @return {boolean}
- */
-Operation.prototype.matchesAccept = function(accepts) {
- // no accepts or produces, no problem!
- if (!accepts || !this.produces) {
- return true;
- }
- return this.produces.indexOf(accepts) !== -1 || this.produces.indexOf('*/*') !== -1;
-};
-
-Operation.prototype.asCurl = function (args1, args2) {
- var opts = {mock: true, maskPasswords: true};
- if (typeof args2 === 'object') {
- for (var argKey in args2) {
- opts[argKey] = args2[argKey];
- }
- }
- var obj = this.execute(args1, opts);
-
- this.clientAuthorizations.apply(obj, this.operation.security);
-
- var results = [];
-
- results.push('-X ' + this.method.toUpperCase());
-
- if (typeof obj.headers !== 'undefined') {
- var key;
-
- for (key in obj.headers) {
- var value = obj.headers[key];
- if(typeof value === 'string'){
- value = value.replace(/\'/g, '\\u0027');
- }
- results.push('--header \'' + key + ': ' + value + '\'');
- }
- }
- var isFormData = false;
- var isMultipart = false;
-
- var type = obj.headers['Content-Type'];
- if(type && type.indexOf('application/x-www-form-urlencoded') === 0) {
- isFormData = true;
- }
- else if (type && type.indexOf('multipart/form-data') === 0) {
- isFormData = true;
- isMultipart = true;
- }
-
- if (obj.body) {
- var body;
- if (_.isObject(obj.body)) {
- if(isMultipart) {
- isMultipart = true;
- // add the form data
- for(var i = 0; i < this.parameters.length; i++) {
- var parameter = this.parameters[i];
- if(parameter.in === 'formData') {
- if (!body) {
- body = '';
- }
-
- var paramValue;
- if(typeof FormData === 'function' && obj.body instanceof FormData) {
- paramValue = obj.body.getAll(parameter.name);
- }
- else {
- paramValue = obj.body[parameter.name];
- }
- if (paramValue) {
- if (parameter.type === 'file') {
- if(paramValue.name) {
- body += '-F ' + parameter.name + '=@"' + paramValue.name + '" ';
- }
- }
- else {
- if (Array.isArray(paramValue)) {
- if(parameter.collectionFormat === 'multi') {
- for(var v in paramValue) {
- body += '-F ' + this.encodeQueryKey(parameter.name) + '=' + mask(paramValue[v], parameter.format) + ' ';
- }
- }
- else {
- body += '-F ' + this.encodeQueryCollection(parameter.collectionFormat, parameter.name, mask(paramValue, parameter.format)) + ' ';
- }
- } else {
- body += '-F ' + this.encodeQueryKey(parameter.name) + '=' + mask(paramValue, parameter.format) + ' ';
- }
- }
- }
- }
- }
- }
- if(!body) {
- body = JSON.stringify(obj.body);
- }
- } else {
- body = obj.body;
- }
- // escape @ => %40, ' => %27
- body = body.replace(/\'/g, '%27').replace(/\n/g, ' \\ \n ');
-
- if(!isFormData) {
- // escape & => %26
- body = body.replace(/&/g, '%26');
- }
- if(isMultipart) {
- results.push(body);
- }
- else {
- results.push('-d \'' + body.replace(/@/g, '%40') + '\'');
- }
- }
-
- return 'curl ' + (results.join(' ')) + ' \'' + obj.url + '\'';
-};
-
-Operation.prototype.encodePathCollection = function (type, name, value, maskPasswords) {
- var encoded = '';
- var i;
- var separator = '';
-
- if (type === 'ssv') {
- separator = '%20';
- } else if (type === 'tsv') {
- separator = '%09';
- } else if (type === 'pipes') {
- separator = '|';
- } else {
- separator = ',';
- }
-
- for (i = 0; i < value.length; i++) {
- if (i === 0) {
- encoded = this.encodeQueryParam(value[i], maskPasswords);
- } else {
- encoded += separator + this.encodeQueryParam(value[i], maskPasswords);
- }
- }
-
- return encoded;
-};
-
-Operation.prototype.encodeQueryCollection = function (type, name, value, maskPasswords) {
- var encoded = '';
- var i;
-
- type = type || 'default';
- if (type === 'default' || type === 'multi') {
- for (i = 0; i < value.length; i++) {
- if (i > 0) {encoded += '&';}
-
- encoded += this.encodeQueryKey(name) + '=' + mask(this.encodeQueryParam(value[i]), maskPasswords);
- }
- } else {
- var separator = '';
-
- if (type === 'csv') {
- separator = ',';
- } else if (type === 'ssv') {
- separator = '%20';
- } else if (type === 'tsv') {
- separator = '%09';
- } else if (type === 'pipes') {
- separator = '|';
- } else if (type === 'brackets') {
- for (i = 0; i < value.length; i++) {
- if (i !== 0) {
- encoded += '&';
- }
- encoded += this.encodeQueryKey(name) + '[]=' + mask(this.encodeQueryParam(value[i]), maskPasswords);
- }
- }
-
- if (separator !== '') {
- for (i = 0; i < value.length; i++) {
- if (i === 0) {
- encoded = this.encodeQueryKey(name) + '=' + this.encodeQueryParam(value[i]);
- } else {
- encoded += separator + this.encodeQueryParam(value[i]);
- }
- }
- }
- }
-
- return encoded;
-};
-
-Operation.prototype.encodeQueryKey = function (arg) {
- return encodeURIComponent(arg)
- .replace('%5B','[').replace('%5D', ']').replace('%24', '$');
-};
-
-Operation.prototype.encodeQueryParam = function (arg, maskPasswords) {
- if(maskPasswords) {
- return "******";
- }
- return encodeURIComponent(arg);
-};
-
-/**
- * TODO revisit, might not want to leave '/'
- **/
-Operation.prototype.encodePathParam = function (pathParam, maskPasswords) {
- return encodeURIComponent(pathParam, maskPasswords);
-};
-
-var mask = function(value, format) {
- if(typeof format === 'string' && format === 'password') {
- return '******';
- }
- return value;
-}
-},{"../helpers":4,"../http":5,"./model":9,"lodash-compat/lang/cloneDeep":138,"lodash-compat/lang/isEmpty":141,"lodash-compat/lang/isObject":144,"lodash-compat/lang/isUndefined":148,"q":157}],11:[function(require,module,exports){
-'use strict';
-
-var OperationGroup = module.exports = function (tag, description, externalDocs, operation) {
- this.description = description;
- this.externalDocs = externalDocs;
- this.name = tag;
- this.operation = operation;
- this.operationsArray = [];
- this.path = tag;
- this.tag = tag;
-};
-
-OperationGroup.prototype.sort = function () {
-
-};
-
-
-},{}],12:[function(require,module,exports){
-// shim for using process in browser
-
-var process = module.exports = {};
-var queue = [];
-var draining = false;
-
-function drainQueue() {
- if (draining) {
- return;
- }
- draining = true;
- var currentQueue;
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- var i = -1;
- while (++i < len) {
- currentQueue[i]();
- }
- len = queue.length;
- }
- draining = false;
-}
-process.nextTick = function (fun) {
- queue.push(fun);
- if (!draining) {
- setTimeout(drainQueue, 0);
- }
-};
-
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-process.version = ''; // empty string to avoid regexp issues
-process.versions = {};
-
-function noop() {}
-
-process.on = noop;
-process.addListener = noop;
-process.once = noop;
-process.off = noop;
-process.removeListener = noop;
-process.removeAllListeners = noop;
-process.emit = noop;
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
-
-// TODO(shtylman)
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
-
-},{}],13:[function(require,module,exports){
-(function (Buffer){
-(function () {
- "use strict";
-
- function btoa(str) {
- var buffer
- ;
-
- if (str instanceof Buffer) {
- buffer = str;
- } else {
- buffer = new Buffer(str.toString(), 'binary');
- }
-
- return buffer.toString('base64');
- }
-
- module.exports = btoa;
-}());
-
-}).call(this,require("buffer").Buffer)
-
-},{"buffer":14}],14:[function(require,module,exports){
-/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <fe...@feross.org> <http://feross.org>
- * @license MIT
- */
-
-var base64 = require('base64-js')
-var ieee754 = require('ieee754')
-var isArray = require('is-array')
-
-exports.Buffer = Buffer
-exports.SlowBuffer = SlowBuffer
-exports.INSPECT_MAX_BYTES = 50
-Buffer.poolSize = 8192 // not used by this implementation
-
-var rootParent = {}
-
-/**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Use Object implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * Due to various browser bugs, sometimes the Object implementation will be used even
- * when the browser supports typed arrays.
- *
- * Note:
- *
- * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
- * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
- *
- * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
- * on objects.
- *
- * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
- *
- * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
- * incorrect length in some situations.
-
- * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
- * get the Object implementation, which is slower but behaves correctly.
- */
-Buffer.TYPED_ARRAY_SUPPORT = (function () {
- function Bar () {}
- try {
- var arr = new Uint8Array(1)
- arr.foo = function () { return 42 }
- arr.constructor = Bar
- return arr.foo() === 42 && // typed array instances can be augmented
- arr.constructor === Bar && // constructor can be set
- typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
- arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
- } catch (e) {
- return false
- }
-})()
-
-function kMaxLength () {
- return Buffer.TYPED_ARRAY_SUPPORT
- ? 0x7fffffff
- : 0x3fffffff
-}
-
-/**
- * Class: Buffer
- * =============
- *
- * The Buffer constructor returns instances of `Uint8Array` that are augmented
- * with function properties for all the node `Buffer` API functions. We use
- * `Uint8Array` so that square bracket notation works as expected -- it returns
- * a single octet.
- *
- * By augmenting the instances, we can avoid modifying the `Uint8Array`
- * prototype.
- */
-function Buffer (arg) {
- if (!(this instanceof Buffer)) {
- // Avoid going through an ArgumentsAdaptorTrampoline in the common case.
- if (arguments.length > 1) return new Buffer(arg, arguments[1])
- return new Buffer(arg)
- }
-
- this.length = 0
- this.parent = undefined
-
- // Common case.
- if (typeof arg === 'number') {
- return fromNumber(this, arg)
- }
-
- // Slightly less common case.
- if (typeof arg === 'string') {
- return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')
- }
-
- // Unusual.
- return fromObject(this, arg)
-}
-
-function fromNumber (that, length) {
- that = allocate(that, length < 0 ? 0 : checked(length) | 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) {
- for (var i = 0; i < length; i++) {
- that[i] = 0
- }
- }
- return that
-}
-
-function fromString (that, string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'
-
- // Assumption: byteLength() return value is always < kMaxLength.
- var length = byteLength(string, encoding) | 0
- that = allocate(that, length)
-
- that.write(string, encoding)
- return that
-}
-
-function fromObject (that, object) {
- if (Buffer.isBuffer(object)) return fromBuffer(that, object)
-
- if (isArray(object)) return fromArray(that, object)
-
- if (object == null) {
- throw new TypeError('must start with number, buffer, array or string')
- }
-
- if (typeof ArrayBuffer !== 'undefined') {
- if (object.buffer instanceof ArrayBuffer) {
- return fromTypedArray(that, object)
- }
- if (object instanceof ArrayBuffer) {
- return fromArrayBuffer(that, object)
- }
- }
-
- if (object.length) return fromArrayLike(that, object)
-
- return fromJsonObject(that, object)
-}
-
-function fromBuffer (that, buffer) {
- var length = checked(buffer.length) | 0
- that = allocate(that, length)
- buffer.copy(that, 0, 0, length)
- return that
-}
-
-function fromArray (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-// Duplicate of fromArray() to keep fromArray() monomorphic.
-function fromTypedArray (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- // Truncating the elements is probably not what people expect from typed
- // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior
- // of the old Buffer constructor.
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-function fromArrayBuffer (that, array) {
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- array.byteLength
- that = Buffer._augment(new Uint8Array(array))
- } else {
- // Fallback: Return an object instance of the Buffer class
- that = fromTypedArray(that, new Uint8Array(array))
- }
- return that
-}
-
-function fromArrayLike (that, array) {
- var length = checked(array.length) | 0
- that = allocate(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.
-// Returns a zero-length buffer for inputs that don't conform to the spec.
-function fromJsonObject (that, object) {
- var array
- var length = 0
-
- if (object.type === 'Buffer' && isArray(object.data)) {
- array = object.data
- length = checked(array.length) | 0
- }
- that = allocate(that, length)
-
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-function allocate (that, length) {
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- that = Buffer._augment(new Uint8Array(length))
- } else {
- // Fallback: Return an object instance of the Buffer class
- that.length = length
- that._isBuffer = true
- }
-
- var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1
- if (fromPool) that.parent = rootParent
-
- return that
-}
-
-function checked (length) {
- // Note: cannot use `length < kMaxLength` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= kMaxLength()) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + kMaxLength().toString(16) + ' bytes')
- }
- return length | 0
-}
-
-function SlowBuffer (subject, encoding) {
- if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
-
- var buf = new Buffer(subject, encoding)
- delete buf.parent
- return buf
-}
-
-Buffer.isBuffer = function isBuffer (b) {
- return !!(b != null && b._isBuffer)
-}
-
-Buffer.compare = function compare (a, b) {
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError('Arguments must be Buffers')
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- var i = 0
- var len = Math.min(x, y)
- while (i < len) {
- if (a[i] !== b[i]) break
-
- ++i
- }
-
- if (i !== len) {
- x = a[i]
- y = b[i]
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-Buffer.isEncoding = function isEncoding (encoding) {
... 97564 lines suppressed ...
--
To stop receiving notification emails like this one, please contact
ahuber@apache.org.