Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
957b4b125e | ||
|
|
a59f632516 | ||
|
|
20786e53c3 | ||
|
|
120c4dd884 | ||
|
|
5bdce56bba | ||
|
|
e761e2da50 | ||
|
|
9d330d9509 | ||
|
|
c8f6d16891 | ||
|
|
857ef05b07 | ||
|
|
586b88d8f3 | ||
|
|
27cd5f7f2a | ||
|
|
90812f5c43 | ||
|
|
a6ae8b0521 | ||
|
|
91530b64c6 | ||
|
|
6820d6bc70 | ||
|
|
f50ad29a2b | ||
|
|
27e38101a4 | ||
|
|
4bac38e67b | ||
|
|
10abf46597 | ||
|
|
42841e3092 | ||
|
|
0654aefe58 | ||
|
|
41b1ca4483 | ||
|
|
b109d4c847 | ||
|
|
591c12f1a7 | ||
|
|
271918a678 | ||
|
|
c5c40e31c4 | ||
|
|
3ac6c9ec3a | ||
|
|
5fa35d5b81 | ||
|
|
f9b215deab | ||
|
|
0837873f55 | ||
|
|
02b8848912 | ||
|
|
6e39a58b2d | ||
|
|
e146a9712e | ||
|
|
ec7529399e | ||
|
|
824baf7e9d | ||
|
|
dd50eb5e12 | ||
|
|
9b56e1a4c8 | ||
|
|
608abaf0e1 | ||
|
|
64e13a94da | ||
|
|
5051f91c97 | ||
|
|
d1ae81a27e | ||
|
|
1ca401959c | ||
|
|
cd4bd4a18e | ||
|
|
8a69f08c29 | ||
|
|
e533b0827a | ||
|
|
dc78dfdad8 | ||
|
|
23ebba4207 | ||
|
|
afcba582b3 | ||
|
|
12f1d23048 | ||
|
|
a5eb3dfa91 | ||
|
|
5cd642c9a0 | ||
|
|
3f2d2871f0 | ||
|
|
247c1a306a | ||
|
|
4ca634a45b | ||
|
|
37c00ab3fb | ||
|
|
65aac1da2c | ||
|
|
4c069138e8 | ||
|
|
748b5d3c2f | ||
|
|
1dd7cfe043 | ||
|
|
33eb9d381c | ||
|
|
e80101d98c | ||
|
|
8de704d7ae | ||
|
|
165ac6c076 | ||
|
|
9eb0db466c | ||
|
|
df0f43084f | ||
|
|
16b6ed7fd6 | ||
|
|
904895ba3c | ||
|
|
79adfc19be | ||
|
|
2965e08e39 | ||
|
|
f2e05ee4c0 | ||
|
|
bbc70a7e3d | ||
|
|
ca43a7de0c | ||
|
|
cc43bdf5cb | ||
|
|
db86981dc1 | ||
|
|
b37ce3227a | ||
|
|
8fbab88bda | ||
|
|
58b979f4ea | ||
|
|
d9b6fbc1b8 | ||
|
|
20370d912e | ||
|
|
178390a9a0 | ||
|
|
7982f62f38 | ||
|
|
9fa4765121 | ||
|
|
544d72db0a | ||
|
|
696ec3a94a | ||
|
|
e0aec3ff45 | ||
|
|
ee7b9a0734 | ||
|
|
0697c415ed | ||
|
|
4825ec70b1 | ||
|
|
54ad90415d | ||
|
|
1184ea8b46 | ||
|
|
6ac58b8cf7 | ||
|
|
d627a1bc5d | ||
|
|
38e884b5ea | ||
|
|
2ef7cfbfe3 | ||
|
|
58adbb8f4c | ||
|
|
34c7fa2b0e | ||
|
|
6b2ce7d0f9 | ||
|
|
256a052564 | ||
|
|
cc90bc1544 | ||
|
|
ecee6f8177 | ||
|
|
408b31fc4f | ||
|
|
a4a11ad1ab | ||
|
|
aca0c4713e | ||
|
|
3077195396 | ||
|
|
94f6ca8c89 | ||
|
|
ae5eeeb600 | ||
|
|
23ebe2ff3e |
No files matched your search
+2
-3
@@ -1,7 +1,8 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
testproj/db.sqlite3
|
testproj/db.sqlite3
|
||||||
testproj/staticfiles
|
testproj/staticfiles
|
||||||
.vscode/
|
\.pytest_cache/
|
||||||
|
docs/\.doctrees/
|
||||||
|
|
||||||
# Created by .ignore support plugin (hsz.mobi)
|
# Created by .ignore support plugin (hsz.mobi)
|
||||||
### Python template
|
### Python template
|
||||||
@@ -159,5 +160,3 @@ com_crashlytics_export_strings.xml
|
|||||||
crashlytics.properties
|
crashlytics.properties
|
||||||
crashlytics-build.properties
|
crashlytics-build.properties
|
||||||
fabric.properties
|
fabric.properties
|
||||||
|
|
||||||
\.pytest_cache/
|
|
||||||
Generated
+8
-3
@@ -16,10 +16,15 @@
|
|||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/testproj" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/testproj" isTestSource="false" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.pytest_cache" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/docs/.doctrees" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/docs/_build" />
|
<excludeFolder url="file://$MODULE_DIR$/docs/_build" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/htmlcov" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/src/drf_yasg.egg-info" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3.6 (drf-yasg)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3 (drf-yasg)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TemplatesService">
|
<component name="TemplatesService">
|
||||||
@@ -31,7 +36,7 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="TestRunnerService">
|
<component name="TestRunnerService">
|
||||||
<option name="projectConfiguration" value="py.test" />
|
<option name="projectConfiguration" value="pytest" />
|
||||||
<option name="PROJECT_TEST_RUNNER" value="py.test" />
|
<option name="PROJECT_TEST_RUNNER" value="pytest" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
-5
@@ -55,11 +55,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
<inspection_tool class="PyShadowingNamesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
<inspection_tool class="PyShadowingNamesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="PyUnusedLocalInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false">
|
|
||||||
<option name="ignoreTupleUnpacking" value="true" />
|
|
||||||
<option name="ignoreLambdaParameters" value="true" />
|
|
||||||
<option name="ignoreLoopIterationVariables" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||||
<option name="processCode" value="true" />
|
<option name="processCode" value="true" />
|
||||||
<option name="processLiterals" value="true" />
|
<option name="processLiterals" value="true" />
|
||||||
|
|||||||
Generated
+1
-1
@@ -69,7 +69,7 @@
|
|||||||
<textMaps />
|
<textMaps />
|
||||||
</LinkMapSettings>
|
</LinkMapSettings>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6 (drf-yasg)" project-jdk-type="Python SDK" />
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3 (drf-yasg)" project-jdk-type="Python SDK" />
|
||||||
<component name="PythonCompatibilityInspectionAdvertiser">
|
<component name="PythonCompatibilityInspectionAdvertiser">
|
||||||
<option name="version" value="3" />
|
<option name="version" value="3" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
+18
-22
@@ -1,28 +1,28 @@
|
|||||||
language: python
|
language: python
|
||||||
cache: pip
|
sudo: false
|
||||||
|
|
||||||
python:
|
python:
|
||||||
|
- '2.7'
|
||||||
- '3.4'
|
- '3.4'
|
||||||
- '3.5'
|
- '3.5'
|
||||||
- '3.6'
|
- '3.6'
|
||||||
|
|
||||||
env:
|
cache: pip
|
||||||
- DRF=3.7
|
|
||||||
- DRF=3.8
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- stage: test
|
- # workaround for python 3.7 on travis https://github.com/travis-ci/travis-ci/issues/9815#issuecomment-401756442
|
||||||
python: '2.7'
|
stage: test
|
||||||
env: DRF=3.7
|
python: '3.7'
|
||||||
|
dist: xenial
|
||||||
|
sudo: required
|
||||||
-
|
-
|
||||||
python: '3.6'
|
python: '3.6'
|
||||||
env: DRF=master
|
env: TOXENV=djmaster
|
||||||
-
|
- # readthedocs uses python 3.5 for building
|
||||||
python: '3.5'
|
python: '3.5'
|
||||||
env: TOXENV=docs
|
env: TOXENV=docs
|
||||||
-
|
-
|
||||||
python: '2.7'
|
python: '3.6'
|
||||||
env: TOXENV=lint
|
env: TOXENV=lint
|
||||||
|
|
||||||
- stage: publish
|
- stage: publish
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
|
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- env: TOXENV=lint
|
- env: TOXENV=lint
|
||||||
- env: DRF=master
|
- env: TOXENV=djmaster
|
||||||
|
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
@@ -49,20 +49,16 @@ install:
|
|||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- coverage erase
|
- coverage erase
|
||||||
- |
|
|
||||||
[[ -z "$TOXENV" && -z "$PYPI_DEPLOY" ]] && REPORT_COVERAGE="yes" || REPORT_COVERAGE="no";
|
|
||||||
echo "Reporting coverage: ${REPORT_COVERAGE}"
|
|
||||||
- |
|
|
||||||
[[ -z "$TOXENV" && ! -z "$DRF" && "$DRF" != "master" ]] && USE_DETOX="yes" || USE_DETOX="no";
|
|
||||||
echo "Using detox: ${USE_DETOX}"
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- 'if [[ "$USE_DETOX" == "yes" ]]; then detox; else tox; fi'
|
- tox
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- coverage combine
|
- |
|
||||||
- 'if [[ "$REPORT_COVERAGE" == "yes" ]]; then coverage report; fi'
|
if [[ -z "$TOXENV" && -z "$PYPI_DEPLOY" ]]; then
|
||||||
- 'if [[ "$REPORT_COVERAGE" == "yes" ]]; then codecov; fi'
|
chmod +x coverage.sh
|
||||||
|
./coverage.sh
|
||||||
|
fi
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
|||||||
+2
-2
@@ -35,8 +35,8 @@ You want to contribute some code? Great! Here are a few steps to get you started
|
|||||||
|
|
||||||
$ virtualenv venv
|
$ virtualenv venv
|
||||||
$ source venv/bin/activate
|
$ source venv/bin/activate
|
||||||
(venv) $ pip install -e .[validation]
|
(venv) $ pip install -U -e .[validation]
|
||||||
(venv) $ pip install -rrequirements/dev.txt "Django>=1.11.7"
|
(venv) $ pip install -U -r requirements/dev.txt
|
||||||
|
|
||||||
#. **Make your changes and check them against the test project**
|
#. **Make your changes and check them against the test project**
|
||||||
|
|
||||||
|
|||||||
+16
-19
@@ -11,9 +11,9 @@ Generate **real** Swagger/OpenAPI 2.0 specifications from a Django Rest Framewor
|
|||||||
|
|
||||||
Compatible with
|
Compatible with
|
||||||
|
|
||||||
- **Django Rest Framework**: 3.7.7, 3.8.x
|
- **Django Rest Framework**: 3.7.7, 3.8
|
||||||
- **Django**: 1.11.x, 2.0.x
|
- **Django**: 1.11, 2.0, 2.1
|
||||||
- **Python**: 2.7, 3.4, 3.5, 3.6
|
- **Python**: 2.7, 3.4, 3.5, 3.6, 3.7
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
|
|
||||||
@@ -85,14 +85,14 @@ The preferred instalation method is directly from pypi:
|
|||||||
|
|
||||||
.. code:: console
|
.. code:: console
|
||||||
|
|
||||||
pip install drf-yasg
|
pip install -U drf-yasg
|
||||||
|
|
||||||
Additionally, if you want to use the built-in validation mechanisms (see `4. Validation`_), you need to install
|
Additionally, if you want to use the built-in validation mechanisms (see `4. Validation`_), you need to install
|
||||||
some extra requirements:
|
some extra requirements:
|
||||||
|
|
||||||
.. code:: console
|
.. code:: console
|
||||||
|
|
||||||
pip install drf-yasg[validation]
|
pip install -U drf-yasg[validation]
|
||||||
|
|
||||||
.. _readme-quickstart:
|
.. _readme-quickstart:
|
||||||
|
|
||||||
@@ -134,9 +134,9 @@ In ``urls.py``:
|
|||||||
)
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=None), name='schema-json'),
|
url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
|
||||||
url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=None), name='schema-swagger-ui'),
|
url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
||||||
url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=None), name='schema-redoc'),
|
url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
||||||
...
|
...
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ For additional usage examples, you can take a look at the test project in the ``
|
|||||||
$ virtualenv venv
|
$ virtualenv venv
|
||||||
$ source venv/bin/activate
|
$ source venv/bin/activate
|
||||||
(venv) $ cd testproj
|
(venv) $ cd testproj
|
||||||
(venv) $ pip install -r requirements.txt
|
(venv) $ pip install -U -r requirements.txt
|
||||||
(venv) $ python manage.py migrate
|
(venv) $ python manage.py migrate
|
||||||
(venv) $ python manage.py shell -c "import createsuperuser"
|
(venv) $ python manage.py shell -c "import createsuperuser"
|
||||||
(venv) $ python manage.py runserver
|
(venv) $ python manage.py runserver
|
||||||
@@ -315,8 +315,8 @@ From here on, the terms “OpenAPI” and “Swagger” are used interchangeably
|
|||||||
Swagger in Django Rest Framework
|
Swagger in Django Rest Framework
|
||||||
================================
|
================================
|
||||||
|
|
||||||
Since Django Rest 3.7, there is now `built in support <http://www.django-rest-framework.org/api-guide/schemas/>`__ for
|
Since Django Rest Framework 3.7, there is now `built in support <http://www.django-rest-framework.org/api-guide/schemas/>`__
|
||||||
automatic OpenAPI 2.0 schema generation. However, this generation is based on the `coreapi <http://www.coreapi.org/>`__
|
for automatic OpenAPI 2.0 schema generation. However, this generation is based on the `coreapi <http://www.coreapi.org/>`__
|
||||||
standard, which for the moment is vastly inferior to OpenAPI in both features and tooling support. In particular,
|
standard, which for the moment is vastly inferior to OpenAPI in both features and tooling support. In particular,
|
||||||
the OpenAPI codec/compatibility layer provided has a few major problems:
|
the OpenAPI codec/compatibility layer provided has a few major problems:
|
||||||
|
|
||||||
@@ -329,18 +329,15 @@ In short this makes the generated schema unusable for code generation, and medio
|
|||||||
Other libraries
|
Other libraries
|
||||||
===============
|
===============
|
||||||
|
|
||||||
There are currently two decent Swagger schema generators that I could
|
There are currently two decent Swagger schema generators that I could find for django-rest-framework:
|
||||||
find for django-rest-framework:
|
|
||||||
|
|
||||||
* `django-rest-swagger <https://github.com/marcgibbons/django-rest-swagger>`__
|
* `django-rest-swagger <https://github.com/marcgibbons/django-rest-swagger>`__
|
||||||
* `drf-openapi <https://github.com/limdauto/drf_openapi>`__
|
* `drf-openapi <https://github.com/limdauto/drf_openapi>`__
|
||||||
|
|
||||||
Out of the two, ``django-rest-swagger`` is just a wrapper around DRF 3.7 schema generation with an added UI, and
|
``django-rest-swagger`` is just a wrapper around DRF 3.7 schema generation with an added UI, and
|
||||||
thus presents the same problems. ``drf-openapi`` is a bit more involved and implements some custom handling for response
|
thus presents the same problems, while also being unmaintained. ``drf-openapi`` was
|
||||||
schemas, but ultimately still falls short in code generation because the responses are plain of lacking support for
|
`discontinued by the author <https://github.com/limdauto/drf_openapi/commit/1673c6e039eec7f089336a83bdc31613f32f7e21>`_
|
||||||
named schemas.
|
on April 3rd, 2018.
|
||||||
|
|
||||||
Both projects are also currently unmantained.
|
|
||||||
|
|
||||||
************************
|
************************
|
||||||
Third-party integrations
|
Third-party integrations
|
||||||
|
|||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
coverage combine
|
||||||
|
coverage report
|
||||||
|
codecov
|
||||||
+126
-1
@@ -3,6 +3,132 @@ Changelog
|
|||||||
#########
|
#########
|
||||||
|
|
||||||
|
|
||||||
|
**********
|
||||||
|
**1.10.2**
|
||||||
|
**********
|
||||||
|
|
||||||
|
*Release date: Sep 13, 2018*
|
||||||
|
|
||||||
|
- **ADDED:** added the ``DISPLAY_OPERATION_ID `` ``swagger-ui`` setting
|
||||||
|
- **IMPROVED:** updated ``ReDoc`` to version 2.0.0-alpha.38
|
||||||
|
- **IMPROVED:** Operation summary will now be parsed from multi-line view method docstrings (:issue:`205`)
|
||||||
|
- **IMPROVED:** ``pattern`` will now work on any field with a ``RegexValidator``
|
||||||
|
(would previously not appear on fields with special formats such as ``EmailField``)
|
||||||
|
- **FIXED:** fixed an issue with ``RelatedFieldInspector`` handling of nested serializers
|
||||||
|
- **FIXED:** fixed handling of ``reverse_lazy`` in URL settings (:issue:`209`)
|
||||||
|
|
||||||
|
**********
|
||||||
|
**1.10.1**
|
||||||
|
**********
|
||||||
|
|
||||||
|
*Release date: Sep 10, 2018*
|
||||||
|
|
||||||
|
- **ADDED:** added the ``SPEC_URL`` setting for controlling the download link in ``swagger-ui`` and ``ReDoc``
|
||||||
|
- **ADDED:** updated ``ReDoc`` settings (added ``NATIVE_SCROLLBARS`` and ``REQUIRED_PROPS_FIRST``)
|
||||||
|
- **ADDED:** added ``extra_styles`` and ``extra_scripts`` blocks to ui templates (:issue:`178`)
|
||||||
|
- **IMPROVED:** updated ``swagger-ui`` to version 3.18.2
|
||||||
|
- **IMPROVED:** updated ``ReDoc`` to version 2.0.0-alpha.37
|
||||||
|
- **FIXED:** stopped generating invalid OpenAPI by improper placement of ``readOnly`` Schemas
|
||||||
|
- **FIXED:** fixed broken CSS when ``USE_SESSION_AUTH=False``
|
||||||
|
- **FIXED:** fixed implementation of ``operation_summary`` and ``deprecated`` (:pr:`194`, :pr:`198`)
|
||||||
|
- **FIXED:** fixed a bug related to nested ``typing`` hints (:pr:`195`)
|
||||||
|
- **FIXED:** removed dependency on ``future`` (:issue:`196`)
|
||||||
|
- **FIXED:** fixed exceptions logged for fields with ``default=None`` (:issue:`203`)
|
||||||
|
- **FIXED:** fixed ``request_body=no_body`` handling and related tests (:issue:`188`, :issue:`199`)
|
||||||
|
|
||||||
|
|
||||||
|
**********
|
||||||
|
**1.10.0**
|
||||||
|
**********
|
||||||
|
|
||||||
|
*Release date: Aug 08, 2018*
|
||||||
|
|
||||||
|
- **ADDED:** added ``EXCLUDED_MEDIA_TYPES`` setting for controlling ``produces`` MIME type filtering (:issue:`158`)
|
||||||
|
- **ADDED:** added support for ``SerializerMethodField``, via the ``swagger_serializer_method`` decorator for the
|
||||||
|
method field, and support for Python 3.5 style type hinting of the method field return type
|
||||||
|
(:issue:`137`, :pr:`175`, :pr:`179`)
|
||||||
|
|
||||||
|
*NOTE:* in order for this to work, you will have to add the new ``drf_yasg.inspectors.SerializerMethodFieldInspector``
|
||||||
|
to your ``DEFAULT_FIELD_INSPECTORS`` array if you changed it from the default value
|
||||||
|
|
||||||
|
- **IMPROVED:** updated ``swagger-ui`` to version 3.18.0
|
||||||
|
- **IMPROVED:** added support for Python 3.7 and Django 2.1 (:pr:`176`)
|
||||||
|
- **IMPROVED:** ``swagger_schema_fields`` will now also work on serializer ``Field``\ s (:issue:`167`)
|
||||||
|
- **IMPROVED:** ``ref_name`` collisions will now log a warning message (:issue:`156`)
|
||||||
|
- **IMPROVED:** added ``operation_summary`` and ``deprecated`` arguments to ``swagger_auto_schema``
|
||||||
|
(:issue:`149`, :issue:`173`)
|
||||||
|
- **FIXED:** made ``swagger_auto_schema`` work with DRF 3.9 ``@action`` mappings (:issue:`177`)
|
||||||
|
|
||||||
|
*********
|
||||||
|
**1.9.2**
|
||||||
|
*********
|
||||||
|
|
||||||
|
*Release date: Aug 03, 2018*
|
||||||
|
|
||||||
|
- **IMPROVED:** updated ``swagger-ui`` to version 3.17.6
|
||||||
|
- **IMPROVED:** updated ``ReDoc`` to version 2.0.0-alpha.32
|
||||||
|
- **IMPROVED:** added ``--api-version`` argument to the ``generate_swagger`` management command (:pr:`170`)
|
||||||
|
- **FIXED:** corrected various documentation typos (:pr:`160`, :pr:`162`, :issue:`171`, :pr:`172`)
|
||||||
|
- **FIXED:** made ``generate_swagger`` work for projects without authentication (:pr:`161`)
|
||||||
|
- **FIXED:** fixed ``SafeText`` interaction with YAML codec (:issue:`159`)
|
||||||
|
|
||||||
|
*********
|
||||||
|
**1.9.1**
|
||||||
|
*********
|
||||||
|
|
||||||
|
*Release date: Jun 30, 2018*
|
||||||
|
|
||||||
|
- **IMPROVED:** added a ``swagger_fake_view`` marker to more easily detect mock views in view methods;
|
||||||
|
``getattr(self, 'swagger_fake_view', False)`` inside a view method like ``get_serializer_class`` will tell you if the
|
||||||
|
view instance is being used for swagger schema introspection (:issue:`154`)
|
||||||
|
- **IMPROVED:** updated ``swagger-ui`` to version 3.17.1
|
||||||
|
- **IMPROVED:** updated ``ReDoc`` to version 2.0.0-alpha.25
|
||||||
|
- **FIXED:** fixed wrong handling of duplicate urls in urlconf (:pr:`155`)
|
||||||
|
- **FIXED:** fixed crash when passing ``None`` as a response override (:issue:`148`)
|
||||||
|
|
||||||
|
*********
|
||||||
|
**1.9.0**
|
||||||
|
*********
|
||||||
|
|
||||||
|
*Release date: Jun 16, 2018*
|
||||||
|
|
||||||
|
- **ADDED:** added ``DEFAULT_GENERATOR_CLASS`` setting and ``--generator-class`` argument to the ``generate_swagger``
|
||||||
|
management command (:issue:`140`)
|
||||||
|
- **FIXED:** fixed wrongly required ``'count'`` response field on ``CursorPagination`` (:issue:`141`)
|
||||||
|
- **FIXED:** fixed some cases where ``swagger_schema_fields`` would not be handlded (:pr:`142`)
|
||||||
|
- **FIXED:** fixed crash when encountering ``coreapi.Fields``\ s without a ``schema`` (:issue:`143`)
|
||||||
|
|
||||||
|
*********
|
||||||
|
**1.8.0**
|
||||||
|
*********
|
||||||
|
|
||||||
|
*Release date: Jun 01, 2018*
|
||||||
|
|
||||||
|
- **ADDED:** added a :ref:`swagger_schema_fields <swagger_schema_fields>` field on serializer ``Meta`` classes for
|
||||||
|
customizing schema generation (:issue:`132`, :pr:`134`)
|
||||||
|
- **FIXED:** error responses from schema views are now rendered with ``JSONRenderer`` instead of throwing
|
||||||
|
confusing errors (:pr:`130`, :issue:`58`)
|
||||||
|
- **FIXED:** ``readOnly`` schema fields will now no longer be marked as ``required`` (:pr:`133`)
|
||||||
|
|
||||||
|
*********
|
||||||
|
**1.7.4**
|
||||||
|
*********
|
||||||
|
|
||||||
|
*Release date: May 14, 2018*
|
||||||
|
|
||||||
|
- **IMPROVED:** updated ``swagger-ui`` to version 3.14.2
|
||||||
|
- **IMPROVED:** updated ``ReDoc`` to version 2.0.0-alpha.20
|
||||||
|
- **FIXED:** ignore ``None`` return from ``get_operation`` to avoid empty ``Path`` objects in output
|
||||||
|
- **FIXED:** request body is now allowed on ``DELETE`` endpoints (:issue:`118`)
|
||||||
|
|
||||||
|
*********
|
||||||
|
**1.7.3**
|
||||||
|
*********
|
||||||
|
|
||||||
|
*Release date: May 12, 2018*
|
||||||
|
|
||||||
|
- **FIXED:** views whose ``__init__`` methods throw exceptions will now be ignored during endpoint enumeration
|
||||||
|
|
||||||
*********
|
*********
|
||||||
**1.7.2**
|
**1.7.2**
|
||||||
*********
|
*********
|
||||||
@@ -12,7 +138,6 @@ Changelog
|
|||||||
- **FIXED:** fixed generation of default ``SECURITY_REQUIREMENTS`` to match documented behaviour
|
- **FIXED:** fixed generation of default ``SECURITY_REQUIREMENTS`` to match documented behaviour
|
||||||
- **FIXED:** ordering of ``SECURITY_REQUIREMENTS`` and ``SECURITY_DEFINITIONS`` is now stable
|
- **FIXED:** ordering of ``SECURITY_REQUIREMENTS`` and ``SECURITY_DEFINITIONS`` is now stable
|
||||||
|
|
||||||
|
|
||||||
*********
|
*********
|
||||||
**1.7.1**
|
**1.7.1**
|
||||||
*********
|
*********
|
||||||
|
|||||||
+3
-1
@@ -155,7 +155,9 @@ texinfo_documents = [
|
|||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
||||||
autodoc_default_flags = ['private-members']
|
autodoc_default_options = {
|
||||||
|
'private-members': None
|
||||||
|
}
|
||||||
autodoc_member_order = 'bysource'
|
autodoc_member_order = 'bysource'
|
||||||
autoclass_content = 'both'
|
autoclass_content = 'both'
|
||||||
autodoc_mock_imports = []
|
autodoc_mock_imports = []
|
||||||
|
|||||||
+62
-2
@@ -87,7 +87,7 @@ Where you can use the :func:`@swagger_auto_schema <.swagger_auto_schema>` decora
|
|||||||
|
|
||||||
* for ``ViewSet``, ``GenericViewSet``, ``ModelViewSet``, because each viewset corresponds to multiple **paths**, you have
|
* for ``ViewSet``, ``GenericViewSet``, ``ModelViewSet``, because each viewset corresponds to multiple **paths**, you have
|
||||||
to decorate the *action methods*, i.e. ``list``, ``create``, ``retrieve``, etc. |br|
|
to decorate the *action methods*, i.e. ``list``, ``create``, ``retrieve``, etc. |br|
|
||||||
Additionally, ``@action``\ s, `@list_route``\ s or ``@detail_route``\ s defined on the viewset, like function based
|
Additionally, ``@action``\ s, ``@list_route``\ s or ``@detail_route``\ s defined on the viewset, like function based
|
||||||
api views, can respond to multiple HTTP methods and thus have multiple operations that must be decorated separately:
|
api views, can respond to multiple HTTP methods and thus have multiple operations that must be decorated separately:
|
||||||
|
|
||||||
|
|
||||||
@@ -155,6 +155,57 @@ Where you can use the :func:`@swagger_auto_schema <.swagger_auto_schema>` decora
|
|||||||
replacing/decorating methods on the base class itself.
|
replacing/decorating methods on the base class itself.
|
||||||
|
|
||||||
|
|
||||||
|
*********************************
|
||||||
|
Support for SerializerMethodField
|
||||||
|
*********************************
|
||||||
|
|
||||||
|
Schema generation of ``serializers.SerializerMethodField`` is supported in two ways:
|
||||||
|
|
||||||
|
1) The :func:`swagger_serializer_method <.swagger_serializer_method>` decorator for the use case where the serializer
|
||||||
|
method is using a serializer. e.g.:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from drf_yasg.utils import swagger_serializer_method
|
||||||
|
|
||||||
|
class OtherStuffSerializer(serializers.Serializer):
|
||||||
|
foo = serializers.CharField()
|
||||||
|
|
||||||
|
class ParentSerializer(serializers.Serializer):
|
||||||
|
other_stuff = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=OtherStuffSerializer)
|
||||||
|
def get_other_stuff(self, obj):
|
||||||
|
return OtherStuffSerializer().data
|
||||||
|
|
||||||
|
|
||||||
|
Note that the ``serializer_or_field`` parameter can accept either a subclass or an instance of ``serializers.Field``.
|
||||||
|
|
||||||
|
|
||||||
|
2) For simple cases where the method is returning one of the supported types, `Python 3 type hinting`_ of the
|
||||||
|
serializer method return value can be used. e.g.:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
class SomeSerializer(serializers.Serializer):
|
||||||
|
some_number = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
def get_some_number(self, obj) -> float:
|
||||||
|
return 1.0
|
||||||
|
|
||||||
|
When return type hinting is not supported, the equivalent ``serializers.Field`` subclass can be used with
|
||||||
|
:func:`swagger_serializer_method <.swagger_serializer_method>`:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
class SomeSerializer(serializers.Serializer):
|
||||||
|
some_number = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.FloatField)
|
||||||
|
def get_some_number(self, obj):
|
||||||
|
return 1.0
|
||||||
|
|
||||||
|
|
||||||
********************************
|
********************************
|
||||||
Serializer ``Meta`` nested class
|
Serializer ``Meta`` nested class
|
||||||
********************************
|
********************************
|
||||||
@@ -169,13 +220,19 @@ You can define some per-serializer options by adding a ``Meta`` class to your se
|
|||||||
class Meta:
|
class Meta:
|
||||||
... options here ...
|
... options here ...
|
||||||
|
|
||||||
Currently, the only option you can add here is
|
.. _swagger_schema_fields:
|
||||||
|
|
||||||
|
The available options are:
|
||||||
|
|
||||||
* ``ref_name`` - a string which will be used as the model definition name for this serializer class; setting it to
|
* ``ref_name`` - a string which will be used as the model definition name for this serializer class; setting it to
|
||||||
``None`` will force the serializer to be generated as an inline model everywhere it is used. If two serializers
|
``None`` will force the serializer to be generated as an inline model everywhere it is used. If two serializers
|
||||||
have the same ``ref_name``, both their usages will be replaced with a reference to the same definition.
|
have the same ``ref_name``, both their usages will be replaced with a reference to the same definition.
|
||||||
If this option is not specified, all serializers have an implicit name derived from their class name, minus any
|
If this option is not specified, all serializers have an implicit name derived from their class name, minus any
|
||||||
``Serializer`` suffix (e.g. ``UserSerializer`` -> ``User``, ``SerializerWithSuffix`` -> ``SerializerWithSuffix``)
|
``Serializer`` suffix (e.g. ``UserSerializer`` -> ``User``, ``SerializerWithSuffix`` -> ``SerializerWithSuffix``)
|
||||||
|
* ``swagger_schema_fields`` - a dictionary mapping :class:`.Schema` field names to values. These attributes
|
||||||
|
will be set on the :class:`.Schema` object generated from the ``Serializer``. Field names must be python values,
|
||||||
|
which are converted to Swagger ``Schema`` attribute names according to :func:`.make_swagger_name`.
|
||||||
|
Attribute names and values must conform to the `OpenAPI 2.0 specification <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject>`_.
|
||||||
|
|
||||||
|
|
||||||
*************************
|
*************************
|
||||||
@@ -327,3 +384,6 @@ A second example, of a :class:`~.inspectors.FieldInspector` that removes the ``t
|
|||||||
|
|
||||||
Another caveat that stems from this is that any serializer named "``NestedSerializer``" will be forced inline
|
Another caveat that stems from this is that any serializer named "``NestedSerializer``" will be forced inline
|
||||||
unless it has a ``ref_name`` set explicitly.
|
unless it has a ``ref_name`` set explicitly.
|
||||||
|
|
||||||
|
|
||||||
|
.. _Python 3 type hinting: https://docs.python.org/3/library/typing.html
|
||||||
+14
-3
@@ -2,6 +2,17 @@
|
|||||||
Customizing the web UI
|
Customizing the web UI
|
||||||
######################
|
######################
|
||||||
|
|
||||||
There is currently no pluggable way of customizing the web UI apart from the settings available in
|
The web UI can be customized using the settings available in :ref:`swagger-ui-settings` and :ref:`redoc-ui-settings`.
|
||||||
:ref:`swagger-ui-settings` and :ref:`redoc-ui-settings`. If you really need to, you can override one of the
|
|
||||||
``drf-yasg/swagger-ui.html`` or ``drf-yasg/redoc.html`` templates that are used for rendering.
|
You can also extend one of the ``drf-yasg/swagger-ui.html`` or ``drf-yasg/redoc.html`` templates that are used for
|
||||||
|
rendering. The customizable blocks are currently limited to:
|
||||||
|
|
||||||
|
{% block extra_styles %}
|
||||||
|
additional stylesheets
|
||||||
|
|
||||||
|
{% block extra_scripts %}
|
||||||
|
additional scripts
|
||||||
|
|
||||||
|
{% block user_context_message %}
|
||||||
|
*(swagger-ui session auth only)*
|
||||||
|
logged in user message
|
||||||
+10
-1
@@ -14,7 +14,7 @@ This library generates OpenAPI 2.0 documents. The authoritative specification fo
|
|||||||
be the official documentation over at `swagger.io <https://swagger.io/>`__ and the `OpenAPI 2.0 specification
|
be the official documentation over at `swagger.io <https://swagger.io/>`__ and the `OpenAPI 2.0 specification
|
||||||
page <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md>`__.
|
page <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md>`__.
|
||||||
|
|
||||||
Beause the above specifications are a bit heavy and convoluted, here is a general overview of how the specification
|
Because the above specifications are a bit heavy and convoluted, here is a general overview of how the specification
|
||||||
is structured, starting from the root ``Swagger`` object.
|
is structured, starting from the root ``Swagger`` object.
|
||||||
|
|
||||||
* :class:`.Swagger` object
|
* :class:`.Swagger` object
|
||||||
@@ -174,6 +174,15 @@ in a few ways:
|
|||||||
:ref:`@swagger_auto_schema <custom-spec-swagger-auto-schema>`, to prevent ``get_serializer`` from being called on
|
:ref:`@swagger_auto_schema <custom-spec-swagger-auto-schema>`, to prevent ``get_serializer`` from being called on
|
||||||
the view
|
the view
|
||||||
* :ref:`exclude your endpoint from introspection <custom-spec-excluding-endpoints>`
|
* :ref:`exclude your endpoint from introspection <custom-spec-excluding-endpoints>`
|
||||||
|
* use the ``swagger_fake_view`` marker to detect requests generated by ``drf-yasg``:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
def get_serializer_class(self):
|
||||||
|
if getattr(self, 'swagger_fake_view', False):
|
||||||
|
return TodoTreeSerializer
|
||||||
|
|
||||||
|
raise NotImplementedError("must not call this")
|
||||||
|
|
||||||
.. _SCRIPT_NAME: https://www.python.org/dev/peps/pep-0333/#environ-variables
|
.. _SCRIPT_NAME: https://www.python.org/dev/peps/pep-0333/#environ-variables
|
||||||
.. _FORCE_SCRIPT_NAME: https://docs.djangoproject.com/en/2.0/ref/settings/#force-script-name
|
.. _FORCE_SCRIPT_NAME: https://docs.djangoproject.com/en/2.0/ref/settings/#force-script-name
|
||||||
+102
-18
@@ -27,22 +27,41 @@ Example:
|
|||||||
}
|
}
|
||||||
|
|
||||||
REDOC_SETTINGS = {
|
REDOC_SETTINGS = {
|
||||||
'LAZY_RENDERING': True,
|
'LAZY_RENDERING': False,
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.. _url-settings:
|
||||||
|
|
||||||
|
All settings which configure URLs (``LOGIN_URL``, ``SPEC_URL``, ``VALIDATOR_URL``, etc.) can accept several forms of
|
||||||
|
input:
|
||||||
|
|
||||||
|
* A view name: `urls.reverse()` will be used to reverse-resolve the name
|
||||||
|
* A 2-tuple of ``(view_name, kwargs)```: `urls.reverse()` will be used to reverse-resolve the name using the given
|
||||||
|
`kwargs`; `kwargs` must be a dict
|
||||||
|
* A 3-tuple of ``(view_name, args, kwargs)```: `urls.reverse()` will be used to reverse-resolve the name using the given
|
||||||
|
`args` and `kwargs`; `args`, `kwargs` must be a tuple/list and a dict respectively
|
||||||
|
* A URL, which will be used as-is
|
||||||
|
|
||||||
The possible settings and their default values are as follows:
|
The possible settings and their default values are as follows:
|
||||||
|
|
||||||
********************
|
****************
|
||||||
``SWAGGER_SETTINGS``
|
SWAGGER_SETTINGS
|
||||||
********************
|
****************
|
||||||
|
|
||||||
|
|
||||||
.. _default-class-settings:
|
.. _default-class-settings:
|
||||||
|
|
||||||
Default classes
|
Default classes
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
DEFAULT_GENERATOR_CLASS
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
:class:`~.generators.OpenAPISchemaGenerator` subclass that will be used by default for generating the final
|
||||||
|
:class:`.Schema` object. Can be overriden by the ``generator_class`` argument to :func:`.get_schema_view`.
|
||||||
|
|
||||||
|
**Default**: :class:`drf_yasg.generators.OpenAPISchemaGenerator`
|
||||||
|
|
||||||
DEFAULT_AUTO_SCHEMA_CLASS
|
DEFAULT_AUTO_SCHEMA_CLASS
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
@@ -68,6 +87,7 @@ to this list.
|
|||||||
:class:`'drf_yasg.inspectors.DictFieldInspector' <.inspectors.DictFieldInspector>`, |br| \
|
:class:`'drf_yasg.inspectors.DictFieldInspector' <.inspectors.DictFieldInspector>`, |br| \
|
||||||
:class:`'drf_yasg.inspectors.HiddenFieldInspector' <.inspectors.HiddenFieldInspector>`, |br| \
|
:class:`'drf_yasg.inspectors.HiddenFieldInspector' <.inspectors.HiddenFieldInspector>`, |br| \
|
||||||
:class:`'drf_yasg.inspectors.RecursiveFieldInspector' <.inspectors.RecursiveFieldInspector>`, |br| \
|
:class:`'drf_yasg.inspectors.RecursiveFieldInspector' <.inspectors.RecursiveFieldInspector>`, |br| \
|
||||||
|
:class:`'drf_yasg.inspectors.SerializerMethodFieldInspector' <.inspectors.SerializerMethodFieldInspector>`, |br| \
|
||||||
:class:`'drf_yasg.inspectors.SimpleFieldInspector' <.inspectors.SimpleFieldInspector>`, |br| \
|
:class:`'drf_yasg.inspectors.SimpleFieldInspector' <.inspectors.SimpleFieldInspector>`, |br| \
|
||||||
:class:`'drf_yasg.inspectors.StringDefaultFieldInspector' <.inspectors.StringDefaultFieldInspector>`, |br| \
|
:class:`'drf_yasg.inspectors.StringDefaultFieldInspector' <.inspectors.StringDefaultFieldInspector>`, |br| \
|
||||||
``]``
|
``]``
|
||||||
@@ -96,13 +116,21 @@ Paginator inspectors given to :func:`@swagger_auto_schema <.swagger_auto_schema>
|
|||||||
Swagger document attributes
|
Swagger document attributes
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
EXCLUDED_MEDIA_TYPES
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
A list of keywords for excluding MIME types from ``Operation.produces``. Any MIME type string which includes one of
|
||||||
|
the substrings in this list will be prevented from appearing in a ``produces`` array in the Swagger document.
|
||||||
|
|
||||||
|
**Default**: :python:`['html']`
|
||||||
|
|
||||||
.. _default-swagger-settings:
|
.. _default-swagger-settings:
|
||||||
|
|
||||||
DEFAULT_INFO
|
DEFAULT_INFO
|
||||||
------------
|
------------
|
||||||
|
|
||||||
An import string to an :class:`.openapi.Info` object. This will be used when running the ``generate_swagger``
|
An import string to an :class:`.openapi.Info` object. This will be used when running the ``generate_swagger``
|
||||||
management command, or if no ``info`` argument is passed to ``get_schema_view``.
|
management command, or if no ``info`` argument is passed to :func:`.get_schema_view`.
|
||||||
|
|
||||||
**Default**: :python:`None`
|
**Default**: :python:`None`
|
||||||
|
|
||||||
@@ -175,6 +203,15 @@ Swagger UI settings
|
|||||||
Swagger UI configuration settings. |br|
|
Swagger UI configuration settings. |br|
|
||||||
See https://github.com/swagger-api/swagger-ui/blob/112bca906553a937ac67adc2e500bdeed96d067b/docs/usage/configuration.md#parameters.
|
See https://github.com/swagger-api/swagger-ui/blob/112bca906553a937ac67adc2e500bdeed96d067b/docs/usage/configuration.md#parameters.
|
||||||
|
|
||||||
|
SPEC_URL
|
||||||
|
--------
|
||||||
|
|
||||||
|
URL pointing to a swagger document for use by swagger-ui. The default behaviour is to append ``?format=openapi`` to the
|
||||||
|
URL which serves the UI; see :ref:`note on URL settings <url-settings>` above.
|
||||||
|
|
||||||
|
**Default**: :python:`None` |br|
|
||||||
|
*Maps to parameter*: ``url``
|
||||||
|
|
||||||
VALIDATOR_URL
|
VALIDATOR_URL
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
@@ -255,10 +292,10 @@ Controls how many levels are expaned by default when showing nested models.
|
|||||||
**Default**: :python:`3` |br|
|
**Default**: :python:`3` |br|
|
||||||
*Maps to parameter*: ``defaultModelExpandDepth``
|
*Maps to parameter*: ``defaultModelExpandDepth``
|
||||||
|
|
||||||
DEFAULT_MODEL_DEPTH
|
SHOW_COMMON_EXTENSIONS
|
||||||
-------------------
|
----------------------
|
||||||
|
|
||||||
Controls the display of extensions (``pattern``, ``maxLength``, ``minLength``, ``maximum``, ```minimum``) fields and
|
Controls the display of extensions (``pattern``, ``maxLength``, ``minLength``, ``maximum``, ``minimum``) fields and
|
||||||
values for Parameters.
|
values for Parameters.
|
||||||
|
|
||||||
**Default**: :python:`True` |br|
|
**Default**: :python:`True` |br|
|
||||||
@@ -295,9 +332,17 @@ This does not filter the operations from the display.
|
|||||||
**Default**: :python:`['get','put','post','delete','options','head','patch','trace']` |br|
|
**Default**: :python:`['get','put','post','delete','options','head','patch','trace']` |br|
|
||||||
*Maps to parameter*: ``supportedSubmitMethods``
|
*Maps to parameter*: ``supportedSubmitMethods``
|
||||||
|
|
||||||
******************
|
DISPLAY_OPERATION_ID
|
||||||
``REDOC_SETTINGS``
|
--------------------
|
||||||
******************
|
|
||||||
|
Controls the display of operationId in operations list.
|
||||||
|
|
||||||
|
**Default**: :python:`True`
|
||||||
|
*Maps to parameter*: ``displayOperationId``
|
||||||
|
|
||||||
|
**************
|
||||||
|
REDOC_SETTINGS
|
||||||
|
**************
|
||||||
|
|
||||||
.. _redoc-ui-settings:
|
.. _redoc-ui-settings:
|
||||||
|
|
||||||
@@ -305,31 +350,70 @@ ReDoc UI settings
|
|||||||
=================
|
=================
|
||||||
|
|
||||||
ReDoc UI configuration settings. |br|
|
ReDoc UI configuration settings. |br|
|
||||||
See https://github.com/Rebilly/ReDoc#redoc-tag-attributes.
|
See https://github.com/Rebilly/ReDoc#configuration.
|
||||||
|
|
||||||
|
SPEC_URL
|
||||||
|
--------
|
||||||
|
|
||||||
|
URL pointing to a swagger document for use by ReDoc. The default behaviour is to append ``?format=openapi`` to the
|
||||||
|
URL which serves the UI; see :ref:`note on URL settings <url-settings>` above.
|
||||||
|
|
||||||
|
**Default**: :python:`None` |br|
|
||||||
|
*Maps to attribute*: ``spec-url``
|
||||||
|
|
||||||
LAZY_RENDERING
|
LAZY_RENDERING
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
**Default**: :python:`True` |br|
|
If set, enables lazy rendering mode in ReDoc. This mode is useful for APIs with big number of operations (e.g. > 50).
|
||||||
*Maps to attribute*: ``lazy-rendering``
|
In this mode ReDoc shows initial screen ASAP and then renders the rest operations asynchronously while showing
|
||||||
|
progress bar on the top.
|
||||||
|
|
||||||
|
**NOTE:** this feature might be removed in future versions of ReDoc (see https://github.com/Rebilly/ReDoc/issues/475)
|
||||||
|
|
||||||
|
**Default**: :python:`False` |br|
|
||||||
|
*Maps to attribute*: ``lazyRendering``
|
||||||
|
|
||||||
HIDE_HOSTNAME
|
HIDE_HOSTNAME
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
If set, the protocol and hostname is not shown in the operation definition.
|
||||||
|
|
||||||
**Default**: :python:`False` |br|
|
**Default**: :python:`False` |br|
|
||||||
*Maps to attribute*: ``hide-hostname``
|
*Maps to attribute*: ``hideHostname``
|
||||||
|
|
||||||
EXPAND_RESPONSES
|
EXPAND_RESPONSES
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
Specify which responses to expand by default by response codes. Values should be passed as comma-separated list without
|
||||||
|
spaces e.g. expandResponses="200,201". Special value "all" expands all responses by default.
|
||||||
|
Be careful: this option can slow-down documentation rendering time.
|
||||||
|
|
||||||
**Default**: :python:`'all'` |br|
|
**Default**: :python:`'all'` |br|
|
||||||
*Maps to attribute*: ``expand-responses``
|
*Maps to attribute*: ``expandResponses``
|
||||||
|
|
||||||
PATH_IN_MIDDLE
|
PATH_IN_MIDDLE
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
Show path link and HTTP verb in the middle panel instead of the right one.
|
||||||
|
|
||||||
**Default**: :python:`False` |br|
|
**Default**: :python:`False` |br|
|
||||||
*Maps to attribute*: ``path-in-middle-panel``
|
*Maps to attribute*: ``pathInMiddlePanel``
|
||||||
|
|
||||||
|
NATIVE_SCROLLBARS
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Use native scrollbar for sidemenu instead of perfect-scroll (scrolling performance optimization for big specs).
|
||||||
|
|
||||||
|
**Default**: :python:`False` |br|
|
||||||
|
*Maps to attribute*: ``nativeScrollbars``
|
||||||
|
|
||||||
|
REQUIRED_PROPS_FIRST
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
Show required properties first ordered in the same order as in required array.
|
||||||
|
|
||||||
|
**Default**: :python:`False` |br|
|
||||||
|
*Maps to attribute*: ``requiredPropsFirst``
|
||||||
|
|
||||||
|
|
||||||
.. _FORCE_SCRIPT_NAME: https://docs.djangoproject.com/en/2.0/ref/settings/#force-script-name
|
.. _FORCE_SCRIPT_NAME: https://docs.djangoproject.com/en/2.0/ref/settings/#force-script-name
|
||||||
Generated
+165
-2121
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "drf-yasg",
|
"name": "drf-yasg",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"redoc": "^2.0.0-alpha.17",
|
"redoc": "^2.0.0-alpha.38",
|
||||||
"swagger-ui-dist": "^3.14.1"
|
"swagger-ui-dist": "^3.18.2"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
|
-r requirements/setup.txt
|
||||||
.[validation]
|
.[validation]
|
||||||
-r requirements/heroku.txt
|
-r requirements/heroku.txt
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
coreapi>=2.3.3
|
coreapi>=2.3.3
|
||||||
coreschema>=0.0.4
|
coreschema>=0.0.4
|
||||||
openapi_codec>=1.3.2
|
|
||||||
ruamel.yaml>=0.15.34
|
ruamel.yaml>=0.15.34
|
||||||
inflection>=0.3.1
|
inflection>=0.3.1
|
||||||
future>=0.16.0
|
|
||||||
six>=1.10.0
|
six>=1.10.0
|
||||||
uritemplate>=3.0.0
|
uritemplate>=3.0.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# requirements for local development to be installed via pip install -r requirements/dev.txt
|
# requirements for local development to be installed via pip install -U -r requirements/dev.txt
|
||||||
-r tox.txt
|
-r tox.txt
|
||||||
-r test.txt
|
-r test.txt
|
||||||
-r lint.txt
|
-r lint.txt
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ sphinx_rtd_theme>=0.2.4
|
|||||||
Pillow>=4.3.0
|
Pillow>=4.3.0
|
||||||
readme_renderer>=17.2
|
readme_renderer>=17.2
|
||||||
|
|
||||||
Django>=2.0,<2.1
|
Django>=2.0
|
||||||
djangorestframework_camel_case>=0.2.0
|
djangorestframework_camel_case>=0.2.0
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
# needed to build the package setup_requires in setup.py
|
# needed to build the package setup_requires in setup.py
|
||||||
|
|
||||||
# do not unpin this (see setup.py)
|
setuptools-scm>=3.0.6
|
||||||
setuptools_scm==1.15.6
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# requirements for running the tests via pytest
|
# requirements for running the tests via pytest
|
||||||
pytest>=2.9
|
pytest>=2.9,<3.7 # <3.7 because of incompatible pluggy requirement
|
||||||
pytest-pythonpath>=0.7.1
|
pytest-pythonpath>=0.7.1
|
||||||
pytest-cov>=2.5.1
|
pytest-cov>=2.5.1
|
||||||
pytest-xdist>=1.22.0
|
pytest-xdist>=1.22.0
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
# requirements for building and running tox
|
# requirements for building and running tox
|
||||||
tox>=2.9.1,<3.0.0
|
tox>=3.1.2
|
||||||
detox>=0.11
|
|
||||||
|
|
||||||
-r setup.txt
|
-r setup.txt
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
python-3.6.4
|
python-3.6.6
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
[bdist_wheel]
|
[bdist_wheel]
|
||||||
universal = 1
|
universal = 1
|
||||||
|
|
||||||
|
[metadata]
|
||||||
|
license_file = LICENSE.rst
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import distutils.core
|
from __future__ import print_function
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import random
|
|
||||||
import string
|
|
||||||
import sys
|
import sys
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
@@ -22,52 +21,8 @@ requirements_setup = read_req('setup.txt')
|
|||||||
requirements_validation = read_req('validation.txt')
|
requirements_validation = read_req('validation.txt')
|
||||||
|
|
||||||
|
|
||||||
def _install_setup_requires(attrs):
|
def drf_yasg_setup(**kwargs):
|
||||||
# copied from setuptools
|
setup(
|
||||||
dist = distutils.core.Distribution(dict(
|
|
||||||
(k, v) for k, v in attrs.items()
|
|
||||||
if k in ('dependency_links', 'setup_requires')
|
|
||||||
))
|
|
||||||
# Honor setup.cfg's options.
|
|
||||||
dist.parse_config_files(ignore_option_errors=True)
|
|
||||||
if dist.setup_requires:
|
|
||||||
dist.fetch_build_eggs(dist.setup_requires)
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
# try to install setuptools_scm before setuptools does it, otherwise our monkey patch below will come too early
|
|
||||||
# (setuptools_scm adds find_files hooks into setuptools on install)
|
|
||||||
_install_setup_requires({'setup_requires': requirements_setup})
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if 'sdist' in sys.argv:
|
|
||||||
try:
|
|
||||||
# see https://github.com/pypa/setuptools_scm/issues/190, setuptools_scm includes ALL versioned files from
|
|
||||||
# the git repo into the sdist by default, and there is no easy way to provide an opt-out;
|
|
||||||
# this hack is ugly but does the job; because this is not really a documented interface of the module,
|
|
||||||
# the setuptools_scm version should remain pinned to ensure it keeps working
|
|
||||||
import setuptools_scm.integration
|
|
||||||
|
|
||||||
setuptools_scm.integration.find_files = lambda _: []
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
|
||||||
# this is a workaround for being able to install the package from source without working from a git checkout
|
|
||||||
# it is needed for building succesfully on Heroku
|
|
||||||
from setuptools_scm import get_version
|
|
||||||
|
|
||||||
version = get_version()
|
|
||||||
version_kwargs = {'use_scm_version': True}
|
|
||||||
except LookupError:
|
|
||||||
if 'sdist' in sys.argv or 'bdist_wheel' in sys.argv:
|
|
||||||
raise
|
|
||||||
|
|
||||||
rnd = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(16))
|
|
||||||
version_kwargs = {'version': '0.0.0.dummy+' + rnd}
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name='drf-yasg',
|
name='drf-yasg',
|
||||||
packages=find_packages('src'),
|
packages=find_packages('src'),
|
||||||
package_dir={'': 'src'},
|
package_dir={'': 'src'},
|
||||||
@@ -89,7 +44,7 @@ setup(
|
|||||||
classifiers=[
|
classifiers=[
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
'License :: OSI Approved :: BSD License',
|
'License :: OSI Approved :: BSD License',
|
||||||
'Development Status :: 4 - Beta',
|
'Development Status :: 5 - Production/Stable',
|
||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
'Environment :: Web Environment',
|
'Environment :: Web Environment',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
@@ -99,11 +54,34 @@ setup(
|
|||||||
'Programming Language :: Python :: 3.4',
|
'Programming Language :: Python :: 3.4',
|
||||||
'Programming Language :: Python :: 3.5',
|
'Programming Language :: Python :: 3.5',
|
||||||
'Programming Language :: Python :: 3.6',
|
'Programming Language :: Python :: 3.6',
|
||||||
|
'Programming Language :: Python :: 3.7',
|
||||||
'Framework :: Django',
|
'Framework :: Django',
|
||||||
'Framework :: Django :: 1.11',
|
'Framework :: Django :: 1.11',
|
||||||
'Framework :: Django :: 2.0',
|
'Framework :: Django :: 2.0',
|
||||||
|
'Framework :: Django :: 2.1',
|
||||||
'Topic :: Documentation',
|
'Topic :: Documentation',
|
||||||
'Topic :: Software Development :: Code Generators',
|
'Topic :: Software Development :: Code Generators',
|
||||||
],
|
],
|
||||||
**version_kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
drf_yasg_setup(use_scm_version=True)
|
||||||
|
except LookupError as e:
|
||||||
|
if os.getenv('CI', 'false') == 'true' or os.getenv('TRAVIS', 'false') == 'true':
|
||||||
|
# don't silently fail on travis - we don't want to accidentally push a dummy version to PyPI
|
||||||
|
raise
|
||||||
|
|
||||||
|
if 'setuptools-scm' in str(e):
|
||||||
|
import time
|
||||||
|
|
||||||
|
timestamp_ms = int(time.time() * 1000)
|
||||||
|
timestamp_str = hex(timestamp_ms)[2:].zfill(16)
|
||||||
|
dummy_version = '0.0.0rc0+noscm' + timestamp_str
|
||||||
|
|
||||||
|
drf_yasg_setup(version=dummy_version)
|
||||||
|
print(str(e), file=sys.stderr)
|
||||||
|
print("failed to detect version, build was done using dummy version " + dummy_version, file=sys.stderr)
|
||||||
|
else:
|
||||||
|
raise
|
||||||
@@ -2,6 +2,7 @@ from django.conf import settings
|
|||||||
from rest_framework.settings import perform_import
|
from rest_framework.settings import perform_import
|
||||||
|
|
||||||
SWAGGER_DEFAULTS = {
|
SWAGGER_DEFAULTS = {
|
||||||
|
'DEFAULT_GENERATOR_CLASS': 'drf_yasg.generators.OpenAPISchemaGenerator',
|
||||||
'DEFAULT_AUTO_SCHEMA_CLASS': 'drf_yasg.inspectors.SwaggerAutoSchema',
|
'DEFAULT_AUTO_SCHEMA_CLASS': 'drf_yasg.inspectors.SwaggerAutoSchema',
|
||||||
|
|
||||||
'DEFAULT_FIELD_INSPECTORS': [
|
'DEFAULT_FIELD_INSPECTORS': [
|
||||||
@@ -13,6 +14,7 @@ SWAGGER_DEFAULTS = {
|
|||||||
'drf_yasg.inspectors.DictFieldInspector',
|
'drf_yasg.inspectors.DictFieldInspector',
|
||||||
'drf_yasg.inspectors.HiddenFieldInspector',
|
'drf_yasg.inspectors.HiddenFieldInspector',
|
||||||
'drf_yasg.inspectors.RelatedFieldInspector',
|
'drf_yasg.inspectors.RelatedFieldInspector',
|
||||||
|
'drf_yasg.inspectors.SerializerMethodFieldInspector',
|
||||||
'drf_yasg.inspectors.SimpleFieldInspector',
|
'drf_yasg.inspectors.SimpleFieldInspector',
|
||||||
'drf_yasg.inspectors.StringDefaultFieldInspector',
|
'drf_yasg.inspectors.StringDefaultFieldInspector',
|
||||||
],
|
],
|
||||||
@@ -24,6 +26,8 @@ SWAGGER_DEFAULTS = {
|
|||||||
'drf_yasg.inspectors.CoreAPICompatInspector',
|
'drf_yasg.inspectors.CoreAPICompatInspector',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'EXCLUDED_MEDIA_TYPES': ['html'],
|
||||||
|
|
||||||
'DEFAULT_INFO': None,
|
'DEFAULT_INFO': None,
|
||||||
'DEFAULT_API_URL': None,
|
'DEFAULT_API_URL': None,
|
||||||
|
|
||||||
@@ -36,6 +40,7 @@ SWAGGER_DEFAULTS = {
|
|||||||
'SECURITY_REQUIREMENTS': None,
|
'SECURITY_REQUIREMENTS': None,
|
||||||
'LOGIN_URL': getattr(settings, 'LOGIN_URL', None),
|
'LOGIN_URL': getattr(settings, 'LOGIN_URL', None),
|
||||||
'LOGOUT_URL': getattr(settings, 'LOGOUT_URL', None),
|
'LOGOUT_URL': getattr(settings, 'LOGOUT_URL', None),
|
||||||
|
'SPEC_URL': None,
|
||||||
'VALIDATOR_URL': '',
|
'VALIDATOR_URL': '',
|
||||||
|
|
||||||
'OPERATIONS_SORTER': None,
|
'OPERATIONS_SORTER': None,
|
||||||
@@ -58,16 +63,21 @@ SWAGGER_DEFAULTS = {
|
|||||||
'patch',
|
'patch',
|
||||||
'trace'
|
'trace'
|
||||||
],
|
],
|
||||||
|
'DISPLAY_OPERATION_ID': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
REDOC_DEFAULTS = {
|
REDOC_DEFAULTS = {
|
||||||
'LAZY_RENDERING': True,
|
'SPEC_URL': None,
|
||||||
|
'LAZY_RENDERING': False,
|
||||||
'HIDE_HOSTNAME': False,
|
'HIDE_HOSTNAME': False,
|
||||||
'EXPAND_RESPONSES': 'all',
|
'EXPAND_RESPONSES': 'all',
|
||||||
'PATH_IN_MIDDLE': False,
|
'PATH_IN_MIDDLE': False,
|
||||||
|
'NATIVE_SCROLLBARS': False,
|
||||||
|
'REQUIRED_PROPS_FIRST': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPORT_STRINGS = [
|
IMPORT_STRINGS = [
|
||||||
|
'DEFAULT_GENERATOR_CLASS',
|
||||||
'DEFAULT_AUTO_SCHEMA_CLASS',
|
'DEFAULT_AUTO_SCHEMA_CLASS',
|
||||||
'DEFAULT_FIELD_INSPECTORS',
|
'DEFAULT_FIELD_INSPECTORS',
|
||||||
'DEFAULT_FILTER_INSPECTORS',
|
'DEFAULT_FILTER_INSPECTORS',
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from future.utils import raise_from
|
from six import raise_from
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import json
|
import json
|
||||||
|
|||||||
+53
-14
@@ -5,7 +5,6 @@ from collections import OrderedDict, defaultdict
|
|||||||
|
|
||||||
import uritemplate
|
import uritemplate
|
||||||
from coreapi.compat import urlparse
|
from coreapi.compat import urlparse
|
||||||
from django.utils.encoding import force_text
|
|
||||||
from rest_framework import versioning
|
from rest_framework import versioning
|
||||||
from rest_framework.compat import URLPattern, URLResolver, get_original_route
|
from rest_framework.compat import URLPattern, URLResolver, get_original_route
|
||||||
from rest_framework.schemas.generators import EndpointEnumerator as _EndpointEnumerator
|
from rest_framework.schemas.generators import EndpointEnumerator as _EndpointEnumerator
|
||||||
@@ -16,9 +15,9 @@ from rest_framework.settings import api_settings as rest_framework_settings
|
|||||||
from . import openapi
|
from . import openapi
|
||||||
from .app_settings import swagger_settings
|
from .app_settings import swagger_settings
|
||||||
from .errors import SwaggerGenerationError
|
from .errors import SwaggerGenerationError
|
||||||
from .inspectors.field import get_basic_type_info, get_queryset_field
|
from .inspectors.field import get_basic_type_info, get_queryset_field, get_queryset_from_view
|
||||||
from .openapi import ReferenceResolver
|
from .openapi import ReferenceResolver
|
||||||
from .utils import get_consumes, get_produces
|
from .utils import force_real_str, get_consumes, get_produces
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -32,8 +31,7 @@ class EndpointEnumerator(_EndpointEnumerator):
|
|||||||
|
|
||||||
def get_path_from_regex(self, path_regex):
|
def get_path_from_regex(self, path_regex):
|
||||||
if path_regex.endswith(')'):
|
if path_regex.endswith(')'):
|
||||||
logger.warning("url pattern does not end in $ ('%s') - unexpected things might happen",
|
logger.warning("url pattern does not end in $ ('%s') - unexpected things might happen", path_regex)
|
||||||
path_regex)
|
|
||||||
return self.unescape_path(super(EndpointEnumerator, self).get_path_from_regex(path_regex))
|
return self.unescape_path(super(EndpointEnumerator, self).get_path_from_regex(path_regex))
|
||||||
|
|
||||||
def should_include_endpoint(self, path, callback, app_name='', namespace='', url_name=None):
|
def should_include_endpoint(self, path, callback, app_name='', namespace='', url_name=None):
|
||||||
@@ -72,7 +70,7 @@ class EndpointEnumerator(_EndpointEnumerator):
|
|||||||
|
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def get_api_endpoints(self, patterns=None, prefix='', app_name=None, namespace=None):
|
def get_api_endpoints(self, patterns=None, prefix='', app_name=None, namespace=None, ignored_endpoints=None):
|
||||||
"""
|
"""
|
||||||
Return a list of all available API endpoints by inspecting the URL conf.
|
Return a list of all available API endpoints by inspecting the URL conf.
|
||||||
|
|
||||||
@@ -82,25 +80,38 @@ class EndpointEnumerator(_EndpointEnumerator):
|
|||||||
patterns = self.patterns
|
patterns = self.patterns
|
||||||
|
|
||||||
api_endpoints = []
|
api_endpoints = []
|
||||||
|
if ignored_endpoints is None:
|
||||||
|
ignored_endpoints = set()
|
||||||
|
|
||||||
for pattern in patterns:
|
for pattern in patterns:
|
||||||
path_regex = prefix + get_original_route(pattern)
|
path_regex = prefix + get_original_route(pattern)
|
||||||
if isinstance(pattern, URLPattern):
|
if isinstance(pattern, URLPattern):
|
||||||
|
try:
|
||||||
path = self.get_path_from_regex(path_regex)
|
path = self.get_path_from_regex(path_regex)
|
||||||
callback = pattern.callback
|
callback = pattern.callback
|
||||||
url_name = pattern.name
|
url_name = pattern.name
|
||||||
if self.should_include_endpoint(path, callback, app_name or '', namespace or '', url_name):
|
if self.should_include_endpoint(path, callback, app_name or '', namespace or '', url_name):
|
||||||
path = self.replace_version(path, callback)
|
path = self.replace_version(path, callback)
|
||||||
|
|
||||||
|
# avoid adding endpoints that have already been seen,
|
||||||
|
# as Django resolves urls in top-down order
|
||||||
|
if path in ignored_endpoints:
|
||||||
|
continue
|
||||||
|
ignored_endpoints.add(path)
|
||||||
|
|
||||||
for method in self.get_allowed_methods(callback):
|
for method in self.get_allowed_methods(callback):
|
||||||
endpoint = (path, method, callback)
|
endpoint = (path, method, callback)
|
||||||
api_endpoints.append(endpoint)
|
api_endpoints.append(endpoint)
|
||||||
|
except Exception: # pragma: no cover
|
||||||
|
logger.warning('failed to enumerate view', exc_info=True)
|
||||||
|
|
||||||
elif isinstance(pattern, URLResolver):
|
elif isinstance(pattern, URLResolver):
|
||||||
nested_endpoints = self.get_api_endpoints(
|
nested_endpoints = self.get_api_endpoints(
|
||||||
patterns=pattern.url_patterns,
|
patterns=pattern.url_patterns,
|
||||||
prefix=path_regex,
|
prefix=path_regex,
|
||||||
app_name="%s:%s" % (app_name, pattern.app_name) if app_name else pattern.app_name,
|
app_name="%s:%s" % (app_name, pattern.app_name) if app_name else pattern.app_name,
|
||||||
namespace="%s:%s" % (namespace, pattern.namespace) if namespace else pattern.namespace
|
namespace="%s:%s" % (namespace, pattern.namespace) if namespace else pattern.namespace,
|
||||||
|
ignored_endpoints=ignored_endpoints
|
||||||
)
|
)
|
||||||
api_endpoints.extend(nested_endpoints)
|
api_endpoints.extend(nested_endpoints)
|
||||||
else:
|
else:
|
||||||
@@ -123,7 +134,7 @@ class EndpointEnumerator(_EndpointEnumerator):
|
|||||||
"""Remove backslashe escapes from all path components outside {parameters}. This is needed because
|
"""Remove backslashe escapes from all path components outside {parameters}. This is needed because
|
||||||
``simplify_regex`` does not handle this correctly - note however that this implementation is
|
``simplify_regex`` does not handle this correctly - note however that this implementation is
|
||||||
|
|
||||||
**NOTE:** this might destructively affect some url regex patterns that contain metacharacters (e.g. \w, \d)
|
**NOTE:** this might destructively affect some url regex patterns that contain metacharacters (e.g. \\w, \\d)
|
||||||
outside path parameter groups; if you are in this category, God help you
|
outside path parameter groups; if you are in this category, God help you
|
||||||
|
|
||||||
:param str path: path possibly containing
|
:param str path: path possibly containing
|
||||||
@@ -240,6 +251,8 @@ class OpenAPISchemaGenerator(object):
|
|||||||
view_method = getattr(view, method, None)
|
view_method = getattr(view, method, None)
|
||||||
if view_method is not None: # pragma: no cover
|
if view_method is not None: # pragma: no cover
|
||||||
setattr(view_method.__func__, '_swagger_auto_schema', overrides)
|
setattr(view_method.__func__, '_swagger_auto_schema', overrides)
|
||||||
|
|
||||||
|
setattr(view, 'swagger_fake_view', True)
|
||||||
return view
|
return view
|
||||||
|
|
||||||
def get_endpoints(self, request):
|
def get_endpoints(self, request):
|
||||||
@@ -298,6 +311,27 @@ class OpenAPISchemaGenerator(object):
|
|||||||
"""
|
"""
|
||||||
return self._gen.determine_path_prefix(paths)
|
return self._gen.determine_path_prefix(paths)
|
||||||
|
|
||||||
|
def should_include_endpoint(self, path, method, view, public):
|
||||||
|
"""Check if a given endpoint should be included in the resulting schema.
|
||||||
|
|
||||||
|
:param str path: request path
|
||||||
|
:param str method: http request method
|
||||||
|
:param view: instantiated view callback
|
||||||
|
:param bool public: if True, all endpoints are included regardless of access through `request`
|
||||||
|
:returns: true if the view should be excluded
|
||||||
|
:rtype: bool
|
||||||
|
"""
|
||||||
|
return public or self._gen.has_view_permissions(path, method, view)
|
||||||
|
|
||||||
|
def get_paths_object(self, paths):
|
||||||
|
"""Construct the Swagger Paths object.
|
||||||
|
|
||||||
|
:param OrderedDict[str,openapi.PathItem] paths: mapping of paths to :class:`.PathItem` objects
|
||||||
|
:returns: the :class:`.Paths` object
|
||||||
|
:rtype: openapi.Paths
|
||||||
|
"""
|
||||||
|
return openapi.Paths(paths=paths)
|
||||||
|
|
||||||
def get_paths(self, endpoints, components, request, public):
|
def get_paths(self, endpoints, components, request, public):
|
||||||
"""Generate the Swagger Paths for the API from the given endpoints.
|
"""Generate the Swagger Paths for the API from the given endpoints.
|
||||||
|
|
||||||
@@ -318,10 +352,12 @@ class OpenAPISchemaGenerator(object):
|
|||||||
for path, (view_cls, methods) in sorted(endpoints.items()):
|
for path, (view_cls, methods) in sorted(endpoints.items()):
|
||||||
operations = {}
|
operations = {}
|
||||||
for method, view in methods:
|
for method, view in methods:
|
||||||
if not public and not self._gen.has_view_permissions(path, method, view):
|
if not self.should_include_endpoint(path, method, view, public):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
operations[method.lower()] = self.get_operation(view, path, prefix, method, components, request)
|
operation = self.get_operation(view, path, prefix, method, components, request)
|
||||||
|
if operation is not None:
|
||||||
|
operations[method.lower()] = operation
|
||||||
|
|
||||||
if operations:
|
if operations:
|
||||||
# since the common prefix is used as the API basePath, it must be stripped
|
# since the common prefix is used as the API basePath, it must be stripped
|
||||||
@@ -331,7 +367,7 @@ class OpenAPISchemaGenerator(object):
|
|||||||
path_suffix = '/' + path_suffix
|
path_suffix = '/' + path_suffix
|
||||||
paths[path_suffix] = self.get_path_item(path, view_cls, operations)
|
paths[path_suffix] = self.get_path_item(path, view_cls, operations)
|
||||||
|
|
||||||
return openapi.Paths(paths=paths), prefix
|
return self.get_paths_object(paths), prefix
|
||||||
|
|
||||||
def get_operation(self, view, path, prefix, method, components, request):
|
def get_operation(self, view, path, prefix, method, components, request):
|
||||||
"""Get an :class:`.Operation` for the given API endpoint (path, method). This method delegates to
|
"""Get an :class:`.Operation` for the given API endpoint (path, method). This method delegates to
|
||||||
@@ -362,6 +398,9 @@ class OpenAPISchemaGenerator(object):
|
|||||||
|
|
||||||
view_inspector = view_inspector_cls(view, path, method, components, request, overrides)
|
view_inspector = view_inspector_cls(view, path, method, components, request, overrides)
|
||||||
operation = view_inspector.get_operation(operation_keys)
|
operation = view_inspector.get_operation(operation_keys)
|
||||||
|
if operation is None:
|
||||||
|
return None
|
||||||
|
|
||||||
if 'consumes' in operation and set(operation.consumes) == set(self.consumes):
|
if 'consumes' in operation and set(operation.consumes) == set(self.consumes):
|
||||||
del operation.consumes
|
del operation.consumes
|
||||||
if 'produces' in operation and set(operation.produces) == set(self.produces):
|
if 'produces' in operation and set(operation.produces) == set(self.produces):
|
||||||
@@ -406,7 +445,7 @@ class OpenAPISchemaGenerator(object):
|
|||||||
:rtype: list[openapi.Parameter]
|
:rtype: list[openapi.Parameter]
|
||||||
"""
|
"""
|
||||||
parameters = []
|
parameters = []
|
||||||
queryset = getattr(view_cls, 'queryset', None)
|
queryset = get_queryset_from_view(view_cls)
|
||||||
|
|
||||||
for variable in sorted(uritemplate.variables(path)):
|
for variable in sorted(uritemplate.variables(path)):
|
||||||
model, model_field = get_queryset_field(queryset, variable)
|
model, model_field = get_queryset_field(queryset, variable)
|
||||||
@@ -415,7 +454,7 @@ class OpenAPISchemaGenerator(object):
|
|||||||
attrs['pattern'] = getattr(view_cls, 'lookup_value_regex', attrs.get('pattern', None))
|
attrs['pattern'] = getattr(view_cls, 'lookup_value_regex', attrs.get('pattern', None))
|
||||||
|
|
||||||
if model_field and getattr(model_field, 'help_text', False):
|
if model_field and getattr(model_field, 'help_text', False):
|
||||||
description = force_text(model_field.help_text)
|
description = model_field.help_text
|
||||||
elif model_field and getattr(model_field, 'primary_key', False):
|
elif model_field and getattr(model_field, 'primary_key', False):
|
||||||
description = get_pk_description(model, model_field)
|
description = get_pk_description(model, model_field)
|
||||||
else:
|
else:
|
||||||
@@ -423,7 +462,7 @@ class OpenAPISchemaGenerator(object):
|
|||||||
|
|
||||||
field = openapi.Parameter(
|
field = openapi.Parameter(
|
||||||
name=variable,
|
name=variable,
|
||||||
description=description,
|
description=force_real_str(description),
|
||||||
required=True,
|
required=True,
|
||||||
in_=openapi.IN_PATH,
|
in_=openapi.IN_PATH,
|
||||||
**attrs
|
**attrs
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ from .base import (
|
|||||||
from .field import (
|
from .field import (
|
||||||
CamelCaseJSONFilter, ChoiceFieldInspector, DictFieldInspector, FileFieldInspector, HiddenFieldInspector,
|
CamelCaseJSONFilter, ChoiceFieldInspector, DictFieldInspector, FileFieldInspector, HiddenFieldInspector,
|
||||||
InlineSerializerInspector, RecursiveFieldInspector, ReferencingSerializerInspector, RelatedFieldInspector,
|
InlineSerializerInspector, RecursiveFieldInspector, ReferencingSerializerInspector, RelatedFieldInspector,
|
||||||
SimpleFieldInspector, StringDefaultFieldInspector
|
SerializerMethodFieldInspector, SimpleFieldInspector, StringDefaultFieldInspector
|
||||||
)
|
)
|
||||||
from .query import CoreAPICompatInspector, DjangoRestResponsePagination
|
from .query import CoreAPICompatInspector, DjangoRestResponsePagination
|
||||||
from .view import SwaggerAutoSchema
|
from .view import SwaggerAutoSchema
|
||||||
|
|
||||||
# these settings must be accesed only after definig/importing all the classes in this module to avoid ImportErrors
|
# these settings must be accessed only after defining/importing all the classes in this module to avoid ImportErrors
|
||||||
ViewInspector.field_inspectors = swagger_settings.DEFAULT_FIELD_INSPECTORS
|
ViewInspector.field_inspectors = swagger_settings.DEFAULT_FIELD_INSPECTORS
|
||||||
ViewInspector.filter_inspectors = swagger_settings.DEFAULT_FILTER_INSPECTORS
|
ViewInspector.filter_inspectors = swagger_settings.DEFAULT_FILTER_INSPECTORS
|
||||||
ViewInspector.paginator_inspectors = swagger_settings.DEFAULT_PAGINATOR_INSPECTORS
|
ViewInspector.paginator_inspectors = swagger_settings.DEFAULT_PAGINATOR_INSPECTORS
|
||||||
@@ -25,7 +25,7 @@ __all__ = [
|
|||||||
# field inspectors
|
# field inspectors
|
||||||
'InlineSerializerInspector', 'RecursiveFieldInspector', 'ReferencingSerializerInspector', 'RelatedFieldInspector',
|
'InlineSerializerInspector', 'RecursiveFieldInspector', 'ReferencingSerializerInspector', 'RelatedFieldInspector',
|
||||||
'SimpleFieldInspector', 'FileFieldInspector', 'ChoiceFieldInspector', 'DictFieldInspector',
|
'SimpleFieldInspector', 'FileFieldInspector', 'ChoiceFieldInspector', 'DictFieldInspector',
|
||||||
'StringDefaultFieldInspector', 'CamelCaseJSONFilter', 'HiddenFieldInspector',
|
'StringDefaultFieldInspector', 'CamelCaseJSONFilter', 'HiddenFieldInspector', 'SerializerMethodFieldInspector',
|
||||||
|
|
||||||
# view inspectors
|
# view inspectors
|
||||||
'SwaggerAutoSchema',
|
'SwaggerAutoSchema',
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import inspect
|
import inspect
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.utils.encoding import force_text
|
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework.utils import encoders, json
|
|
||||||
|
|
||||||
from .. import openapi
|
from .. import openapi
|
||||||
from ..utils import decimal_as_float, is_list_view
|
from ..utils import force_real_str, get_field_default, is_list_view
|
||||||
|
|
||||||
#: Sentinel value that inspectors must return to signal that they do not know how to handle an object
|
#: Sentinel value that inspectors must return to signal that they do not know how to handle an object
|
||||||
NotHandled = object()
|
NotHandled = object()
|
||||||
@@ -136,6 +134,19 @@ class FieldInspector(BaseInspector):
|
|||||||
super(FieldInspector, self).__init__(view, path, method, components, request)
|
super(FieldInspector, self).__init__(view, path, method, components, request)
|
||||||
self.field_inspectors = field_inspectors
|
self.field_inspectors = field_inspectors
|
||||||
|
|
||||||
|
def add_manual_fields(self, serializer_or_field, schema):
|
||||||
|
"""Set fields from the ``swagger_schem_fields`` attribute on the Meta class. This method is called
|
||||||
|
only for serializers or fields that are converted into ``openapi.Schema`` objects.
|
||||||
|
|
||||||
|
:param serializer_or_field: serializer or field instance
|
||||||
|
:param openapi.Schema schema: the schema object to be modified in-place
|
||||||
|
"""
|
||||||
|
meta = getattr(serializer_or_field, 'Meta', None)
|
||||||
|
swagger_schema_fields = getattr(meta, 'swagger_schema_fields', {})
|
||||||
|
if swagger_schema_fields:
|
||||||
|
for attr, val in swagger_schema_fields.items():
|
||||||
|
setattr(schema, attr, val)
|
||||||
|
|
||||||
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
||||||
"""Convert a drf Serializer or Field instance into a Swagger object.
|
"""Convert a drf Serializer or Field instance into a Swagger object.
|
||||||
|
|
||||||
@@ -196,9 +207,9 @@ class FieldInspector(BaseInspector):
|
|||||||
"""
|
"""
|
||||||
assert swagger_object_type in (openapi.Schema, openapi.Parameter, openapi.Items)
|
assert swagger_object_type in (openapi.Schema, openapi.Parameter, openapi.Items)
|
||||||
assert not isinstance(field, openapi.SwaggerDict), "passed field is already a SwaggerDict object"
|
assert not isinstance(field, openapi.SwaggerDict), "passed field is already a SwaggerDict object"
|
||||||
title = force_text(field.label) if field.label else None
|
title = force_real_str(field.label) if field.label else None
|
||||||
title = title if swagger_object_type == openapi.Schema else None # only Schema has title
|
title = title if swagger_object_type == openapi.Schema else None # only Schema has title
|
||||||
description = force_text(field.help_text) if field.help_text else None
|
description = force_real_str(field.help_text) if field.help_text else None
|
||||||
description = description if swagger_object_type != openapi.Items else None # Items has no description either
|
description = description if swagger_object_type != openapi.Items else None # Items has no description either
|
||||||
|
|
||||||
def SwaggerType(existing_object=None, **instance_kwargs):
|
def SwaggerType(existing_object=None, **instance_kwargs):
|
||||||
@@ -206,46 +217,29 @@ class FieldInspector(BaseInspector):
|
|||||||
instance_kwargs['required'] = field.required
|
instance_kwargs['required'] = field.required
|
||||||
|
|
||||||
if 'default' not in instance_kwargs and swagger_object_type != openapi.Items:
|
if 'default' not in instance_kwargs and swagger_object_type != openapi.Items:
|
||||||
default = getattr(field, 'default', serializers.empty)
|
default = get_field_default(field)
|
||||||
if default is not serializers.empty:
|
if default not in (None, serializers.empty):
|
||||||
if callable(default):
|
|
||||||
try:
|
|
||||||
if hasattr(default, 'set_context'):
|
|
||||||
default.set_context(field)
|
|
||||||
default = default()
|
|
||||||
except Exception: # pragma: no cover
|
|
||||||
logger.warning("default for %s is callable but it raised an exception when "
|
|
||||||
"called; 'default' field will not be added to schema", field, exc_info=True)
|
|
||||||
default = None
|
|
||||||
|
|
||||||
if default is not None:
|
|
||||||
try:
|
|
||||||
default = field.to_representation(default)
|
|
||||||
# JSON roundtrip ensures that the value is valid JSON;
|
|
||||||
# for example, sets and tuples get transformed into lists
|
|
||||||
default = json.loads(json.dumps(default, cls=encoders.JSONEncoder))
|
|
||||||
if decimal_as_float(field):
|
|
||||||
default = float(default)
|
|
||||||
except Exception: # pragma: no cover
|
|
||||||
logger.warning("'default' on schema for %s will not be set because "
|
|
||||||
"to_representation raised an exception", field, exc_info=True)
|
|
||||||
default = None
|
|
||||||
|
|
||||||
if default is not None:
|
|
||||||
instance_kwargs['default'] = default
|
instance_kwargs['default'] = default
|
||||||
|
|
||||||
if instance_kwargs.get('type', None) != openapi.TYPE_ARRAY:
|
if instance_kwargs.get('type', None) != openapi.TYPE_ARRAY:
|
||||||
instance_kwargs.setdefault('title', title)
|
instance_kwargs.setdefault('title', title)
|
||||||
|
if description is not None:
|
||||||
instance_kwargs.setdefault('description', description)
|
instance_kwargs.setdefault('description', description)
|
||||||
instance_kwargs.update(kwargs)
|
instance_kwargs.update(kwargs)
|
||||||
|
|
||||||
if existing_object is not None:
|
if existing_object is not None:
|
||||||
assert isinstance(existing_object, swagger_object_type)
|
assert isinstance(existing_object, swagger_object_type)
|
||||||
for attr, val in sorted(instance_kwargs.items()):
|
for key, val in sorted(instance_kwargs.items()):
|
||||||
setattr(existing_object, attr, val)
|
setattr(existing_object, key, val)
|
||||||
return existing_object
|
result = existing_object
|
||||||
|
else:
|
||||||
|
result = swagger_object_type(**instance_kwargs)
|
||||||
|
|
||||||
return swagger_object_type(**instance_kwargs)
|
# Provide an option to add manual paremeters to a schema
|
||||||
|
# for example, to add examples
|
||||||
|
if swagger_object_type == openapi.Schema:
|
||||||
|
self.add_manual_fields(field, result)
|
||||||
|
return result
|
||||||
|
|
||||||
# arrays in Schema have Schema elements, arrays in Parameter and Items have Items elements
|
# arrays in Schema have Schema elements, arrays in Parameter and Items have Items elements
|
||||||
child_swagger_type = openapi.Schema if swagger_object_type == openapi.Schema else openapi.Items
|
child_swagger_type = openapi.Schema if swagger_object_type == openapi.Schema else openapi.Items
|
||||||
@@ -264,7 +258,7 @@ class SerializerInspector(FieldInspector):
|
|||||||
return NotHandled
|
return NotHandled
|
||||||
|
|
||||||
def get_request_parameters(self, serializer, in_):
|
def get_request_parameters(self, serializer, in_):
|
||||||
"""Convert a DRF serializer into a list of :class:`.Parameter`\ s.
|
"""Convert a DRF serializer into a list of :class:`.Parameter`\\ s.
|
||||||
|
|
||||||
Should return :data:`.NotHandled` if this inspector does not know how to handle the given `serializer`.
|
Should return :data:`.NotHandled` if this inspector does not know how to handle the given `serializer`.
|
||||||
|
|
||||||
@@ -276,7 +270,10 @@ class SerializerInspector(FieldInspector):
|
|||||||
|
|
||||||
|
|
||||||
class ViewInspector(BaseInspector):
|
class ViewInspector(BaseInspector):
|
||||||
body_methods = ('PUT', 'PATCH', 'POST') #: methods that are allowed to have a request body
|
body_methods = ('PUT', 'PATCH', 'POST', 'DELETE') #: methods that are allowed to have a request body
|
||||||
|
|
||||||
|
#: methods that are assumed to require a request body determined by the view's ``serializer_class``
|
||||||
|
implicit_body_methods = ('PUT', 'PATCH', 'POST')
|
||||||
|
|
||||||
# real values set in __init__ to prevent import errors
|
# real values set in __init__ to prevent import errors
|
||||||
field_inspectors = [] #:
|
field_inspectors = [] #:
|
||||||
@@ -368,14 +365,14 @@ class ViewInspector(BaseInspector):
|
|||||||
|
|
||||||
:param serializers.BaseSerializer serializer: the ``Serializer`` instance
|
:param serializers.BaseSerializer serializer: the ``Serializer`` instance
|
||||||
:returns: the converted :class:`.Schema`, or ``None`` in case of an unknown serializer
|
:returns: the converted :class:`.Schema`, or ``None`` in case of an unknown serializer
|
||||||
:rtype: openapi.Schema,openapi.SchemaRef,None
|
:rtype: openapi.Schema,openapi.SchemaRef
|
||||||
"""
|
"""
|
||||||
return self.probe_inspectors(
|
return self.probe_inspectors(
|
||||||
self.field_inspectors, 'get_schema', serializer, {'field_inspectors': self.field_inspectors}
|
self.field_inspectors, 'get_schema', serializer, {'field_inspectors': self.field_inspectors}
|
||||||
)
|
)
|
||||||
|
|
||||||
def serializer_to_parameters(self, serializer, in_):
|
def serializer_to_parameters(self, serializer, in_):
|
||||||
"""Convert a serializer to a possibly empty list of :class:`.Parameter`\ s.
|
"""Convert a serializer to a possibly empty list of :class:`.Parameter`\\ s.
|
||||||
|
|
||||||
:param serializers.BaseSerializer serializer: the ``Serializer`` instance
|
:param serializers.BaseSerializer serializer: the ``Serializer`` instance
|
||||||
:param str in_: the location of the parameters, one of the `openapi.IN_*` constants
|
:param str in_: the location of the parameters, one of the `openapi.IN_*` constants
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
import datetime
|
||||||
|
import inspect
|
||||||
import logging
|
import logging
|
||||||
import operator
|
import operator
|
||||||
|
import uuid
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
from inspect import isclass
|
||||||
|
|
||||||
from django.core import validators
|
from django.core import validators
|
||||||
from django.db import models
|
from django.db import models
|
||||||
@@ -10,9 +14,15 @@ from rest_framework.settings import api_settings as rest_framework_settings
|
|||||||
|
|
||||||
from .. import openapi
|
from .. import openapi
|
||||||
from ..errors import SwaggerGenerationError
|
from ..errors import SwaggerGenerationError
|
||||||
from ..utils import decimal_as_float, filter_none, get_serializer_ref_name
|
from ..utils import decimal_as_float, filter_none, get_serializer_class, get_serializer_ref_name
|
||||||
from .base import FieldInspector, NotHandled, SerializerInspector
|
from .base import FieldInspector, NotHandled, SerializerInspector
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Python>=3.5
|
||||||
|
import typing
|
||||||
|
except ImportError:
|
||||||
|
typing = None
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -25,9 +35,20 @@ class InlineSerializerInspector(SerializerInspector):
|
|||||||
def get_schema(self, serializer):
|
def get_schema(self, serializer):
|
||||||
return self.probe_field_inspectors(serializer, openapi.Schema, self.use_definitions)
|
return self.probe_field_inspectors(serializer, openapi.Schema, self.use_definitions)
|
||||||
|
|
||||||
|
def add_manual_parameters(self, serializer, parameters):
|
||||||
|
"""Add/replace parameters from the given list of automatically generated request parameters. This method
|
||||||
|
is called only when the serializer is converted into a list of parameters for use in a form data request.
|
||||||
|
|
||||||
|
:param serializer: serializer instance
|
||||||
|
:param list[openapi.Parameter] parameters: genereated parameters
|
||||||
|
:return: modified parameters
|
||||||
|
:rtype: list[openapi.Parameter]
|
||||||
|
"""
|
||||||
|
return parameters
|
||||||
|
|
||||||
def get_request_parameters(self, serializer, in_):
|
def get_request_parameters(self, serializer, in_):
|
||||||
fields = getattr(serializer, 'fields', {})
|
fields = getattr(serializer, 'fields', {})
|
||||||
return [
|
parameters = [
|
||||||
self.probe_field_inspectors(
|
self.probe_field_inspectors(
|
||||||
value, openapi.Parameter, self.use_definitions,
|
value, openapi.Parameter, self.use_definitions,
|
||||||
name=self.get_parameter_name(key), in_=in_
|
name=self.get_parameter_name(key), in_=in_
|
||||||
@@ -36,12 +57,17 @@ class InlineSerializerInspector(SerializerInspector):
|
|||||||
in fields.items()
|
in fields.items()
|
||||||
]
|
]
|
||||||
|
|
||||||
|
return self.add_manual_parameters(serializer, parameters)
|
||||||
|
|
||||||
def get_property_name(self, field_name):
|
def get_property_name(self, field_name):
|
||||||
return field_name
|
return field_name
|
||||||
|
|
||||||
def get_parameter_name(self, field_name):
|
def get_parameter_name(self, field_name):
|
||||||
return field_name
|
return field_name
|
||||||
|
|
||||||
|
def get_serializer_ref_name(self, serializer):
|
||||||
|
return get_serializer_ref_name(serializer)
|
||||||
|
|
||||||
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
||||||
SwaggerType, ChildSwaggerType = self._get_partial_types(field, swagger_object_type, use_references, **kwargs)
|
SwaggerType, ChildSwaggerType = self._get_partial_types(field, swagger_object_type, use_references, **kwargs)
|
||||||
|
|
||||||
@@ -55,7 +81,7 @@ class InlineSerializerInspector(SerializerInspector):
|
|||||||
if swagger_object_type != openapi.Schema:
|
if swagger_object_type != openapi.Schema:
|
||||||
raise SwaggerGenerationError("cannot instantiate nested serializer as " + swagger_object_type.__name__)
|
raise SwaggerGenerationError("cannot instantiate nested serializer as " + swagger_object_type.__name__)
|
||||||
|
|
||||||
ref_name = get_serializer_ref_name(field)
|
ref_name = self.get_serializer_ref_name(field)
|
||||||
|
|
||||||
def make_schema_definition():
|
def make_schema_definition():
|
||||||
properties = OrderedDict()
|
properties = OrderedDict()
|
||||||
@@ -63,14 +89,16 @@ class InlineSerializerInspector(SerializerInspector):
|
|||||||
for property_name, child in field.fields.items():
|
for property_name, child in field.fields.items():
|
||||||
property_name = self.get_property_name(property_name)
|
property_name = self.get_property_name(property_name)
|
||||||
prop_kwargs = {
|
prop_kwargs = {
|
||||||
'read_only': child.read_only or None
|
'read_only': bool(child.read_only) or None
|
||||||
}
|
}
|
||||||
prop_kwargs = filter_none(prop_kwargs)
|
prop_kwargs = filter_none(prop_kwargs)
|
||||||
|
|
||||||
properties[property_name] = self.probe_field_inspectors(
|
child_schema = self.probe_field_inspectors(
|
||||||
child, ChildSwaggerType, use_references, **prop_kwargs
|
child, ChildSwaggerType, use_references, **prop_kwargs
|
||||||
)
|
)
|
||||||
if child.required:
|
properties[property_name] = child_schema
|
||||||
|
|
||||||
|
if child.required and not getattr(child_schema, 'read_only', False):
|
||||||
required.append(property_name)
|
required.append(property_name)
|
||||||
|
|
||||||
result = SwaggerType(
|
result = SwaggerType(
|
||||||
@@ -80,16 +108,25 @@ class InlineSerializerInspector(SerializerInspector):
|
|||||||
)
|
)
|
||||||
if not ref_name and 'title' in result:
|
if not ref_name and 'title' in result:
|
||||||
# on an inline model, the title is derived from the field name
|
# on an inline model, the title is derived from the field name
|
||||||
# but is visually displayed like the model name, which is confusing
|
# but is visno coverually displayed like the model name, which is confusing
|
||||||
# it is better to just remove title from inline models
|
# it is better to just remove title from inline models
|
||||||
del result.title
|
del result.title
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
if not ref_name or not use_references:
|
if not ref_name or not use_references:
|
||||||
return make_schema_definition()
|
return make_schema_definition()
|
||||||
|
|
||||||
definitions = self.components.with_scope(openapi.SCHEMA_DEFINITIONS)
|
definitions = self.components.with_scope(openapi.SCHEMA_DEFINITIONS)
|
||||||
definitions.setdefault(ref_name, make_schema_definition)
|
actual_schema = definitions.setdefault(ref_name, make_schema_definition)
|
||||||
|
actual_schema._remove_read_only()
|
||||||
|
|
||||||
|
actual_serializer = get_serializer_class(getattr(actual_schema, '_serializer', None))
|
||||||
|
this_serializer = get_serializer_class(field)
|
||||||
|
if actual_serializer and actual_serializer != this_serializer: # pragma: no cover
|
||||||
|
logger.warning("Schema for %s will override distinct serializer %s because they "
|
||||||
|
"share the same ref_name", actual_serializer, this_serializer)
|
||||||
|
|
||||||
return openapi.SchemaRef(definitions, ref_name)
|
return openapi.SchemaRef(definitions, ref_name)
|
||||||
|
|
||||||
return NotHandled
|
return NotHandled
|
||||||
@@ -128,6 +165,25 @@ def get_model_field(model, field_name):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def get_queryset_from_view(view, serializer=None):
|
||||||
|
"""Try to get the queryset of the given view
|
||||||
|
|
||||||
|
:param view: the view instance or class
|
||||||
|
:param serializer: if given, will check that the view's get_serializer_class return matches this serialzier
|
||||||
|
:return: queryset or ``None``
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
queryset = getattr(view, 'queryset', None)
|
||||||
|
|
||||||
|
if queryset is not None and serializer is not None:
|
||||||
|
# make sure the view is actually using *this* serializer
|
||||||
|
assert type(serializer) == view.get_serializer_class()
|
||||||
|
|
||||||
|
return queryset
|
||||||
|
except Exception: # pragma: no cover
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_parent_serializer(field):
|
def get_parent_serializer(field):
|
||||||
"""Get the nearest parent ``Serializer`` instance for the given field.
|
"""Get the nearest parent ``Serializer`` instance for the given field.
|
||||||
|
|
||||||
@@ -160,7 +216,7 @@ def get_related_model(model, source):
|
|||||||
|
|
||||||
|
|
||||||
class RelatedFieldInspector(FieldInspector):
|
class RelatedFieldInspector(FieldInspector):
|
||||||
"""Provides conversions for ``RelatedField``\ s."""
|
"""Provides conversions for ``RelatedField``\\ s."""
|
||||||
|
|
||||||
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
||||||
SwaggerType, ChildSwaggerType = self._get_partial_types(field, swagger_object_type, use_references, **kwargs)
|
SwaggerType, ChildSwaggerType = self._get_partial_types(field, swagger_object_type, use_references, **kwargs)
|
||||||
@@ -194,10 +250,18 @@ class RelatedFieldInspector(FieldInspector):
|
|||||||
else:
|
else:
|
||||||
# if the RelatedField has no queryset (e.g. read only), try to find the target model
|
# if the RelatedField has no queryset (e.g. read only), try to find the target model
|
||||||
# from the view queryset or ModelSerializer model, if present
|
# from the view queryset or ModelSerializer model, if present
|
||||||
view_queryset = getattr(self.view, 'queryset', None)
|
parent_serializer = get_parent_serializer(field)
|
||||||
serializer_meta = getattr(get_parent_serializer(field), 'Meta', None)
|
|
||||||
this_model = getattr(view_queryset, 'model', None) or getattr(serializer_meta, 'model', None)
|
serializer_meta = getattr(parent_serializer, 'Meta', None)
|
||||||
|
this_model = getattr(serializer_meta, 'model', None)
|
||||||
|
if not this_model:
|
||||||
|
view_queryset = get_queryset_from_view(self.view, parent_serializer)
|
||||||
|
this_model = getattr(view_queryset, 'model', None)
|
||||||
|
|
||||||
source = getattr(field, 'source', '') or field.field_name
|
source = getattr(field, 'source', '') or field.field_name
|
||||||
|
if not source and isinstance(field.parent, serializers.ManyRelatedField):
|
||||||
|
source = field.parent.field_name
|
||||||
|
|
||||||
model = get_related_model(this_model, source)
|
model = get_related_model(this_model, source)
|
||||||
model_field = get_model_field(model, target_field)
|
model_field = get_model_field(model, target_field)
|
||||||
|
|
||||||
@@ -219,13 +283,22 @@ def find_regex(regex_field):
|
|||||||
regex_validator = None
|
regex_validator = None
|
||||||
for validator in regex_field.validators:
|
for validator in regex_field.validators:
|
||||||
if isinstance(validator, validators.RegexValidator):
|
if isinstance(validator, validators.RegexValidator):
|
||||||
|
if isinstance(validator, validators.URLValidator) or validator == validators.validate_ipv4_address:
|
||||||
|
# skip the default url and IP regexes because they are complex and unhelpful
|
||||||
|
# validate_ipv4_address is a RegexValidator instance in Django 1.11
|
||||||
|
continue
|
||||||
if regex_validator is not None:
|
if regex_validator is not None:
|
||||||
# bail if multiple validators are found - no obvious way to choose
|
# bail if multiple validators are found - no obvious way to choose
|
||||||
return None # pragma: no cover
|
return None # pragma: no cover
|
||||||
regex_validator = validator
|
regex_validator = validator
|
||||||
|
|
||||||
# regex_validator.regex should be a compiled re object...
|
# regex_validator.regex should be a compiled re object...
|
||||||
|
try:
|
||||||
pattern = getattr(getattr(regex_validator, 'regex', None), 'pattern', None)
|
pattern = getattr(getattr(regex_validator, 'regex', None), 'pattern', None)
|
||||||
|
except Exception: # pragma: no cover
|
||||||
|
logger.warning('failed to compile regex validator of ' + str(regex_field), exc_info=True)
|
||||||
|
return None
|
||||||
|
|
||||||
if pattern:
|
if pattern:
|
||||||
# attempt some basic cleanup to remove regex constructs not supported by JavaScript
|
# attempt some basic cleanup to remove regex constructs not supported by JavaScript
|
||||||
# -- swagger uses javascript-style regexes - see https://github.com/swagger-api/swagger-editor/issues/1601
|
# -- swagger uses javascript-style regexes - see https://github.com/swagger-api/swagger-editor/issues/1601
|
||||||
@@ -359,7 +432,7 @@ def get_basic_type_info(field):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
pattern = None
|
pattern = None
|
||||||
if swagger_type == openapi.TYPE_STRING and format in (None, openapi.FORMAT_SLUG):
|
if swagger_type == openapi.TYPE_STRING:
|
||||||
pattern = find_regex(field)
|
pattern = find_regex(field)
|
||||||
|
|
||||||
limits = find_limits(field)
|
limits = find_limits(field)
|
||||||
@@ -374,6 +447,120 @@ def get_basic_type_info(field):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def decimal_return_type():
|
||||||
|
return openapi.TYPE_STRING if rest_framework_settings.COERCE_DECIMAL_TO_STRING else openapi.TYPE_NUMBER
|
||||||
|
|
||||||
|
|
||||||
|
raw_type_info = [
|
||||||
|
(bool, (openapi.TYPE_BOOLEAN, None)),
|
||||||
|
(int, (openapi.TYPE_INTEGER, None)),
|
||||||
|
(float, (openapi.TYPE_NUMBER, None)),
|
||||||
|
(Decimal, (decimal_return_type, openapi.FORMAT_DECIMAL)),
|
||||||
|
(uuid.UUID, (openapi.TYPE_STRING, openapi.FORMAT_UUID)),
|
||||||
|
(datetime.datetime, (openapi.TYPE_STRING, openapi.FORMAT_DATETIME)),
|
||||||
|
(datetime.date, (openapi.TYPE_STRING, openapi.FORMAT_DATE)),
|
||||||
|
# TODO - support typing.List etc
|
||||||
|
]
|
||||||
|
|
||||||
|
hinting_type_info = raw_type_info
|
||||||
|
|
||||||
|
|
||||||
|
def get_basic_type_info_from_hint(hint_class):
|
||||||
|
"""Given a class (eg from a SerializerMethodField's return type hint,
|
||||||
|
return its basic type information - ``type``, ``format``, ``pattern``,
|
||||||
|
and any applicable min/max limit values.
|
||||||
|
|
||||||
|
:param hint_class: the class
|
||||||
|
:return: the extracted attributes as a dictionary, or ``None`` if the field type is not known
|
||||||
|
:rtype: OrderedDict
|
||||||
|
"""
|
||||||
|
|
||||||
|
for check_class, type_format in hinting_type_info:
|
||||||
|
if issubclass(hint_class, check_class):
|
||||||
|
swagger_type, format = type_format
|
||||||
|
if callable(swagger_type):
|
||||||
|
swagger_type = swagger_type()
|
||||||
|
# if callable(format):
|
||||||
|
# format = format(klass)
|
||||||
|
break
|
||||||
|
else: # pragma: no cover
|
||||||
|
return None
|
||||||
|
|
||||||
|
pattern = None
|
||||||
|
|
||||||
|
result = OrderedDict([
|
||||||
|
('type', swagger_type),
|
||||||
|
('format', format),
|
||||||
|
('pattern', pattern)
|
||||||
|
])
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
class SerializerMethodFieldInspector(FieldInspector):
|
||||||
|
"""Provides conversion for SerializerMethodField, optionally using information from the swagger_serializer_method
|
||||||
|
decorator.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
||||||
|
if not isinstance(field, serializers.SerializerMethodField):
|
||||||
|
return NotHandled
|
||||||
|
|
||||||
|
method = getattr(field.parent, field.method_name)
|
||||||
|
if method is None:
|
||||||
|
return NotHandled
|
||||||
|
|
||||||
|
serializer = getattr(method, "_swagger_serializer", None)
|
||||||
|
|
||||||
|
if serializer:
|
||||||
|
# attribute added by the swagger_serializer_method decorator
|
||||||
|
serializer = getattr(method, '_swagger_serializer', None)
|
||||||
|
|
||||||
|
# in order of preference for description, use:
|
||||||
|
# 1) field.help_text from SerializerMethodField(help_text)
|
||||||
|
# 2) serializer.help_text from swagger_serializer_method(serializer)
|
||||||
|
# 3) method's docstring
|
||||||
|
description = field.help_text
|
||||||
|
if description is None:
|
||||||
|
description = getattr(serializer, 'help_text', None)
|
||||||
|
if description is None:
|
||||||
|
description = method.__doc__
|
||||||
|
|
||||||
|
label = field.label
|
||||||
|
if label is None:
|
||||||
|
label = getattr(serializer, 'label', None)
|
||||||
|
|
||||||
|
if inspect.isclass(serializer):
|
||||||
|
serializer_kwargs = {
|
||||||
|
"help_text": description,
|
||||||
|
"label": label,
|
||||||
|
"read_only": True,
|
||||||
|
}
|
||||||
|
|
||||||
|
serializer = method._swagger_serializer(**serializer_kwargs)
|
||||||
|
else:
|
||||||
|
serializer.help_text = description
|
||||||
|
serializer.label = label
|
||||||
|
serializer.read_only = True
|
||||||
|
|
||||||
|
return self.probe_field_inspectors(serializer, swagger_object_type, use_references, read_only=True)
|
||||||
|
elif typing:
|
||||||
|
# look for Python 3.5+ style type hinting of the return value
|
||||||
|
hint_class = inspect.signature(method).return_annotation
|
||||||
|
|
||||||
|
if not isclass(hint_class) and hasattr(hint_class, '__args__'):
|
||||||
|
hint_class = hint_class.__args__[0]
|
||||||
|
if isclass(hint_class) and not issubclass(hint_class, inspect._empty):
|
||||||
|
type_info = get_basic_type_info_from_hint(hint_class)
|
||||||
|
|
||||||
|
if type_info is not None:
|
||||||
|
SwaggerType, ChildSwaggerType = self._get_partial_types(field, swagger_object_type,
|
||||||
|
use_references, **kwargs)
|
||||||
|
return SwaggerType(**type_info)
|
||||||
|
|
||||||
|
return NotHandled
|
||||||
|
|
||||||
|
|
||||||
class SimpleFieldInspector(FieldInspector):
|
class SimpleFieldInspector(FieldInspector):
|
||||||
"""Provides conversions for fields which can be described using just ``type``, ``format``, ``pattern``
|
"""Provides conversions for fields which can be described using just ``type``, ``format``, ``pattern``
|
||||||
and min/max validators.
|
and min/max validators.
|
||||||
@@ -422,7 +609,7 @@ class ChoiceFieldInspector(FieldInspector):
|
|||||||
|
|
||||||
|
|
||||||
class FileFieldInspector(FieldInspector):
|
class FileFieldInspector(FieldInspector):
|
||||||
"""Provides conversions for ``FileField``\ s."""
|
"""Provides conversions for ``FileField``\\ s."""
|
||||||
|
|
||||||
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
||||||
SwaggerType, ChildSwaggerType = self._get_partial_types(field, swagger_object_type, use_references, **kwargs)
|
SwaggerType, ChildSwaggerType = self._get_partial_types(field, swagger_object_type, use_references, **kwargs)
|
||||||
@@ -527,21 +714,22 @@ else:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
from rest_framework_recursive.fields import RecursiveField
|
from rest_framework_recursive.fields import RecursiveField
|
||||||
except ImportError:
|
except ImportError: # pragma: no cover
|
||||||
class RecursiveFieldInspector(FieldInspector):
|
class RecursiveFieldInspector(FieldInspector):
|
||||||
"""Provides conversion for RecursiveField (https://github.com/heywbj/django-rest-framework-recursive)"""
|
"""Provides conversion for RecursiveField (https://github.com/heywbj/django-rest-framework-recursive)"""
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
class RecursiveFieldInspector(FieldInspector):
|
class RecursiveFieldInspector(FieldInspector):
|
||||||
"""Provides conversion for RecursiveField (https://github.com/heywbj/django-rest-framework-recursive)"""
|
"""Provides conversion for RecursiveField (https://github.com/heywbj/django-rest-framework-recursive)"""
|
||||||
|
|
||||||
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
def field_to_swagger_object(self, field, swagger_object_type, use_references, **kwargs):
|
||||||
if isinstance(field, RecursiveField) and swagger_object_type == openapi.Schema:
|
if isinstance(field, RecursiveField) and swagger_object_type == openapi.Schema:
|
||||||
assert use_references is True, "Can not create schema for RecursiveField when use_references is False"
|
assert use_references is True, "Can not create schema for RecursiveField when use_references is False"
|
||||||
|
|
||||||
ref_name = get_serializer_ref_name(field.proxied)
|
ref_name = get_serializer_ref_name(field.proxied)
|
||||||
assert ref_name is not None, "Can not create RecursiveField schema for inline ModelSerializer"
|
assert ref_name is not None, "Can't create RecursiveField schema for inline " + str(type(field.proxied))
|
||||||
|
|
||||||
return openapi.SchemaRef(self.components.with_scope(openapi.SCHEMA_DEFINITIONS), ref_name,
|
definitions = self.components.with_scope(openapi.SCHEMA_DEFINITIONS)
|
||||||
ignore_unresolved=True)
|
return openapi.SchemaRef(definitions, ref_name, ignore_unresolved=True)
|
||||||
|
|
||||||
return NotHandled
|
return NotHandled
|
||||||
@@ -4,11 +4,12 @@ import coreschema
|
|||||||
from rest_framework.pagination import CursorPagination, LimitOffsetPagination, PageNumberPagination
|
from rest_framework.pagination import CursorPagination, LimitOffsetPagination, PageNumberPagination
|
||||||
|
|
||||||
from .. import openapi
|
from .. import openapi
|
||||||
|
from ..utils import force_real_str
|
||||||
from .base import FilterInspector, PaginatorInspector
|
from .base import FilterInspector, PaginatorInspector
|
||||||
|
|
||||||
|
|
||||||
class CoreAPICompatInspector(PaginatorInspector, FilterInspector):
|
class CoreAPICompatInspector(PaginatorInspector, FilterInspector):
|
||||||
"""Converts ``coreapi.Field``\ s to :class:`.openapi.Parameter`\ s for filters and paginators that implement a
|
"""Converts ``coreapi.Field``\\ s to :class:`.openapi.Parameter`\\ s for filters and paginators that implement a
|
||||||
``get_schema_fields`` method.
|
``get_schema_fields`` method.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ class CoreAPICompatInspector(PaginatorInspector, FilterInspector):
|
|||||||
in_=location_to_in[field.location],
|
in_=location_to_in[field.location],
|
||||||
type=coreapi_types.get(type(field.schema), openapi.TYPE_STRING),
|
type=coreapi_types.get(type(field.schema), openapi.TYPE_STRING),
|
||||||
required=field.required,
|
required=field.required,
|
||||||
description=field.schema.description,
|
description=force_real_str(field.schema.description) if field.schema else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -70,7 +71,10 @@ class DjangoRestResponsePagination(PaginatorInspector):
|
|||||||
('previous', openapi.Schema(type=openapi.TYPE_STRING, format=openapi.FORMAT_URI)),
|
('previous', openapi.Schema(type=openapi.TYPE_STRING, format=openapi.FORMAT_URI)),
|
||||||
('results', response_schema),
|
('results', response_schema),
|
||||||
)),
|
)),
|
||||||
required=['count', 'results']
|
required=['results']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if has_count:
|
||||||
|
paged_schema.required.insert(0, 'count')
|
||||||
|
|
||||||
return paged_schema
|
return paged_schema
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import logging
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from rest_framework.request import is_form_media_type
|
from rest_framework.request import is_form_media_type
|
||||||
@@ -7,11 +8,13 @@ from rest_framework.status import is_success
|
|||||||
from .. import openapi
|
from .. import openapi
|
||||||
from ..errors import SwaggerGenerationError
|
from ..errors import SwaggerGenerationError
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
force_serializer_instance, get_consumes, get_produces, guess_response_status, is_list_view, no_body,
|
force_real_str, force_serializer_instance, get_consumes, get_produces, guess_response_status, is_list_view,
|
||||||
param_list_to_odict
|
merge_params, no_body, param_list_to_odict
|
||||||
)
|
)
|
||||||
from .base import ViewInspector
|
from .base import ViewInspector
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SwaggerAutoSchema(ViewInspector):
|
class SwaggerAutoSchema(ViewInspector):
|
||||||
def __init__(self, view, path, method, components, request, overrides):
|
def __init__(self, view, path, method, components, request, overrides):
|
||||||
@@ -31,21 +34,25 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
|
|
||||||
operation_id = self.get_operation_id(operation_keys)
|
operation_id = self.get_operation_id(operation_keys)
|
||||||
description = self.get_description()
|
description = self.get_description()
|
||||||
|
summary = self.get_summary()
|
||||||
security = self.get_security()
|
security = self.get_security()
|
||||||
assert security is None or isinstance(security, list), "security must be a list of securiy requirement objects"
|
assert security is None or isinstance(security, list), "security must be a list of securiy requirement objects"
|
||||||
|
deprecated = self.is_deprecated()
|
||||||
tags = self.get_tags(operation_keys)
|
tags = self.get_tags(operation_keys)
|
||||||
|
|
||||||
responses = self.get_responses()
|
responses = self.get_responses()
|
||||||
|
|
||||||
return openapi.Operation(
|
return openapi.Operation(
|
||||||
operation_id=operation_id,
|
operation_id=operation_id,
|
||||||
description=description,
|
description=force_real_str(description),
|
||||||
|
summary=force_real_str(summary),
|
||||||
responses=responses,
|
responses=responses,
|
||||||
parameters=parameters,
|
parameters=parameters,
|
||||||
consumes=consumes,
|
consumes=consumes,
|
||||||
produces=produces,
|
produces=produces,
|
||||||
tags=tags,
|
tags=tags,
|
||||||
security=security
|
security=security,
|
||||||
|
deprecated=deprecated
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_request_body_parameters(self, consumes):
|
def get_request_body_parameters(self, consumes):
|
||||||
@@ -56,7 +63,7 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
- a list of primitive Parameters parsed as form data
|
- a list of primitive Parameters parsed as form data
|
||||||
|
|
||||||
:param list[str] consumes: a list of accepted MIME types as returned by :meth:`.get_consumes`
|
:param list[str] consumes: a list of accepted MIME types as returned by :meth:`.get_consumes`
|
||||||
:return: a (potentially empty) list of :class:`.Parameter`\ s either ``in: body`` or ``in: formData``
|
:return: a (potentially empty) list of :class:`.Parameter`\\ s either ``in: body`` or ``in: formData``
|
||||||
:rtype: list[openapi.Parameter]
|
:rtype: list[openapi.Parameter]
|
||||||
"""
|
"""
|
||||||
serializer = self.get_request_serializer()
|
serializer = self.get_request_serializer()
|
||||||
@@ -83,31 +90,49 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
"""
|
"""
|
||||||
if not hasattr(self.view, 'get_serializer'):
|
if not hasattr(self.view, 'get_serializer'):
|
||||||
return None
|
return None
|
||||||
|
try:
|
||||||
return self.view.get_serializer()
|
return self.view.get_serializer()
|
||||||
|
except Exception:
|
||||||
|
log.warning("view's get_serializer raised exception (%s %s %s)",
|
||||||
|
self.method, self.path, type(self.view).__name__, exc_info=True)
|
||||||
|
return None
|
||||||
|
|
||||||
def get_request_serializer(self):
|
def _get_request_body_override(self):
|
||||||
"""Return the request serializer (used for parsing the request payload) for this endpoint.
|
"""Parse the request_body key in the override dict. This method is not public API.
|
||||||
|
|
||||||
:return: the request serializer, or one of :class:`.Schema`, :class:`.SchemaRef`, ``None``
|
:return:
|
||||||
"""
|
"""
|
||||||
body_override = self.overrides.get('request_body', None)
|
body_override = self.overrides.get('request_body', None)
|
||||||
|
|
||||||
if body_override is not None:
|
if body_override is not None:
|
||||||
if body_override is no_body:
|
if body_override is no_body:
|
||||||
return None
|
return no_body
|
||||||
if self.method not in self.body_methods:
|
if self.method not in self.body_methods:
|
||||||
raise SwaggerGenerationError("request_body can only be applied to (" + ','.join(self.body_methods) +
|
raise SwaggerGenerationError("request_body can only be applied to (" + ','.join(self.body_methods) +
|
||||||
"); are you looking for query_serializer or manual_parameters?")
|
"); are you looking for query_serializer or manual_parameters?")
|
||||||
if isinstance(body_override, openapi.Schema.OR_REF):
|
if isinstance(body_override, openapi.Schema.OR_REF):
|
||||||
return body_override
|
return body_override
|
||||||
return force_serializer_instance(body_override)
|
return force_serializer_instance(body_override)
|
||||||
elif self.method in self.body_methods:
|
|
||||||
|
return body_override
|
||||||
|
|
||||||
|
def get_request_serializer(self):
|
||||||
|
"""Return the request serializer (used for parsing the request payload) for this endpoint.
|
||||||
|
|
||||||
|
:return: the request serializer, or one of :class:`.Schema`, :class:`.SchemaRef`, ``None``
|
||||||
|
"""
|
||||||
|
body_override = self._get_request_body_override()
|
||||||
|
|
||||||
|
if body_override is None and self.method in self.implicit_body_methods:
|
||||||
return self.get_view_serializer()
|
return self.get_view_serializer()
|
||||||
|
|
||||||
|
if body_override is no_body:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
return body_override
|
||||||
|
|
||||||
def get_request_form_parameters(self, serializer):
|
def get_request_form_parameters(self, serializer):
|
||||||
"""Given a Serializer, return a list of ``in: formData`` :class:`.Parameter`\ s.
|
"""Given a Serializer, return a list of ``in: formData`` :class:`.Parameter`\\ s.
|
||||||
|
|
||||||
:param serializer: the view's request serializer as returned by :meth:`.get_request_serializer`
|
:param serializer: the view's request serializer as returned by :meth:`.get_request_serializer`
|
||||||
:rtype: list[openapi.Parameter]
|
:rtype: list[openapi.Parameter]
|
||||||
@@ -137,18 +162,19 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
:return: modified parameters
|
:return: modified parameters
|
||||||
:rtype: list[openapi.Parameter]
|
:rtype: list[openapi.Parameter]
|
||||||
"""
|
"""
|
||||||
parameters = param_list_to_odict(parameters)
|
|
||||||
manual_parameters = self.overrides.get('manual_parameters', None) or []
|
manual_parameters = self.overrides.get('manual_parameters', None) or []
|
||||||
|
|
||||||
if any(param.in_ == openapi.IN_BODY for param in manual_parameters): # pragma: no cover
|
if any(param.in_ == openapi.IN_BODY for param in manual_parameters): # pragma: no cover
|
||||||
raise SwaggerGenerationError("specify the body parameter as a Schema or Serializer in request_body")
|
raise SwaggerGenerationError("specify the body parameter as a Schema or Serializer in request_body")
|
||||||
if any(param.in_ == openapi.IN_FORM for param in manual_parameters): # pragma: no cover
|
if any(param.in_ == openapi.IN_FORM for param in manual_parameters): # pragma: no cover
|
||||||
if any(param.in_ == openapi.IN_BODY for param in parameters.values()):
|
if any(param.in_ == openapi.IN_BODY for param in parameters):
|
||||||
raise SwaggerGenerationError("cannot add form parameters when the request has a request schema; "
|
raise SwaggerGenerationError("cannot add form parameters when the request has a request body; "
|
||||||
"did you forget to set an appropriate parser class on the view?")
|
"did you forget to set an appropriate parser class on the view?")
|
||||||
|
if self.method not in self.body_methods:
|
||||||
|
raise SwaggerGenerationError("form parameters can only be applied to (" + ','.join(self.body_methods) +
|
||||||
|
") HTTP methods")
|
||||||
|
|
||||||
parameters.update(param_list_to_odict(manual_parameters))
|
return merge_params(parameters, manual_parameters)
|
||||||
return list(parameters.values())
|
|
||||||
|
|
||||||
def get_responses(self):
|
def get_responses(self):
|
||||||
"""Get the possible responses for this view as a swagger :class:`.Responses` object.
|
"""Get the possible responses for this view as a swagger :class:`.Responses` object.
|
||||||
@@ -161,6 +187,18 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
responses=self.get_response_schemas(response_serializers)
|
responses=self.get_response_schemas(response_serializers)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_default_response_serializer(self):
|
||||||
|
"""Return the default response serializer for this endpoint. This is derived from either the ``request_body``
|
||||||
|
override or the request serializer (:meth:`.get_view_serializer`).
|
||||||
|
|
||||||
|
:return: response serializer, :class:`.Schema`, :class:`.SchemaRef`, ``None``
|
||||||
|
"""
|
||||||
|
body_override = self._get_request_body_override()
|
||||||
|
if body_override and body_override is not no_body:
|
||||||
|
return body_override
|
||||||
|
|
||||||
|
return self.get_view_serializer()
|
||||||
|
|
||||||
def get_default_responses(self):
|
def get_default_responses(self):
|
||||||
"""Get the default responses determined for this view from the request serializer and request method.
|
"""Get the default responses determined for this view from the request serializer and request method.
|
||||||
|
|
||||||
@@ -171,11 +209,9 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
default_status = guess_response_status(method)
|
default_status = guess_response_status(method)
|
||||||
default_schema = ''
|
default_schema = ''
|
||||||
if method in ('get', 'post', 'put', 'patch'):
|
if method in ('get', 'post', 'put', 'patch'):
|
||||||
default_schema = self.get_request_serializer() or self.get_view_serializer()
|
default_schema = self.get_default_response_serializer()
|
||||||
|
|
||||||
default_schema = default_schema or ''
|
default_schema = default_schema or ''
|
||||||
if any(is_form_media_type(encoding) for encoding in self.get_consumes()):
|
|
||||||
default_schema = ''
|
|
||||||
if default_schema and not isinstance(default_schema, openapi.Schema):
|
if default_schema and not isinstance(default_schema, openapi.Schema):
|
||||||
default_schema = self.serializer_to_schema(default_schema) or ''
|
default_schema = self.serializer_to_schema(default_schema) or ''
|
||||||
|
|
||||||
@@ -190,7 +226,7 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
def get_response_serializers(self):
|
def get_response_serializers(self):
|
||||||
"""Return the response codes that this view is expected to return, and the serializer for each response body.
|
"""Return the response codes that this view is expected to return, and the serializer for each response body.
|
||||||
The return value should be a dict where the keys are possible status codes, and values are either strings,
|
The return value should be a dict where the keys are possible status codes, and values are either strings,
|
||||||
``Serializer``\ s, :class:`.Schema`, :class:`.SchemaRef` or :class:`.Response` objects. See
|
``Serializer``\\ s, :class:`.Schema`, :class:`.SchemaRef` or :class:`.Response` objects. See
|
||||||
:func:`@swagger_auto_schema <.swagger_auto_schema>` for more details.
|
:func:`@swagger_auto_schema <.swagger_auto_schema>` for more details.
|
||||||
|
|
||||||
:return: the response serializers
|
:return: the response serializers
|
||||||
@@ -217,8 +253,10 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
for sc, serializer in response_serializers.items():
|
for sc, serializer in response_serializers.items():
|
||||||
if isinstance(serializer, str):
|
if isinstance(serializer, str):
|
||||||
response = openapi.Response(
|
response = openapi.Response(
|
||||||
description=serializer
|
description=force_real_str(serializer)
|
||||||
)
|
)
|
||||||
|
elif not serializer:
|
||||||
|
continue
|
||||||
elif isinstance(serializer, openapi.Response):
|
elif isinstance(serializer, openapi.Response):
|
||||||
response = serializer
|
response = serializer
|
||||||
if hasattr(response, 'schema') and not isinstance(response.schema, openapi.Schema.OR_REF):
|
if hasattr(response, 'schema') and not isinstance(response.schema, openapi.Schema.OR_REF):
|
||||||
@@ -283,16 +321,40 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
operation_id = '_'.join(operation_keys)
|
operation_id = '_'.join(operation_keys)
|
||||||
return operation_id
|
return operation_id
|
||||||
|
|
||||||
|
def _extract_description_and_summary(self):
|
||||||
|
description = self.overrides.get('operation_description', None)
|
||||||
|
summary = self.overrides.get('operation_summary', None)
|
||||||
|
if description is None:
|
||||||
|
description = self._sch.get_description(self.path, self.method) or ''
|
||||||
|
description = description.strip().replace('\r', '')
|
||||||
|
|
||||||
|
if description and (summary is None):
|
||||||
|
# description from docstring ... do summary magic
|
||||||
|
# https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings
|
||||||
|
summary_max_len = 120 # OpenAPI 2.0 spec says summary should be under 120 characters
|
||||||
|
sections = description.split('\n\n', 1)
|
||||||
|
if len(sections) == 2:
|
||||||
|
sections[0] = sections[0].strip()
|
||||||
|
if len(sections[0]) < summary_max_len:
|
||||||
|
summary, description = sections
|
||||||
|
|
||||||
|
return description, summary
|
||||||
|
|
||||||
def get_description(self):
|
def get_description(self):
|
||||||
"""Return an operation description determined as appropriate from the view's method and class docstrings.
|
"""Return an operation description determined as appropriate from the view's method and class docstrings.
|
||||||
|
|
||||||
:return: the operation description
|
:return: the operation description
|
||||||
:rtype: str
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
description = self.overrides.get('operation_description', None)
|
return self._extract_description_and_summary()[0]
|
||||||
if description is None:
|
|
||||||
description = self._sch.get_description(self.path, self.method)
|
def get_summary(self):
|
||||||
return description
|
"""Return a summary description for this operation.
|
||||||
|
|
||||||
|
:return: the summary
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
return self._extract_description_and_summary()[1]
|
||||||
|
|
||||||
def get_security(self):
|
def get_security(self):
|
||||||
"""Return a list of security requirements for this operation.
|
"""Return a list of security requirements for this operation.
|
||||||
@@ -304,6 +366,14 @@ class SwaggerAutoSchema(ViewInspector):
|
|||||||
:rtype: list[dict[str,list[str]]]"""
|
:rtype: list[dict[str,list[str]]]"""
|
||||||
return self.overrides.get('security', None)
|
return self.overrides.get('security', None)
|
||||||
|
|
||||||
|
def is_deprecated(self):
|
||||||
|
"""Return ``True`` if this operation is to be marked as deprecated.
|
||||||
|
|
||||||
|
:return: deprecation status
|
||||||
|
:rtype: bool
|
||||||
|
"""
|
||||||
|
return self.overrides.get('deprecated', None)
|
||||||
|
|
||||||
def get_tags(self, operation_keys):
|
def get_tags(self, operation_keys):
|
||||||
"""Get a list of tags for this operation. Tags determine how operations relate with each other, and in the UI
|
"""Get a list of tags for this operation. Tags determine how operations relate with each other, and in the UI
|
||||||
each tag will show as a group containing the operations that use it.
|
each tag will show as a group containing the operations that use it.
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth import get_user_model
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from rest_framework.test import APIRequestFactory, force_authenticate
|
from rest_framework.test import APIRequestFactory, force_authenticate
|
||||||
@@ -12,7 +13,15 @@ from rest_framework.views import APIView
|
|||||||
from ... import openapi
|
from ... import openapi
|
||||||
from ...app_settings import swagger_settings
|
from ...app_settings import swagger_settings
|
||||||
from ...codecs import OpenAPICodecJson, OpenAPICodecYaml
|
from ...codecs import OpenAPICodecJson, OpenAPICodecYaml
|
||||||
from ...generators import OpenAPISchemaGenerator
|
|
||||||
|
|
||||||
|
def import_class(import_string):
|
||||||
|
if not import_string:
|
||||||
|
return None
|
||||||
|
|
||||||
|
module_path, class_name = import_string.rsplit('.', 1)
|
||||||
|
module = import_module(module_path)
|
||||||
|
return getattr(module, class_name)
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@@ -50,9 +59,13 @@ class Command(BaseCommand):
|
|||||||
help='Use a mock request when generating the swagger schema. This is useful if your views or serializers'
|
help='Use a mock request when generating the swagger schema. This is useful if your views or serializers'
|
||||||
'depend on context from a request in order to function.'
|
'depend on context from a request in order to function.'
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--api-version', dest='api_version',
|
||||||
|
type=str,
|
||||||
|
help='Version to use to generate schema. This option implies --mock-request.'
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--user', dest='user',
|
'--user', dest='user',
|
||||||
default='',
|
|
||||||
help='Username of an existing user to use for mocked authentication. This option implies --mock-request.'
|
help='Username of an existing user to use for mocked authentication. This option implies --mock-request.'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@@ -64,6 +77,11 @@ class Command(BaseCommand):
|
|||||||
'OpenAPISchemaGenerator.get_schema().\n'
|
'OpenAPISchemaGenerator.get_schema().\n'
|
||||||
'This option implies --mock-request.'
|
'This option implies --mock-request.'
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'-g', '--generator-class', dest='generator_class_name',
|
||||||
|
default='',
|
||||||
|
help='Import string pointing to an OpenAPISchemaGenerator subclass to use for schema generation.'
|
||||||
|
)
|
||||||
|
|
||||||
def write_schema(self, schema, stream, format):
|
def write_schema(self, schema, stream, format):
|
||||||
if format == 'json':
|
if format == 'json':
|
||||||
@@ -89,7 +107,8 @@ class Command(BaseCommand):
|
|||||||
request = APIView().initialize_request(request)
|
request = APIView().initialize_request(request)
|
||||||
return request
|
return request
|
||||||
|
|
||||||
def handle(self, output_file, overwrite, format, api_url, mock, user, private, *args, **options):
|
def handle(self, output_file, overwrite, format, api_url, mock, api_version, user, private, generator_class_name,
|
||||||
|
*args, **kwargs):
|
||||||
# disable logs of WARNING and below
|
# disable logs of WARNING and below
|
||||||
logging.disable(logging.WARNING)
|
logging.disable(logging.WARNING)
|
||||||
|
|
||||||
@@ -107,19 +126,30 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
api_url = api_url or swagger_settings.DEFAULT_API_URL
|
api_url = api_url or swagger_settings.DEFAULT_API_URL
|
||||||
|
|
||||||
user = User.objects.get(username=user) if user else None
|
if user:
|
||||||
mock = mock or private or (user is not None)
|
# Only call get_user_model if --user was passed in order to
|
||||||
|
# avoid crashing if auth is not configured in the project
|
||||||
|
user = get_user_model().objects.get(username=user)
|
||||||
|
|
||||||
|
mock = mock or private or (user is not None) or (api_version is not None)
|
||||||
if mock and not api_url:
|
if mock and not api_url:
|
||||||
raise ImproperlyConfigured(
|
raise ImproperlyConfigured(
|
||||||
'--mock-request requires an API url; either provide '
|
'--mock-request requires an API url; either provide '
|
||||||
'the --url argument or set the DEFAULT_API_URL setting'
|
'the --url argument or set the DEFAULT_API_URL setting'
|
||||||
)
|
)
|
||||||
|
|
||||||
request = self.get_mock_request(api_url, format, user) if mock else None
|
request = None
|
||||||
|
if mock:
|
||||||
|
request = self.get_mock_request(api_url, format, user)
|
||||||
|
|
||||||
generator = OpenAPISchemaGenerator(
|
if request and api_version:
|
||||||
|
request.version = api_version
|
||||||
|
|
||||||
|
generator_class = import_class(generator_class_name) or swagger_settings.DEFAULT_GENERATOR_CLASS
|
||||||
|
generator = generator_class(
|
||||||
info=info,
|
info=info,
|
||||||
url=api_url
|
version=api_version,
|
||||||
|
url=api_url,
|
||||||
)
|
)
|
||||||
schema = generator.get_schema(request=request, public=not private)
|
schema = generator.get_schema(request=request, public=not private)
|
||||||
|
|
||||||
|
|||||||
+35
-7
@@ -1,3 +1,4 @@
|
|||||||
|
import logging
|
||||||
import re
|
import re
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
@@ -7,6 +8,8 @@ from inflection import camelize
|
|||||||
|
|
||||||
from .utils import filter_none
|
from .utils import filter_none
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
TYPE_OBJECT = "object" #:
|
TYPE_OBJECT = "object" #:
|
||||||
TYPE_STRING = "string" #:
|
TYPE_STRING = "string" #:
|
||||||
TYPE_NUMBER = "number" #:
|
TYPE_NUMBER = "number" #:
|
||||||
@@ -288,6 +291,8 @@ class Paths(SwaggerDict):
|
|||||||
|
|
||||||
|
|
||||||
class PathItem(SwaggerDict):
|
class PathItem(SwaggerDict):
|
||||||
|
OPERATION_NAMES = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch']
|
||||||
|
|
||||||
def __init__(self, get=None, put=None, post=None, delete=None, options=None,
|
def __init__(self, get=None, put=None, post=None, delete=None, options=None,
|
||||||
head=None, patch=None, parameters=None, **extra):
|
head=None, patch=None, parameters=None, **extra):
|
||||||
"""Information about a single path
|
"""Information about a single path
|
||||||
@@ -312,6 +317,15 @@ class PathItem(SwaggerDict):
|
|||||||
self.parameters = filter_none(parameters)
|
self.parameters = filter_none(parameters)
|
||||||
self._insert_extras__()
|
self._insert_extras__()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def operations(self):
|
||||||
|
"""A list of all standard Operations on this PathItem object. See :attr:`.OPERATION_NAMES`.
|
||||||
|
|
||||||
|
:return: list of (method name, Operation) tuples
|
||||||
|
:rtype: list[tuple[str,Operation]]
|
||||||
|
"""
|
||||||
|
return [(k, v) for k, v in self.items() if k in PathItem.OPERATION_NAMES and v]
|
||||||
|
|
||||||
|
|
||||||
class Operation(SwaggerDict):
|
class Operation(SwaggerDict):
|
||||||
def __init__(self, operation_id, responses, parameters=None, consumes=None, produces=None, summary=None,
|
def __init__(self, operation_id, responses, parameters=None, consumes=None, produces=None, summary=None,
|
||||||
@@ -384,8 +398,6 @@ class Parameter(SwaggerDict):
|
|||||||
:param default: default value if the parameter is not provided; must conform to parameter type
|
:param default: default value if the parameter is not provided; must conform to parameter type
|
||||||
"""
|
"""
|
||||||
super(Parameter, self).__init__(**extra)
|
super(Parameter, self).__init__(**extra)
|
||||||
if (not schema and not type) or (schema and type):
|
|
||||||
raise AssertionError("either schema or type are required for Parameter object!")
|
|
||||||
self.name = name
|
self.name = name
|
||||||
self.in_ = in_
|
self.in_ = in_
|
||||||
self.description = description
|
self.description = description
|
||||||
@@ -398,6 +410,10 @@ class Parameter(SwaggerDict):
|
|||||||
self.items = items
|
self.items = items
|
||||||
self.default = default
|
self.default = default
|
||||||
self._insert_extras__()
|
self._insert_extras__()
|
||||||
|
if (not schema and not type) or (schema and type):
|
||||||
|
raise AssertionError("either schema or type are required for Parameter object (not both)!")
|
||||||
|
if schema and isinstance(schema, Schema):
|
||||||
|
schema._remove_read_only()
|
||||||
if self['in'] == IN_PATH:
|
if self['in'] == IN_PATH:
|
||||||
# path parameters must always be required
|
# path parameters must always be required
|
||||||
assert required is not False, "path parameter cannot be optional"
|
assert required is not False, "path parameter cannot be optional"
|
||||||
@@ -429,9 +445,9 @@ class Schema(SwaggerDict):
|
|||||||
:param bool,.Schema,.SchemaRef additional_properties: allow wildcard properties not listed in `properties`
|
:param bool,.Schema,.SchemaRef additional_properties: allow wildcard properties not listed in `properties`
|
||||||
:param list[str] required: list of requried property names
|
:param list[str] required: list of requried property names
|
||||||
:param .Schema,.SchemaRef items: type of array items, only valid if `type` is ``array``
|
:param .Schema,.SchemaRef items: type of array items, only valid if `type` is ``array``
|
||||||
:param default: only valid when insider another ``Schema``\ 's ``properties``;
|
:param default: only valid when insider another ``Schema``\\ 's ``properties``;
|
||||||
the default value of this property if it is not provided, must conform to the type of this Schema
|
the default value of this property if it is not provided, must conform to the type of this Schema
|
||||||
:param read_only: only valid when insider another ``Schema``\ 's ``properties``;
|
:param read_only: only valid when insider another ``Schema``\\ 's ``properties``;
|
||||||
declares the property as read only - it must only be sent as part of responses, never in requests
|
declares the property as read only - it must only be sent as part of responses, never in requests
|
||||||
"""
|
"""
|
||||||
super(Schema, self).__init__(**extra)
|
super(Schema, self).__init__(**extra)
|
||||||
@@ -462,6 +478,11 @@ class Schema(SwaggerDict):
|
|||||||
if pattern and type != TYPE_STRING:
|
if pattern and type != TYPE_STRING:
|
||||||
raise AssertionError("pattern can only be used when type is string")
|
raise AssertionError("pattern can only be used when type is string")
|
||||||
|
|
||||||
|
def _remove_read_only(self):
|
||||||
|
# readOnly is only valid for Schemas inside another Schema's properties;
|
||||||
|
# when placing Schema elsewhere we must take care to remove the readOnly flag
|
||||||
|
self.pop('readOnly', '')
|
||||||
|
|
||||||
|
|
||||||
class _Ref(SwaggerDict):
|
class _Ref(SwaggerDict):
|
||||||
ref_name_re = re.compile(r"#/(?P<scope>.+)/(?P<name>[^/]+)$")
|
ref_name_re = re.compile(r"#/(?P<scope>.+)/(?P<name>[^/]+)$")
|
||||||
@@ -494,12 +515,12 @@ class _Ref(SwaggerDict):
|
|||||||
ref_match = self.ref_name_re.match(self.ref)
|
ref_match = self.ref_name_re.match(self.ref)
|
||||||
return resolver.get(ref_match.group('name'), scope=ref_match.group('scope'))
|
return resolver.get(ref_match.group('name'), scope=ref_match.group('scope'))
|
||||||
|
|
||||||
def __setitem__(self, key, value, **kwargs):
|
def __setitem__(self, key, value):
|
||||||
if key == "$ref":
|
if key == "$ref":
|
||||||
return super(_Ref, self).__setitem__(key, value, **kwargs)
|
return super(_Ref, self).__setitem__(key, value)
|
||||||
raise NotImplementedError("only $ref can be set on Reference objects (not %s)" % key)
|
raise NotImplementedError("only $ref can be set on Reference objects (not %s)" % key)
|
||||||
|
|
||||||
def __delitem__(self, key, **kwargs):
|
def __delitem__(self, key):
|
||||||
raise NotImplementedError("cannot delete property of Reference object")
|
raise NotImplementedError("cannot delete property of Reference object")
|
||||||
|
|
||||||
|
|
||||||
@@ -557,6 +578,8 @@ class Response(SwaggerDict):
|
|||||||
self.schema = schema
|
self.schema = schema
|
||||||
self.examples = examples
|
self.examples = examples
|
||||||
self._insert_extras__()
|
self._insert_extras__()
|
||||||
|
if schema and isinstance(schema, Schema):
|
||||||
|
schema._remove_read_only()
|
||||||
|
|
||||||
|
|
||||||
class ReferenceResolver(object):
|
class ReferenceResolver(object):
|
||||||
@@ -628,8 +651,13 @@ class ReferenceResolver(object):
|
|||||||
ret = self.getdefault(name, None, scope)
|
ret = self.getdefault(name, None, scope)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
ret = maker()
|
ret = maker()
|
||||||
|
value = self.getdefault(name, None, scope)
|
||||||
assert ret is not None, "maker returned None; referenced objects cannot be None/null"
|
assert ret is not None, "maker returned None; referenced objects cannot be None/null"
|
||||||
|
if value is None:
|
||||||
self.set(name, ret, scope)
|
self.set(name, ret, scope)
|
||||||
|
elif value != ret:
|
||||||
|
logger.debug("during setdefault, maker for %s inserted a value and returned a different value", name)
|
||||||
|
ret = value
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
+83
-43
@@ -1,16 +1,19 @@
|
|||||||
from django.shortcuts import render, resolve_url
|
import six
|
||||||
from rest_framework.renderers import BaseRenderer, TemplateHTMLRenderer
|
|
||||||
from rest_framework.utils import json
|
|
||||||
|
|
||||||
from drf_yasg.openapi import Swagger
|
from django.shortcuts import render, resolve_url
|
||||||
|
from django.utils.functional import Promise
|
||||||
|
from rest_framework.renderers import BaseRenderer, JSONRenderer, TemplateHTMLRenderer
|
||||||
|
from rest_framework.utils import json
|
||||||
|
|
||||||
from .app_settings import redoc_settings, swagger_settings
|
from .app_settings import redoc_settings, swagger_settings
|
||||||
from .codecs import VALIDATORS, OpenAPICodecJson, OpenAPICodecYaml
|
from .codecs import VALIDATORS, OpenAPICodecJson, OpenAPICodecYaml
|
||||||
|
from .openapi import Swagger
|
||||||
|
from .utils import filter_none
|
||||||
|
|
||||||
|
|
||||||
class _SpecRenderer(BaseRenderer):
|
class _SpecRenderer(BaseRenderer):
|
||||||
"""Base class for text renderers. Handles encoding and validation."""
|
"""Base class for text renderers. Handles encoding and validation."""
|
||||||
charset = None
|
charset = 'utf-8'
|
||||||
validators = []
|
validators = []
|
||||||
codec_class = None
|
codec_class = None
|
||||||
|
|
||||||
@@ -22,6 +25,12 @@ class _SpecRenderer(BaseRenderer):
|
|||||||
def render(self, data, media_type=None, renderer_context=None):
|
def render(self, data, media_type=None, renderer_context=None):
|
||||||
assert self.codec_class, "must override codec_class"
|
assert self.codec_class, "must override codec_class"
|
||||||
codec = self.codec_class(self.validators)
|
codec = self.codec_class(self.validators)
|
||||||
|
|
||||||
|
if not isinstance(data, Swagger): # pragma: no cover
|
||||||
|
# if `swagger` is not a ``Swagger`` object, it means we somehow got a non-success ``Response``
|
||||||
|
# in that case, it's probably better to let the default ``TemplateHTMLRenderer`` render it
|
||||||
|
# see https://github.com/axnsan12/drf-yasg/issues/58
|
||||||
|
return JSONRenderer().render(data, media_type, renderer_context)
|
||||||
return codec.encode(data)
|
return codec.encode(data)
|
||||||
|
|
||||||
|
|
||||||
@@ -53,7 +62,7 @@ class _UIRenderer(BaseRenderer):
|
|||||||
template = ''
|
template = ''
|
||||||
|
|
||||||
def render(self, swagger, accepted_media_type=None, renderer_context=None):
|
def render(self, swagger, accepted_media_type=None, renderer_context=None):
|
||||||
if not isinstance(swagger, Swagger):
|
if not isinstance(swagger, Swagger): # pragma: no cover
|
||||||
# if `swagger` is not a ``Swagger`` object, it means we somehow got a non-success ``Response``
|
# if `swagger` is not a ``Swagger`` object, it means we somehow got a non-success ``Response``
|
||||||
# in that case, it's probably better to let the default ``TemplateHTMLRenderer`` render it
|
# in that case, it's probably better to let the default ``TemplateHTMLRenderer`` render it
|
||||||
# see https://github.com/axnsan12/drf-yasg/issues/58
|
# see https://github.com/axnsan12/drf-yasg/issues/58
|
||||||
@@ -68,23 +77,55 @@ class _UIRenderer(BaseRenderer):
|
|||||||
def set_context(self, renderer_context, swagger):
|
def set_context(self, renderer_context, swagger):
|
||||||
renderer_context['title'] = swagger.info.title
|
renderer_context['title'] = swagger.info.title
|
||||||
renderer_context['version'] = swagger.info.version
|
renderer_context['version'] = swagger.info.version
|
||||||
renderer_context['swagger_settings'] = json.dumps(self.get_swagger_ui_settings())
|
|
||||||
renderer_context['redoc_settings'] = json.dumps(self.get_redoc_settings())
|
|
||||||
renderer_context['oauth2_config'] = json.dumps(self.get_oauth2_config())
|
renderer_context['oauth2_config'] = json.dumps(self.get_oauth2_config())
|
||||||
renderer_context['USE_SESSION_AUTH'] = swagger_settings.USE_SESSION_AUTH
|
renderer_context['USE_SESSION_AUTH'] = swagger_settings.USE_SESSION_AUTH
|
||||||
renderer_context.update(self.get_auth_urls())
|
renderer_context.update(self.get_auth_urls())
|
||||||
|
|
||||||
def get_auth_urls(self):
|
def resolve_url(self, to):
|
||||||
urls = {}
|
if isinstance(to, Promise):
|
||||||
if swagger_settings.LOGIN_URL is not None:
|
to = str(to)
|
||||||
urls['LOGIN_URL'] = resolve_url(swagger_settings.LOGIN_URL)
|
|
||||||
if swagger_settings.LOGOUT_URL is not None:
|
|
||||||
urls['LOGOUT_URL'] = resolve_url(swagger_settings.LOGOUT_URL)
|
|
||||||
|
|
||||||
return urls
|
if to is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
args, kwargs = None, None
|
||||||
|
if not isinstance(to, six.string_types):
|
||||||
|
if len(to) > 2:
|
||||||
|
to, args, kwargs = to
|
||||||
|
elif len(to) == 2:
|
||||||
|
to, kwargs = to
|
||||||
|
|
||||||
|
args = args or ()
|
||||||
|
kwargs = kwargs or {}
|
||||||
|
|
||||||
|
return resolve_url(to, *args, **kwargs)
|
||||||
|
|
||||||
|
def get_auth_urls(self):
|
||||||
|
urls = {
|
||||||
|
'LOGIN_URL': self.resolve_url(swagger_settings.LOGIN_URL),
|
||||||
|
'LOGOUT_URL': self.resolve_url(swagger_settings.LOGOUT_URL),
|
||||||
|
}
|
||||||
|
|
||||||
|
return filter_none(urls)
|
||||||
|
|
||||||
|
def get_oauth2_config(self):
|
||||||
|
data = swagger_settings.OAUTH2_CONFIG
|
||||||
|
assert isinstance(data, dict), "OAUTH2_CONFIG must be a dict"
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
class SwaggerUIRenderer(_UIRenderer):
|
||||||
|
"""Renders a swagger-ui web interface for schema browisng."""
|
||||||
|
template = 'drf-yasg/swagger-ui.html'
|
||||||
|
format = 'swagger'
|
||||||
|
|
||||||
|
def set_context(self, renderer_context, swagger):
|
||||||
|
super(SwaggerUIRenderer, self).set_context(renderer_context, swagger)
|
||||||
|
renderer_context['swagger_settings'] = json.dumps(self.get_swagger_ui_settings())
|
||||||
|
|
||||||
def get_swagger_ui_settings(self):
|
def get_swagger_ui_settings(self):
|
||||||
data = {
|
data = {
|
||||||
|
'url': self.resolve_url(swagger_settings.SPEC_URL),
|
||||||
'operationsSorter': swagger_settings.OPERATIONS_SORTER,
|
'operationsSorter': swagger_settings.OPERATIONS_SORTER,
|
||||||
'tagsSorter': swagger_settings.TAGS_SORTER,
|
'tagsSorter': swagger_settings.TAGS_SORTER,
|
||||||
'docExpansion': swagger_settings.DOC_EXPANSION,
|
'docExpansion': swagger_settings.DOC_EXPANSION,
|
||||||
@@ -96,40 +137,39 @@ class _UIRenderer(BaseRenderer):
|
|||||||
'showCommonExtensions': swagger_settings.SHOW_COMMON_EXTENSIONS,
|
'showCommonExtensions': swagger_settings.SHOW_COMMON_EXTENSIONS,
|
||||||
'oauth2RedirectUrl': swagger_settings.OAUTH2_REDIRECT_URL,
|
'oauth2RedirectUrl': swagger_settings.OAUTH2_REDIRECT_URL,
|
||||||
'supportedSubmitMethods': swagger_settings.SUPPORTED_SUBMIT_METHODS,
|
'supportedSubmitMethods': swagger_settings.SUPPORTED_SUBMIT_METHODS,
|
||||||
|
'displayOperationId': swagger_settings.DISPLAY_OPERATION_ID,
|
||||||
}
|
}
|
||||||
data = {k: v for k, v in data.items() if v is not None}
|
|
||||||
|
data = filter_none(data)
|
||||||
if swagger_settings.VALIDATOR_URL != '':
|
if swagger_settings.VALIDATOR_URL != '':
|
||||||
data['validatorUrl'] = swagger_settings.VALIDATOR_URL
|
data['validatorUrl'] = self.resolve_url(swagger_settings.VALIDATOR_URL)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def get_redoc_settings(self):
|
|
||||||
data = {
|
|
||||||
'lazyRendering': redoc_settings.LAZY_RENDERING,
|
|
||||||
'hideHostname': redoc_settings.HIDE_HOSTNAME,
|
|
||||||
'expandResponses': redoc_settings.EXPAND_RESPONSES,
|
|
||||||
'pathInMiddle': redoc_settings.PATH_IN_MIDDLE,
|
|
||||||
}
|
|
||||||
|
|
||||||
return data
|
|
||||||
|
|
||||||
def get_oauth2_config(self):
|
|
||||||
data = swagger_settings.OAUTH2_CONFIG
|
|
||||||
assert isinstance(data, dict), "OAUTH2_CONFIG must be a dict"
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
class SwaggerUIRenderer(_UIRenderer):
|
|
||||||
"""Renders a swagger-ui web interface for schema browisng.
|
|
||||||
Also requires :class:`.OpenAPIRenderer` as an available renderer on the same view.
|
|
||||||
"""
|
|
||||||
template = 'drf-yasg/swagger-ui.html'
|
|
||||||
format = 'swagger'
|
|
||||||
|
|
||||||
|
|
||||||
class ReDocRenderer(_UIRenderer):
|
class ReDocRenderer(_UIRenderer):
|
||||||
"""Renders a ReDoc web interface for schema browisng.
|
"""Renders a ReDoc web interface for schema browisng."""
|
||||||
Also requires :class:`.OpenAPIRenderer` as an available renderer on the same view.
|
|
||||||
"""
|
|
||||||
template = 'drf-yasg/redoc.html'
|
template = 'drf-yasg/redoc.html'
|
||||||
format = 'redoc'
|
format = 'redoc'
|
||||||
|
|
||||||
|
def set_context(self, renderer_context, swagger):
|
||||||
|
super(ReDocRenderer, self).set_context(renderer_context, swagger)
|
||||||
|
renderer_context['redoc_settings'] = json.dumps(self.get_redoc_settings())
|
||||||
|
|
||||||
|
def get_redoc_settings(self):
|
||||||
|
data = {
|
||||||
|
'url': self.resolve_url(redoc_settings.SPEC_URL),
|
||||||
|
'lazyRendering': redoc_settings.LAZY_RENDERING,
|
||||||
|
'hideHostname': redoc_settings.HIDE_HOSTNAME,
|
||||||
|
'expandResponses': redoc_settings.EXPAND_RESPONSES,
|
||||||
|
'pathInMiddlePanel': redoc_settings.PATH_IN_MIDDLE,
|
||||||
|
'nativeScrollbars': redoc_settings.NATIVE_SCROLLBARS,
|
||||||
|
'requiredPropsFirst': redoc_settings.REQUIRED_PROPS_FIRST,
|
||||||
|
}
|
||||||
|
|
||||||
|
return filter_none(data)
|
||||||
|
|
||||||
|
|
||||||
|
class ReDocOldRenderer(ReDocRenderer):
|
||||||
|
"""Renders a ReDoc 1.x.x web interface for schema browisng."""
|
||||||
|
template = 'drf-yasg/redoc-old.html'
|
||||||
@@ -3,19 +3,26 @@
|
|||||||
var currentPath = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
var currentPath = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
||||||
var specURL = currentPath + '?format=openapi';
|
var specURL = currentPath + '?format=openapi';
|
||||||
var redoc = document.createElement("redoc");
|
var redoc = document.createElement("redoc");
|
||||||
redoc.setAttribute("spec-url", specURL);
|
|
||||||
|
|
||||||
var redocSettings = JSON.parse(document.getElementById('redoc-settings').innerHTML);
|
var redocSettings = JSON.parse(document.getElementById('redoc-settings').innerHTML);
|
||||||
if (redocSettings.lazyRendering) {
|
if (redocSettings.url) {
|
||||||
redoc.setAttribute("lazy-rendering", '');
|
specURL = redocSettings.url;
|
||||||
|
delete redocSettings.url;
|
||||||
}
|
}
|
||||||
if (redocSettings.pathInMiddle) {
|
redoc.setAttribute("spec-url", specURL);
|
||||||
redoc.setAttribute("path-in-middle-panel", '');
|
|
||||||
|
function camelToKebab(str) {
|
||||||
|
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||||
}
|
}
|
||||||
if (redocSettings.hideHostname) {
|
|
||||||
redoc.setAttribute("hide-hostname", '');
|
for (var p in redocSettings) {
|
||||||
|
if (redocSettings.hasOwnProperty(p)) {
|
||||||
|
if (redocSettings[p] !== null && redocSettings[p] !== undefined && redocSettings[p] !== false) {
|
||||||
|
redoc.setAttribute(camelToKebab(p), redocSettings[p].toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
redoc.setAttribute("expand-responses", redocSettings.expandResponses);
|
|
||||||
document.body.appendChild(redoc);
|
document.body.appendChild(redoc);
|
||||||
|
|
||||||
function hideEmptyVersion() {
|
function hideEmptyVersion() {
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/*!
|
||||||
|
* ReDoc - OpenAPI/Swagger-generated API Reference Documentation
|
||||||
|
* -------------------------------------------------------------
|
||||||
|
* Version: "1.22.2"
|
||||||
|
* Repo: https://github.com/Rebilly/ReDoc
|
||||||
|
*/
|
||||||
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}(),function(){try{return require("jquery")}catch(e){}}()):"function"==typeof define&&define.amd?define("Redoc",["esprima","jquery"],t):"object"==typeof exports?exports.Redoc=t(function(){try{return require("esprima")}catch(e){}}(),function(){try{return require("jquery")}catch(e){}}()):e.Redoc=t(e.esprima,e.jquery)}("undefined"!=typeof self?self:this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=250)}([function(e,t,n){var r=n(5),o=n(8),i=n(25),a=n(20),s=n(58),l=function(e,t,n){var u,c,p,d,f=e&l.F,h=e&l.G,g=e&l.S,m=e&l.P,y=e&l.B,v=h?r:g?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?o:o[t]||(o[t]={}),_=b.prototype||(b.prototype={});h&&(n=t);for(u in n)c=!f&&v&&void 0!==v[u],p=(c?v:n)[u],d=y&&c?s(p,r):m&&"function"==typeof p?s(Function.call,p):p,v&&a(v,u,p,e&l.U),b[u]!=p&&i(b,u,d),m&&_[u]!=p&&(_[u]=p)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function r(){if(!Do){var e=jo.Symbol;if(e&&e.iterator)Do=e.iterator;else for(var t=Object.getOwnPropertyNames(Map.prototype),n=0;n<t.length;++n){var r=t[n];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(Do=r)}}return Do}function o(e){Zone.current.scheduleMicroTask("scheduleMicrotask",e)}function i(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function a(e){if("string"==typeof e)return e;if(null==e)return""+e;if(e.overriddenName)return""+e.overriddenName;if(e.name)return""+e.name;var t=e.toString();if(null==t)return""+t;var n=t.indexOf("\n");return-1===n?t:t.substring(0,n)}function s(e){return"function"==typeof e&&e.hasOwnProperty("annotation")&&(e=e.annotation),e}function l(e,t){if(e===Object||e===String||e===Function||e===Number||e===Array)throw new Error("Can not use native "+a(e)+" as constructor");if("function"==typeof e)return e;if(Array.isArray(e)){var n=e,r=n.length-1,o=e[r];if("function"!=typeof o)throw new Error("Last position of Class method array must be Function in key "+t+" was '"+a(o)+"'");if(r!=o.length)throw new Error("Number of annotations ("+r+") does not match number of arguments ("+o.length+") in the function: "+a(o));for(var i=[],l=0,u=n.length-1;l<u;l++){var c=[];i.push(c);var p=n[l];if(Array.isArray(p))for(var d=0;d<p.length;d++)c.push(s(p[d]));else"function"==typeof p?c.push(s(p)):c.push(p)}return Fo.defineMetadata("parameters",i,o),o}throw new Error("Only Function or Array is supported in Class definition for key '"+t+"' is '"+a(e)+"'")}function u(e){var t=l(e.hasOwnProperty("constructor")?e.constructor:void 0,"constructor"),n=t.prototype;if(e.hasOwnProperty("extends")){if("function"!=typeof e.extends)throw new Error("Class definition 'extends' property must be a constructor function was: "+a(e.extends));t.prototype=n=Object.create(e.extends.prototype)}for(var r in e)"extends"!==r&&"prototype"!==r&&e.hasOwnProperty(r)&&(n[r]=l(e[r],r));this&&this.annotations instanceof Array&&Fo.defineMetadata("annotations",this.annotations,t);var o=t.name;return o&&"constructor"!==o||(t.overriddenName="class"+Lo++),t}function c(e,t,n,r){function o(e){if(!Fo||!Fo.getOwnMetadata)throw"reflect-metadata shim is required when using class decorators";if(this instanceof o)return i.call(this,e),this;var t=new o(e),n="function"==typeof this&&Array.isArray(this.annotations)?this.annotations:[];n.push(t);var a=function(e){var n=Fo.getOwnMetadata("annotations",e)||[];return n.push(t),Fo.defineMetadata("annotations",n,e),e};return a.annotations=n,a.Class=u,r&&r(a),a}var i=p(t);return n&&(o.prototype=Object.create(n.prototype)),o.prototype.toString=function(){return"@"+e},o.annotationCls=o,o}function p(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e){var r=e.apply(void 0,t);for(var o in r)this[o]=r[o]}}}function d(e,t,n){function r(){function e(e,t,n){for(var r=Fo.getOwnMetadata("parameters",e)||[];r.length<=n;)r.push(null);return r[n]=r[n]||[],r[n].push(i),Fo.defineMetadata("parameters",r,e),e}for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(this instanceof r)return o.apply(this,t),this;var i=new(r.bind.apply(r,[void 0].concat(t)));return e.annotation=i,e}var o=p(t);return n&&(r.prototype=Object.create(n.prototype)),r.prototype.toString=function(){return"@"+e},r.annotationCls=r,r}function f(e,t,n){function r(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this instanceof r)return o.aLine truncated
|
||||||
|
//# sourceMappingURL=redoc.min.map
|
||||||
+54
-89
@@ -1,10 +1,10 @@
|
|||||||
/*!
|
/*!
|
||||||
* ReDoc - OpenAPI/Swagger-generated API Reference Documentation
|
* ReDoc - OpenAPI/Swagger-generated API Reference Documentation
|
||||||
* -------------------------------------------------------------
|
* -------------------------------------------------------------
|
||||||
* Version: "2.0.0-alpha.17"
|
* Version: "2.0.0-alpha.38"
|
||||||
* Repo: https://github.com/Rebilly/ReDoc
|
* Repo: https://github.com/Rebilly/ReDoc
|
||||||
*/
|
*/
|
||||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null"),function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["null","esprima"],t):"object"==typeof exports?exports.Redoc=t(require("null"),function(){try{return require("esprima")}catch(e){}}()):e.Redoc=t(e.null,e.esprima)}(this,function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=293)}([function(e,t,n){"use strict";e.exports=n(250)},function(e,t,n){"use strict";n.d(t,"f",function(){return h}),n.d(t,"b",function(){return u}),n.d(t,"d",function(){return p}),n.d(t,"e",function(){return f}),n.d(t,"a",function(){return d}),n.d(t,"g",function(){return o});var r=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};function o(e){return e}var i,a,s,c=n(13),l=c.default,u=c.css,p=c.injectGlobal,f=c.keyframes,d=c.ThemeProvider,h=(c.withTheme,{lessThan:function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return u(i||(i=r(["\n @media (max-width: ",") {\n ",";\n }\n "],["\n @media (max-width: ",") {\n ",";\n }\n "])),function(t){return t.theme.breakpoints[e]},u.apply(void 0,t))}},greaterThan:function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return u(a||(a=r(["\n @media (min-width: ",") {\n ",";\n }\n "],["\n @media (min-width: ",") {\n ",";\n }\n "])),function(t){return t.theme.breakpoints[e]},u.apply(void 0,t))}},between:function(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return u(s||(s=r(["\n @media (min-width: ",") and (max-width: ",") {\n ",";\n }\n "],["\n @media (min-width: ",") and (max-width: ",") {\n ",";\n }\n "])),function(t){return t.theme.breakpoints[e]},function(e){return e.theme.breakpoints[t]},u.apply(void 0,n))}}});t.c=l},function(e,t,n){"use strict";var r=n(40),o=n(19),i=n(41),a=n(67),s=(n(168),n(167),n(166),n(165),n(164),n(163),n(162),n(161),n(160),n(159),n(158),n(157),n(156),n(155),n(154),n(153),n(152),n(151),n(150),n(149),n(1)),c=n(140),l=n.n(c),u=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};Object(s.d)(p||(p=u(["",""],["",""])),l.a);var p,f="clike";function d(e){return{json:"js","c++":"cpp","c#":"csharp","objective-c":"objectivec",shell:"bash",viml:"vim"}[e]||f}function h(e,t){var n=a.languages[t];return n||(n=a.languages[d(t)]),a.highlight(e,n)}var m=n(64),g=n(16);function y(e){return function(t,n,r){var o,i,a,s,c,l,u,p;r.value=(o=r.value,i=e,l=null,u=0,p=function(){u=(new Date).getTime(),l=null,c=o.apply(a,s),l||(a=s=null)},function(){var e=(new Date).getTime(),t=i-(e-u);return a=this,s=arguments,t<=0||t>i?(l&&(clearTimeout(l),l=null),u=e,c=o.apply(a,s),l||(a=s=null)):l||(l=setTimeout(p,t)),c})}}var v=n(33);n.d(t,"a",function(){return r.a}),n.d(t,"g",function(){return o.d}),n.d(t,"o",function(){return o.h}),n.d(t,"f",function(){return o.c}),n.d(t,"d",function(){return o.b}),n.d(t,"p",function(){return o.i}),n.d(t,"m",function(){return o.f}),n.d(t,"q",function(){return o.j}),n.d(t,"n",function(){return o.g}),n.d(t,"j",function(){return o.e}),n.d(t,"v",function(){return o.k}),n.d(t,!1,function(){return o.a}),n.d(t,"t",function(){return i.f}),n.d(t,"s",function(){return i.e}),n.d(t,"e",function(){return i.b}),n.d(t,"w",function(){return i.h}),n.d(t,"k",function(){return i.c}),n.d(t,!1,function(){return i.d}),n.d(t,"c",function(){return i.a}),n.d(t,!1,function(){return i.g}),n.d(t,!1,function(){return d}),n.d(t,"h",function(){return h}),n.d(t,"r",function(){return m.a}),n.d(t,!1,function(){}),n.d(t,"l",function(){return g.b}),n.d(t,"u",function(){return g.c}),n.d(t,"i",function(){return g.a}),n.d(t,"b",function(){return y}),n.d(t,!1,function(){return v.a}),n.d(t,!1,function(){return v.b})},function(e,t,n){"use strict";(function(e,r){n.d(t,"a",function(){return Wt}),n.d(t,"n",function(){return Dt}),n.d(t,"f",function(){return Me}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return ne}),n.d(t,"h",function(){return Je}),n.d(t,"i",function(){return Ie}),n.d(t,"k",function(){return be}),n.d(t,"d",function(){return ce}),n.d(t,"l",function(){return Gt}),n.d(t,"c",function(){return S}),n.d(t,"e",function(){return Xt}),n.d(t,"g",function(){return Fe}),n.d(t,"b",function(){return x});
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("null"),function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["null","esprima"],t):"object"==typeof exports?exports.Redoc=t(require("null"),function(){try{return require("esprima")}catch(e){}}()):e.Redoc=t(e.null,e.esprima)}(this,function(__WEBPACK_EXTERNAL_MODULE__132__,__WEBPACK_EXTERNAL_MODULE__233__){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=147)}([function(e,t,n){"use strict";e.exports=n(191)},function(e,t,n){"use strict";n.d(t,"d",function(){return o}),n.d(t,"a",function(){return i}),n.d(t,"c",function(){return a}),n.d(t,"b",function(){return s}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return c});
|
||||||
/*! *****************************************************************************
|
/*! *****************************************************************************
|
||||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||||
@@ -19,95 +19,76 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|||||||
See the Apache Version 2.0 License for specific language governing permissions
|
See the Apache Version 2.0 License for specific language governing permissions
|
||||||
and limitations under the License.
|
and limitations under the License.
|
||||||
***************************************************************************** */
|
***************************************************************************** */
|
||||||
var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function c(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}var l={},u={};function p(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var n in pt(e,"__mobxDidRunLazyInitializers",!0),t){var r=t[n];r.propertyCreator(e,r.prop,r.descriptor,r.decoratorTarget,r.decoratorArguments)}}}function f(e,t){return function(){var n,r,o=function(r,o,i,s){if(!0===s)return t(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,"__mobxDecorators")){var c=r.__mobxDecorators;pt(r,"__mobxDecorators",a({},c))}return r.__mobxDecorators[o]={prop:o,propertyCreator:t,descriptor:i,decoratorTarget:r,decoratorArguments:n},function(e,t){var n=t?l:u;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return p(this),this[e]},set:function(t){p(this),this[e]=t}})}(o,e)};return(2===(r=arguments).length||3===r.length)&&"string"==typeof r[1]||4===r.length&&!0===r[3]?(n=et,o.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),o)}}function d(){return!!xt.spyListeners.length}function h(e){if(xt.spyListeners.length)for(var t=xt.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function m(e){h(a({},e,{spyReportStart:!0}))}var g={spyReportEnd:!0};function y(e){h(e?a({},e,{spyReportEnd:!0}):g)}function v(e){return xt.spyListeners.push(e),st(function(){var t=xt.spyListeners.indexOf(e);-1!==t&&xt.spyListeners.splice(t,1)})}function b(e,t){var n=function(){return w(e,t,this,arguments)};return n.isMobxAction=!0,n}function w(e,t,n,r){var o=function(e,t,n,r){var o=d()&&!!e,i=0;if(o){i=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var c=0;c<a;c++)s[c]=r[c];m({type:"action",name:e,object:n,arguments:s})}var l=Bt();At();var u=k(!0);return{prevDerivation:l,prevAllowStateChanges:u,notifySpy:o,startTime:i}}(e,0,n,r);try{return t.apply(n,r)}finally{!function(e){O(e.prevAllowStateChanges),Tt(),Ut(e.prevDerivation),e.notifySpy&&y({time:Date.now()-e.startTime})}(o)}}function x(e,t){var n,r=k(e);try{n=t()}finally{O(r)}return n}function k(e){var t=xt.allowStateChanges;return xt.allowStateChanges=e,t}function O(e){xt.allowStateChanges=e}function _(){ot(!1)}function E(e){return function(t,n,r){if(r){if(r.value)return{value:b(e,r.value),enumerable:!1,configurable:!1,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!1,writable:!1,initializer:function(){return b(e,o.call(this))}}}return function(e){return function(t,n,r){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){ft(this,n,S(e,t))}})}}(e).apply(this,arguments)}}var S=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?b(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?b(e,t):1===arguments.length&&"string"==typeof e?E(e):!0!==r?E(t).apply(null,arguments):void(e[t]=b(e.name||t,n.value))};function C(e,t,n){pt(e,t,b(t,n.bind(e)))}S.bound=function(e,t,n,r){return!0===r?(C(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return C(this,t,n.value||n.initializer.call(this)),this[t]},set:_}:{enumerable:!1,configurable:!0,set:function(e){C(this,t,e)},get:function(){}}};var A=Object.prototype.toString;function T(e,t){return j(e,t)}function j(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&function(e,t,n,r){e=P(e),t=P(t);var o=A.call(e);if(o!==A.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var i="[object Array]"===o;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];var c=n.length;for(;c--;)if(n[c]===e)return r[c]===t;if(n.push(e),r.push(t),i){if((c=e.length)!==t.length)return!1;for(;c--;)if(!j(e[c],t[c],n,r))return!1}else{var l,u=Object.keys(e);if(c=u.length,Object.keys(t).length!==c)return!1;for(;c--;)if(l=u[c],!I(t,l)||!j(e[l],t[l],n,r))retuLine truncated
|
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}l((r=r.apply(e,t||[])).next())})}function l(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function c(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}},function(e,t,n){"use strict";var r=n(48),o=n(11),i=n(19),a=n(63),s=(n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),"clike");function l(e,t){void 0===t&&(t=s),t=t.toLowerCase();var n=a.languages[t];return n||(n=a.languages[function(e){return{json:"js","c++":"cpp","c#":"csharp","objective-c":"objectivec",shell:"bash",viml:"vim"}[e]||s}(t)]),a.highlight(e,n)}var c=n(60),u=n(16);function p(e){return function(t,n,r){r.value=function(e,t){var n,r,o,i=null,a=0,s=function(){a=(new Date).getTime(),i=null,o=e.apply(n,r),i||(n=r=null)};return function(){var l=(new Date).getTime(),c=t-(l-a);return n=this,r=arguments,c<=0||c>t?(i&&(clearTimeout(i),i=null),a=l,o=e.apply(n,r),i||(n=r=null)):i||(i=setTimeout(s,c)),o}}(r.value,e)}}n(33);var f=n(1),d={};function h(e,t,n){if("function"==typeof n.value)return function(e,t,n){if(!n.value||n.value.length>0)throw new Error("@memoize decorator can only be applied to methods of zero arguments");var r="_memoized_"+t,o=n.value;return e[r]=d,f.a({},n,{value:function(){return this[r]===d&&(this[r]=o.call(this)),this[r]}})}(e,t,n);if("function"==typeof n.get)return function(e,t,n){var r="_memoized_"+t,o=n.get;return e[r]=d,f.a({},n,{get:function(){return this[r]===d&&(this[r]=o.call(this)),this[r]}})}(e,t,n);throw new Error("@memoize decorator can be applied to methods or getters, got "+String(n.value)+" instead")}n.d(t,"b",function(){return r.a}),n.d(t,"q",function(){return o.k}),n.d(t,"j",function(){return o.e}),n.d(t,"o",function(){return o.i}),n.d(t,"i",function(){return o.d}),n.d(t,"g",function(){return o.c}),n.d(t,"p",function(){return o.j}),n.d(t,"m",function(){return o.g}),n.d(t,"r",function(){return o.l}),n.d(t,"n",function(){return o.h}),n.d(t,"l",function(){return o.f}),n.d(t,"C",function(){return o.r}),n.d(t,"w",function(){return o.m}),n.d(t,"x",function(){return o.n}),n.d(t,"y",function(){return o.o}),n.d(t,"c",function(){return o.a}),n.d(t,"d",function(){return o.b}),n.d(t,"B",function(){return o.p}),n.d(t,"u",function(){return i.e}),n.d(t,"t",function(){return i.d}),n.d(t,"h",function(){return i.b}),n.d(t,"f",function(){return i.a}),n.d(t,"A",function(){return i.h}),n.d(t,"k",function(){return l}),n.d(t,"s",function(){return c.a}),n.d(t,"a",function(){return u.a}),n.d(t,"z",function(){return u.b}),n.d(t,"e",function(){return p}),n.d(t,"v",function(){return h})},function(e,t,n){"use strict";(function(e,r){n.d(t,"a",function(){return Qt}),n.d(t,"b",function(){return Ut}),n.d(t,"o",function(){return Nt}),n.d(t,"g",function(){return De}),n.d(t,"n",function(){return y}),n.d(t,"k",function(){return ne}),n.d(t,"i",function(){return Qe}),n.d(t,"j",function(){return Re}),n.dLine truncated
|
||||||
|
/*! *****************************************************************************
|
||||||
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
Licensed 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
|
||||||
|
|
||||||
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||||
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||||
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||||
|
|
||||||
|
See the Apache Version 2.0 License for specific language governing permissions
|
||||||
|
and limitations under the License.
|
||||||
|
***************************************************************************** */
|
||||||
|
var o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function l(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e}var c={},u={};function p(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var n in st(e,"__mobxDidRunLazyInitializers",!0),t){var r=t[n];r.propertyCreator(e,r.prop,r.descriptor,r.decoratorTarget,r.decoratorArguments)}}}function f(e,t){return function(){var n,r=function(r,o,i,s){if(!0===s)return t(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,"__mobxDecorators")){var l=r.__mobxDecorators;st(r,"__mobxDecorators",a({},l))}return r.__mobxDecorators[o]={prop:o,propertyCreator:t,descriptor:i,decoratorTarget:r,decoratorArguments:n},function(e,t){var n=t?c:u;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return p(this),this[e]},set:function(t){p(this),this[e]=t}})}(o,e)};return function(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]||4===e.length&&!0===e[3]}(arguments)?(n=Ge,r.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),r)}}function d(){return!!vt.spyListeners.length}function h(e){if(vt.spyListeners.length)for(var t=vt.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function m(e){h(a({},e,{spyReportStart:!0}))}var g={spyReportEnd:!0};function v(e){h(e?a({},e,{spyReportEnd:!0}):g)}function y(e){return vt.spyListeners.push(e),rt(function(){vt.spyListeners=vt.spyListeners.filter(function(t){return t!==e})})}function b(e,t){var n=function(){return w(e,t,this,arguments)};return n.isMobxAction=!0,n}function w(e,t,n,r){var o=function(e,t,n,r){var o=d()&&!!e,i=0;if(o){i=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var l=0;l<a;l++)s[l]=r[l];m({type:"action",name:e,object:n,arguments:s})}var c=Lt();_t();var u=k(!0);return{prevDerivation:c,prevAllowStateChanges:u,notifySpy:o,startTime:i}}(e,0,n,r);try{return t.apply(n,r)}finally{!function(e){E(e.prevAllowStateChanges),St(),Mt(e.prevDerivation),e.notifySpy&&v({time:Date.now()-e.startTime})}(o)}}function x(e,t){var n,r=k(e);try{n=t()}finally{E(r)}return n}function k(e){var t=vt.allowStateChanges;return vt.allowStateChanges=e,t}function E(e){vt.allowStateChanges=e}function _(){et(!1)}function S(e){return function(t,n,r){if(r){if(r.value)return{value:b(e,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return b(e,o.call(this))}}}return function(e){return function(t,n,r){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){st(this,n,O(e,t))}})}}(e).apply(this,arguments)}}var O=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?b(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?b(e,t):1===arguments.length&&"string"==typeof e?S(e):!0!==r?S(t).apply(null,arguments):void(e[t]=b(e.name||t,n.value))};function C(e,t,n){st(e,t,b(t,n.bind(e)))}O.bound=function(e,t,n,r){return!0===r?(C(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return C(this,t,n.value||n.initializer.call(this)),this[t]},set:_}:{enumerable:!1,configurable:!0,set:function(e){C(this,t,e)},get:function(){}}};var T=Object.prototype.toString;function A(e,t){return P(e,t)}function P(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&function(e,t,n,r){e=I(e),t=I(t);var o=T.call(e);if(o!==T.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var i="[object Array]"===o;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];var l=n.length;for(;l--;)if(n[l]===e)return r[l]===t;if(n.push(e),r.push(t),i){if((l=e.length)!==t.length)return!1;for(;l--;)if(!P(e[l],t[l],n,r))return!1}else{var c,u=Object.keys(e);if(l=u.length,Object.keys(t).length!==l)return!1;for(;l--;)if(c=u[l],!R(t,c)||!P(e[c],Line truncated
|
||||||
/*!
|
/*!
|
||||||
* The buffer module from node.js, for the browser.
|
* The buffer module from node.js, for the browser.
|
||||||
*
|
*
|
||||||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
var r=n(237),o=n(236),i=n(118);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(c.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(u(t),e=s(e,t<0?0:0|d(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;i<s;i++)if(l(e,i)===l(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===c)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+c>s&&(n=s-c),i=n;i>=0;i--){for(var p=!0,f=0;f<c;f++)if(l(e,i+f)!==l(t,f)){p=!1;break}if(p)return i}return-1}function v(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return $(U(t,e.length-n),e,n,r)}function w(e,t,n,r){return $(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function k(e,t,n,r){return $(z(t),e,n,r)}function O(e,t,n,r){return $(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,c,l=e[o],u=null,p=l>239?4:l>223?3:l>191?2:1;if(o+p<=n)switch(p){case 1:l<128&&(u=l);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&l)<<6|63&i)>127&&(u=c);break;case 3:i=e[o+1],a=e[o+2],128=Line truncated
|
var r=n(210),o=n(211),i=n(113);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(u(t),e=s(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var p=!0,f=0;f<l;f++)if(c(e,i+f)!==c(t,f)){p=!1;break}if(p)return i}return-1}function y(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return $(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return $(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function k(e,t,n,r){return $(z(t),e,n,r)}function E(e,t,n,r){return $(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,l,c=e[o],u=null,p=c>239?4:c>223?3:c>191?2:1;if(o+p<=n)switch(p){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],Line truncated
|
||||||
/*!
|
/*!
|
||||||
Copyright (c) 2016 Jed Watson.
|
Copyright (c) 2017 Jed Watson.
|
||||||
Licensed under the MIT License (MIT), see
|
Licensed under the MIT License (MIT), see
|
||||||
http://jedwatson.github.io/classnames
|
http://jedwatson.github.io/classnames
|
||||||
*/
|
*/
|
||||||
/*!
|
/*!
|
||||||
Copyright (c) 2016 Jed Watson.
|
Copyright (c) 2017 Jed Watson.
|
||||||
Licensed under the MIT License (MIT), see
|
Licensed under the MIT License (MIT), see
|
||||||
http://jedwatson.github.io/classnames
|
http://jedwatson.github.io/classnames
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r))e.push(o.apply(null,r));else if("object"===i)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}void 0!==e&&e.exports?e.exports=o:void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";var r=n(207),o=n(205);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=b(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(l),p=["%","/","?",";","#"].concat(u),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=n(204);function b(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var b=e=l.join(s);if(b=b.trim(),!n&&1===e.split("#").length){var w=c.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=a.exec(b);if(x){var k=(x=x[0]).toLowerCase();this.protocol=k,b=b.substr(x.length)}if(n||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var O="//"===b.substr(0,2);!O||x&&g[x]||(b=b.substr(2),this.slashes=!0)}if(!g[x]&&(O||x&&!y[x])){for(var _,E,S=-1,C=0;C<f.length;C++){-1!==(A=b.indexOf(f[C]))&&(-1===S||A<S)&&(S=A)}-1!==(E=-1===S?b.lastIndexOf("@"):b.lastIndexOf("@",S))&&(_=b.slice(0,E),b=b.slice(E+1),this.auth=decodeURIComponent(_)),S=-1;for(C=0;C<p.length;C++){var A;-1!==(A=b.indexOf(p[C]))&&(-1===S||A<S)&&(S=A)}-1===S&&(S=b.length),this.host=b.slice(0,S),b=b.slice(S),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var j=this.hostname.split(/\./),P=(C=0,j.length);C<P;C++){var I=j[C];if(I&&!I.match(d)){for(var R="",N=0,F=I.length;N<F;N++)I.charCodeAt(N)>127?R+="x":R+=I[N];if(!R.match(d)){var L=j.slice(0,C),M=j.slice(C+1),D=I.match(h);D&&(L.push(D[1]),M.unshift(D[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+B,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[k])for(C=0,P=u.length;C<P;C++){var z=u[C];if(-1!==b.indexOf(z)){var $=encodeURIComponent(z);$===z&&($=escape(z)),b=b.split(z).join($)}}var W=b.indexOf("#");-1!==W&&(this.hash=b.substr(W),b=b.slice(0,W));var q=b.indexOf("?");if(-1!==q?(this.search=b.substr(q),this.query=b.substr(q+1),t&&(this.query=v.parse(this.query)),b=b.slice(0,q)):t&&(this.search="",this.query={}),b&&(this.pathname=b),y[k]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var H=this.search||"";this.path=B+H}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=v.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),l=0;l<c.length;l++){varLine truncated
|
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}void 0!==e&&e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(13);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){"use strict";n.d(t,"e",function(){return s}),n.d(t,"d",function(){return l}),n.d(t,"b",function(){return c}),n.d(t,"c",function(){return p}),n.d(t,"a",function(){return f}),n.d(t,"f",function(){return d}),n.d(t,"h",function(){return m}),n.d(t,"g",function(){return g});var r=n(1),o=n(138),i=n.n(o),a=n(15);function s(e,t){for(var n=[],r=0;r<e.length-1;r++)n.push(t(e[r],!1));return 0!==e.length&&n.push(t(e[e.length-1],!0)),n}function l(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r],r,e));return n}function c(e,t){var n=[],r=function(e){for(var o=0,i=e;o<i.length;o++){var a=i[o];n.push(a),a[t]&&r(a[t])}};return r(e),n}function u(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function p(e){return!isNaN(parseFloat(e))&&isFinite(e)}function f(e,t,n){var r=new RegExp("(^|\\n)#\\s?"+t+"\\s*\\n","i"),o=new RegExp("((\\n|^)#\\s*"+t+"\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)","i");return r.test(e)?e.replace(o,"$1\n\n"+n+"\n$4"):""+e+(""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n")+"# "+t+"\n\n"+n}var d=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!t.length)return e;var r=t.shift();return void 0===r?e:(h(e)&&h(r)&&Object.keys(r).forEach(function(t){h(r[t])?(e[t]||(e[t]={}),d(e[t],r[t])):e[t]=r[t]}),d.apply(void 0,[e].concat(t)))},h=function(e){return function(e){return null!==e&&"object"==typeof e}(e)&&!Array.isArray(e)};function m(e){return i()(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/\--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function g(e,t){var n;if(t.startsWith("//"))n=""+Object(a.parse)(e).protocol+t;else if(function(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}(t))n=t;else if(t.startsWith("/")){var o=Object(a.parse)(e);n=Object(a.format)(r.a({},o,{pathname:t}))}else n=u(e)+"/"+t;return u(n)}},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(192)},function(e,t,n){"use strict";var r=n(268);function o(e,t,n){if(3===arguments.length)return o.set(e,t,n);if(2===arguments.length)return o.get(e,t);var r=o.bind(o,e);for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i].bind(r,e));return r}e.exports=o,o.get=function(e,t){for(var n=Array.isArray(t)?t:o.parse(t),r=0;r<n.length;++r){var i=n[r];if(!("object"==typeof e&&i in e))throw new Error("Invalid reference token: "+i);e=e[i]}return e},o.set=function(e,t,n){for(var r=Array.isArray(t)?t:o.parse(t),i=r[0],a=0;a<r.length-1;++a){var s=r[a];"-"===s&&Array.isArray(e)&&(s=e.length),i=r[a+1],s in e||(i.match(/^(\d+|-)$/)?e[s]=[]:e[s]={}),e=e[s]}return"-"===i&&Array.isArray(e)&&(i=e.length),e[i]=n,this},o.remove=function(e,t){var n=Array.isArray(t)?t:o.parse(t),r=n[n.length-1];if(void 0===r)throw new Error('Invalid JSON pointer for remove: "'+t+'"');var i=o.get(e,n.slice(0,-1));if(Array.isArray(i)){var a=+r;if(""===r&&isNaN(a))throw new Error('Invalid array index: "'+r+'"');Array.prototype.splice.call(i,a,1)}else delete i[r]},o.dict=function(e,t){var n={};return o.walk(e,function(e,t){n[t]=e},t),n},o.walk=function(e,t,n){var i=[];n=n||function(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Array]"===t},function e(a){r(a,function(r,a){i.push(String(a)),n(r)?e(r):t(r,o.compile(i)),i.pop()})}(e)},o.has=function(e,t){try{o.get(e,t)}catch(e){return!1}return!0},o.escape=function(e){return e.toString().replace(/~/g,"~0").replace(/\//g,"~1")},o.unescape=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},o.parse=function(e){if(""===e)return[];if("/"!==e.charAt(0))throw new Error("Invalid JSON pointer: "+e);return e.substring(1).split(/\//).map(o.unescape)},o.compile=function(e){return 0===e.length?"":"/"+e.map(o.escape).join("/")}},function(e,t,n){var r=n(18),o=n(91),i=n(68),a=Object.defineProperty;t.f=n(23)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(35)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9),o=n(12),i=n(29),a=n(28),s=n(31),l=function(e,t,n){var c,u,p,f,d=e&l.F,h=e&l.G,m=e&l.S,g=e&l.P,v=e&l.B,y=h?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?oLine truncated
|
||||||
/**
|
|
||||||
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.1.6
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
* @license MIT
|
|
||||||
*/!function(){var i,a,s,c,l,u,p,f,d,h,m,g,y,v,b,w,x,k,O,_,E,S,C,A,T,j,P=function(e){var t=new P.Builder;return t.pipeline.add(P.trimmer,P.stopWordFilter,P.stemmer),t.searchPipeline.add(P.stemmer),e.call(t,t),t.build()};P.version="2.1.6"
|
|
||||||
/*!
|
|
||||||
* lunr.utils
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.utils={},P.utils.warn=(i=this,function(e){i.console&&console.warn&&console.warn(e)}),P.utils.asString=function(e){return void 0===e||null===e?"":e.toString()},P.FieldRef=function(e,t,n){this.docRef=e,this.fieldName=t,this._stringValue=n},P.FieldRef.joiner="/",P.FieldRef.fromString=function(e){var t=e.indexOf(P.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var n=e.slice(0,t),r=e.slice(t+1);return new P.FieldRef(r,n,e)},P.FieldRef.prototype.toString=function(){return void 0==this._stringValue&&(this._stringValue=this.fieldName+P.FieldRef.joiner+this.docRef),this._stringValue},P.idf=function(e,t){var n=0;for(var r in e)"_index"!=r&&(n+=Object.keys(e[r]).length);var o=(t-n+.5)/(n+.5);return Math.log(1+Math.abs(o))},P.Token=function(e,t){this.str=e||"",this.metadata=t||{}},P.Token.prototype.toString=function(){return this.str},P.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},P.Token.prototype.clone=function(e){return e=e||function(e){return e},new P.Token(e(this.str,this.metadata),this.metadata)}
|
|
||||||
/*!
|
|
||||||
* lunr.tokenizer
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.tokenizer=function(e){if(null==e||void 0==e)return[];if(Array.isArray(e))return e.map(function(e){return new P.Token(P.utils.asString(e).toLowerCase())});for(var t=e.toString().trim().toLowerCase(),n=t.length,r=[],o=0,i=0;o<=n;o++){var a=o-i;(t.charAt(o).match(P.tokenizer.separator)||o==n)&&(a>0&&r.push(new P.Token(t.slice(i,o),{position:[i,a],index:r.length})),i=o+1)}return r},P.tokenizer.separator=/[\s\-]+/
|
|
||||||
/*!
|
|
||||||
* lunr.Pipeline
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.Pipeline=function(){this._stack=[]},P.Pipeline.registeredFunctions=Object.create(null),P.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&P.utils.warn("Overwriting existing registered function: "+t),e.label=t,P.Pipeline.registeredFunctions[e.label]=e},P.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||P.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},P.Pipeline.load=function(e){var t=new P.Pipeline;return e.forEach(function(e){var n=P.Pipeline.registeredFunctions[e];if(!n)throw new Error("Cannot load unregistered function: "+e);t.add(n)}),t},P.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){P.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},P.Pipeline.prototype.after=function(e,t){P.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");n+=1,this._stack.splice(n,0,t)},P.Pipeline.prototype.before=function(e,t){P.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");this._stack.splice(n,0,t)},P.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},P.Pipeline.prototype.run=function(e){for(var t=this._stack.length,n=0;n<t;n++){for(var r=this._stack[n],o=[],i=0;i<e.length;i++){var a=r(e[i],i,e);if(void 0!==a&&""!==a)if(a instanceof Array)for(var s=0;s<a.length;s++)o.push(a[s]);else o.push(a)}e=o}return e},P.Pipeline.prototype.runString=function(e){var t=new P.Token(e);return this.run([t]).map(function(e){return e.toString()})},P.Pipeline.prototype.reset=function(){this._stack=[]},P.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return P.Pipeline.warnIfFunctionNotRegistered(e),e.label})}
|
|
||||||
/*!
|
|
||||||
* lunr.Vector
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.Vector=function(e){this._magnitude=0,this.elements=e||[]},P.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,n=this.elements.length/2,r=n-t,o=Math.floor(r/2),i=this.elements[2*o];r>1&&(i<e&&(t=o),i>e&&(n=o),i!=e);)r=n-t,o=t+Math.floor(r/2),i=this.elements[2*o];return i==e?2*o:i>e?2*o:i<e?2*(o+1):void 0},P.Vector.prototype.insert=function(e,t){this.upsert(e,t,function(){throw"duplicate index"})},P.Vector.prototype.upsert=function(e,t,n){this._magnitude=0;var r=this.positionForIndex(e);this.elements[r]==e?this.elements[r+1]=n(this.elements[r+1],t):this.elements.splice(r,0,e,t)},P.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,n=1;n<t;n+=2){var r=this.elements[n];e+=r*r}return this._magnitude=Math.sqrt(e)},P.Vector.prototype.dot=function(e){for(var t=0,n=this.elements,r=e.elements,o=n.length,i=r.length,a=0,s=0,c=0,l=0;c<o&&l<i;)(a=n[c])<(s=r[l])?c+=2:a>s?l+=2:a==s&&(t+=n[c+1]*r[l+1],c+=2,l+=2);return t},P.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},P.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,n=0;t<this.elements.length;t+=2,n++)e[n]=this.elements[t];return e},P.Vector.prototype.toJSON=function(){return this.elements}
|
|
||||||
/*!
|
|
||||||
* lunr.stemmer
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
|
||||||
*/,P.stemmer=(a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},s={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},c="[aeiouy]",l="[^aeiou][^aeiouy]*",u=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),h=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,g=/^(.+?)eed$/,y=/^(.+?)(ed|ing)$/,v=/.$/,b=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),x=new RegExp("^"+l+c+"[^aeiouwxy]$"),k=/^(.+?[^aeiou])y$/,O=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,_=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,E=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,S=/^(.+?)(s|t)(ion)$/,C=/^(.+?)e$/,A=/ll$/,T=new RegExp("^"+l+c+"[^aeiouwxy]$"),j=function(e){var t,n,r,o,i,c,l;if(e.length<3)return e;if("y"==(r=e.substr(0,1))&&(e=r.toUpperCase()+e.substr(1)),i=m,(o=h).test(e)?e=e.replace(o,"$1$2"):i.test(e)&&(e=e.replace(i,"$1$2")),i=y,(o=g).test(e)){var j=o.exec(e);(o=u).test(j[1])&&(o=v,e=e.replace(o,""))}else if(i.test(e)){t=(j=i.exec(e))[1],(i=d).test(t)&&(c=w,l=x,(i=b).test(e=t)?e+="e":c.test(e)?(o=v,e=e.replace(o,"")):l.test(e)&&(e+="e"))}(o=k).test(e)&&(e=(t=(j=o.exec(e))[1])+"i");(o=O).test(e)&&(t=(j=o.exec(e))[1],n=j[2],(o=u).test(t)&&(e=t+a[n]));(o=_).test(e)&&(t=(j=o.exec(e))[1],n=j[2],(o=u).test(t)&&(e=t+s[n]));if(i=S,(o=E).test(e))t=(j=o.exec(e))[1],(o=p).test(t)&&(e=t);else if(i.test(e)){t=(j=i.exec(e))[1]+j[2],(i=p).test(t)&&(e=t)}(o=C).test(e)&&(t=(j=o.exec(e))[1],i=f,c=T,((o=p).test(t)||i.test(t)&&!c.test(t))&&(e=t));return i=p,(o=A).test(e)&&i.test(e)&&(o=v,e=e.replace(o,"")),"y"==r&&(e=r.toLowerCase()+e.substr(1)),e},function(e){return e.update(j)}),P.Pipeline.registerFunction(P.stemmer,"stemmer")
|
|
||||||
/*!
|
|
||||||
* lunr.stopWordFilter
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.generateStopWordFilter=function(e){var t=e.reduce(function(e,t){return e[t]=t,e},{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},P.stopWordFilter=P.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),P.Pipeline.registerFunction(P.stopWordFilter,"stopWordFilter")
|
|
||||||
/*!
|
|
||||||
* lunr.trimmer
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.trimmer=function(e){return e.update(function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")})},P.Pipeline.registerFunction(P.trimmer,"trimmer")
|
|
||||||
/*!
|
|
||||||
* lunr.TokenSet
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.TokenSet=function(){this.final=!1,this.edges={},this.id=P.TokenSet._nextId,P.TokenSet._nextId+=1},P.TokenSet._nextId=1,P.TokenSet.fromArray=function(e){for(var t=new P.TokenSet.Builder,n=0,r=e.length;n<r;n++)t.insert(e[n]);return t.finish(),t.root},P.TokenSet.fromClause=function(e){return"editDistance"in e?P.TokenSet.fromFuzzyString(e.term,e.editDistance):P.TokenSet.fromString(e.term)},P.TokenSet.fromFuzzyString=function(e,t){for(var n=new P.TokenSet,r=[{node:n,editsRemaining:t,str:e}];r.length;){var o,i,a,s=r.pop();if(s.str.length>0)(i=s.str.charAt(0))in s.node.edges?o=s.node.edges[i]:(o=new P.TokenSet,s.node.edges[i]=o),1==s.str.length?o.final=!0:r.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)});if(s.editsRemaining>0&&s.str.length>1)(i=s.str.charAt(1))in s.node.edges?a=s.node.edges[i]:(a=new P.TokenSet,s.node.edges[i]=a),s.str.length<=2?a.final=!0:r.push({node:a,editsRemaining:s.editsRemaining-1,str:s.str.slice(2)});if(s.editsRemaining>0&&1==s.str.length&&(s.node.final=!0),s.editsRemaining>0&&s.str.length>=1){if("*"in s.node.edges)var c=s.node.edges["*"];else{c=new P.TokenSet;s.node.edges["*"]=c}1==s.str.length?c.final=!0:r.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.editsRemaining>0){if("*"in s.node.edges)var l=s.node.edges["*"];else{l=new P.TokenSet;s.node.edges["*"]=l}0==s.str.length?l.final=!0:r.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str})}if(s.editsRemaining>0&&s.str.length>1){var u,p=s.str.charAt(0),f=s.str.charAt(1);f in s.node.edges?u=s.node.edges[f]:(u=new P.TokenSet,s.node.edges[f]=u),1==s.str.length?u.final=!0:r.push({node:u,editsRemaining:s.editsRemaining-1,str:p+s.str.slice(2)})}}return n},P.TokenSet.fromString=function(e){for(var t=new P.TokenSet,n=t,r=!1,o=0,i=e.length;o<i;o++){var a=e[o],s=o==i-1;if("*"==a)r=!0,t.edges[a]=t,t.final=s;else{var c=new P.TokenSet;c.final=s,t.edges[a]=c,t=c,r&&(t.edges["*"]=n)}}return n},P.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var n=t.pop(),r=Object.keys(n.node.edges),o=r.length;n.node.final&&e.push(n.prefix);for(var i=0;i<o;i++){var a=r[i];t.push({prefix:n.prefix.concat(a),node:n.node.edges[a]})}}return e},P.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),n=t.length,r=0;r<n;r++){var o=t[r];e=e+o+this.edges[o].id}return e},P.TokenSet.prototype.intersect=function(e){for(var t=new P.TokenSet,n=void 0,r=[{qNode:e,output:t,node:this}];r.length;){n=r.pop();for(var o=Object.keys(n.qNode.edges),i=o.length,a=Object.keys(n.node.edges),s=a.length,c=0;c<i;c++)for(var l=o[c],u=0;u<s;u++){var p=a[u];if(p==l||"*"==l){var f=n.node.edges[p],d=n.qNode.edges[l],h=f.final&&d.final,m=void 0;p in n.output.edges?(m=n.output.edges[p]).final=m.final||h:((m=new P.TokenSet).final=h,n.output.edges[p]=m),r.push({qNode:d,output:m,node:f})}}}return t},P.TokenSet.Builder=function(){this.previousWord="",this.root=new P.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},P.TokenSet.Builder.prototype.insert=function(e){var t,n=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var r=0;r<e.length&&r<this.previousWord.length&&e[r]==this.previousWord[r];r++)n++;this.minimize(n),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(r=n;r<e.length;r++){var o=new P.TokenSet,i=e[r];t.edges[i]=o,this.uncheckedNodes.push({parent:t,char:i,child:o}),t=o}t.final=!0,this.previousWord=e},P.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},P.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var n=this.uncheckedNodes[t],r=n.child.toString();r in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[r]:(n.child._str=r,this.minimizedNodes[r]=n.child),this.uncheckedNodes.pop()}}
|
|
||||||
/*!
|
|
||||||
* lunr.Index
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},P.Index.prototype.search=function(e){return this.query(function(t){new P.QueryParser(e,t).parse()})},P.Index.prototype.query=function(e){var t=new P.Query(this.fields),n=Object.create(null),r=Object.create(null),o=Object.create(null);e.call(t,t);for(var i=0;i<t.clauses.length;i++){var a=t.clauses[i],s=null;s=a.usePipeline?this.pipeline.runString(a.term):[a.term];for(var c=0;c<s.length;c++){var l=s[c];a.term=l;for(var u=P.TokenSet.fromClause(a),p=this.tokenSet.intersect(u).toArray(),f=0;f<p.length;f++)for(var d=p[f],h=this.invertedIndex[d],m=h._index,g=0;g<a.fields.length;g++){var y=a.fields[g],v=h[y],b=Object.keys(v),w=d+"/"+y;if(void 0===r[y]&&(r[y]=new P.Vector),r[y].upsert(m,1*a.boost,function(e,t){return e+t}),!o[w]){for(var x=0;x<b.length;x++){var k,O=b[x],_=new P.FieldRef(O,y),E=v[O];void 0===(k=n[_])?n[_]=new P.MatchData(d,y,E):k.add(d,y,E)}o[w]=!0}}}}var S=Object.keys(n),C=[],A=Object.create(null);for(i=0;i<S.length;i++){var T,j=P.FieldRef.fromString(S[i]),I=j.docRef,R=this.fieldVectors[j],N=r[j.fieldName].similarity(R);if(void 0!==(T=A[I]))T.score+=N,T.matchData.combine(n[j]);else{var F={ref:I,score:N,matchData:n[j]};A[I]=F,C.push(F)}}return C.sort(function(e,t){return t.score-e.score})},P.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map(function(e){return[e,this.invertedIndex[e]]},this),t=Object.keys(this.fieldVectors).map(function(e){return[e,this.fieldVectors[e].toJSON()]},this);return{version:P.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},P.Index.load=function(e){var t={},n={},r=e.fieldVectors,o={},i=e.invertedIndex,a=new P.TokenSet.Builder,s=P.Pipeline.load(e.pipeline);e.version!=P.version&&P.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+P.version+"' does not match serialized index '"+e.version+"'");for(var c=0;c<r.length;c++){var l=(p=r[c])[0],u=p[1];n[l]=new P.Vector(u)}for(c=0;c<i.length;c++){var p,f=(p=i[c])[0],d=p[1];a.insert(f),o[f]=d}return a.finish(),t.fields=e.fields,t.fieldVectors=n,t.invertedIndex=o,t.tokenSet=a.root,t.pipeline=s,new P.Index(t)}
|
|
||||||
/*!
|
|
||||||
* lunr.Builder
|
|
||||||
* Copyright (C) 2018 Oliver Nightingale
|
|
||||||
*/,P.Builder=function(){this._ref="id",this._fields=[],this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=P.tokenizer,this.pipeline=new P.Pipeline,this.searchPipeline=new P.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},P.Builder.prototype.ref=function(e){this._ref=e},P.Builder.prototype.field=function(e){this._fields.push(e)},P.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},P.Builder.prototype.k1=function(e){this._k1=e},P.Builder.prototype.add=function(e){var t=e[this._ref];this.documentCount+=1;for(var n=0;n<this._fields.length;n++){var r=this._fields[n],o=e[r],i=this.tokenizer(o),a=this.pipeline.run(i),s=new P.FieldRef(t,r),c=Object.create(null);this.fieldTermFrequencies[s]=c,this.fieldLengths[s]=0,this.fieldLengths[s]+=a.length;for(var l=0;l<a.length;l++){var u=a[l];if(void 0==c[u]&&(c[u]=0),c[u]+=1,void 0==this.invertedIndex[u]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var f=0;f<this._fields.length;f++)p[this._fields[f]]=Object.create(null);this.invertedIndex[u]=p}void 0==this.invertedIndex[u][r][t]&&(this.invertedIndex[u][r][t]=Object.create(null));for(var d=0;d<this.metadataWhitelist.length;d++){var h=this.metadataWhitelist[d],m=u.metadata[h];void 0==this.invertedIndex[u][r][t][h]&&(this.invertedIndex[u][r][t][h]=[]),this.invertedIndex[u][r][t][h].push(m)}}}},P.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,n={},r={},o=0;o<t;o++){var i=P.FieldRef.fromString(e[o]);r[a=i.fieldName]||(r[a]=0),r[a]+=1,n[a]||(n[a]=0),n[a]+=this.fieldLengths[i]}for(o=0;o<this._fields.length;o++){var a;n[a=this._fields[o]]=n[a]/r[a]}this.averageFieldLength=n},P.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),n=t.length,r=Object.create(null),o=0;o<n;o++){for(var i=P.FieldRef.fromString(t[o]),a=i.fieldName,s=this.fieldLengths[i],c=new P.Vector,l=this.fieldTermFrequencies[i],u=Object.keys(l),p=u.length,f=0;f<p;f++){var d,h,m,g=u[f],y=l[g],v=this.invertedIndex[g]._index;void 0===r[g]?(d=P.idf(this.invertedIndex[g],this.documentCount),r[g]=d):d=r[g],h=d*((this._k1+1)*y)/(this._k1*(1-this._b+this._b*(s/this.averageFieldLength[a]))+y),m=Math.round(1e3*h)/1e3,c.insert(v,m)}e[i]=c}this.fieldVectors=e},P.Builder.prototype.createTokenSet=function(){this.tokenSet=P.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},P.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new P.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:this._fields,pipeline:this.searchPipeline})},P.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},P.MatchData=function(e,t,n){for(var r=Object.create(null),o=Object.keys(n),i=0;i<o.length;i++){var a=o[i];r[a]=n[a].slice()}this.metadata=Object.create(null),this.metadata[e]=Object.create(null),this.metadata[e][t]=r},P.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),n=0;n<t.length;n++){var r=t[n],o=Object.keys(e.metadata[r]);void 0==this.metadata[r]&&(this.metadata[r]=Object.create(null));for(var i=0;i<o.length;i++){var a=o[i],s=Object.keys(e.metadata[r][a]);void 0==this.metadata[r][a]&&(this.metadata[r][a]=Object.create(null));for(var c=0;c<s.length;c++){var l=s[c];void 0==this.metadata[r][a][l]?this.metadata[r][a][l]=e.metadata[r][a][l]:this.metadata[r][a][l]=this.metadata[r][a][l].concat(e.metadata[r][a][l])}}}},P.MatchData.prototype.add=function(e,t,n){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=n);if(t in this.metadata[e])for(var r=Object.keys(n),o=0;o<r.length;o++){var i=r[o];i in this.metadata[e][t]?this.metadata[e][t][i]=this.metadata[e][t][i].concat(n[i]):this.metadata[e][t][i]=n[i]}else this.metadata[e][t]=n},P.Query=function(e){this.clauses=[],this.allFields=e},P.Query.wildcard=new String("*"),P.Query.wildcard.NONE=0,P.Query.wildcard.LEADING=1,P.Query.wildcard.TRAILING=2,P.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=P.Query.wildcard.NONE),e.wildcard&P.Query.wildcard.LEADING&&e.term.charAt(0)!=P.Query.wildcard&&(e.term="*"+e.term),e.wildcard&P.Query.wildcard.TRAILING&&e.term.slice(-1)!=P.Query.wildcard&&(e.term=e.term+"*"),this.clauses.push(e),this},P.Query.prototype.term=function(e,t){var n=t||{};return n.term=e,this.clause(n),this},P.QueryParseError=function(e,t,n){this.name="QueryParseError",this.message=e,this.start=t,this.end=n},P.QueryParseError.prototype=new Error,P.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},P.QueryLexer.prototype.run=function(){for(var e=P.QueryLexer.lexTeLine truncated
|
|
||||||
/*!
|
|
||||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
||||||
* Released under the MIT License.
|
|
||||||
*/var r=n(238);function o(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==o(e)&&("function"==typeof(t=e.constructor)&&(!1!==o(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}},function(e,t,n){"use strict";function r(e){return e=(e=e.split("~1").join("/")).split("~0").join("~")}e.exports={jptr:function(e,t,n){if(void 0===e)return!1;if(!t||"#"===t)return void 0!==n?n:e;if(t.indexOf("#")>=0){var o=t.split("#");if(o[0])return!1;t=o[1],t=decodeURIComponent(t.slice(1))}t.startsWith("/")&&(t=t.slice(1));for(var i=t.split("/"),a=0;a<i.length;a++){i[a]=r(i[a]);var s=void 0!==n&&a==i.length-1,c=parseInt(i[a],10);if(!Array.isArray(e)||isNaN(c)||c.toString()!==i[a]?c=Array.isArray(e)&&"-"===i[a]?-2:-1:i[a]=a>0?i[a-1]:"",-1!=c||e.hasOwnProperty(i[a]))if(c>=0)s&&(e[c]=n),e=e[c];else{if(-2===c)return s?(Array.isArray(e)&&e.push(n),n):void 0;s&&(e[i[a]]=n),e=e[i[a]]}else{if(void 0===n||"object"!=typeof e||Array.isArray(e))return!1;e[i[a]]=s?n:"0"===i[a+1]||"-"===i[a+1]?[]:{},e=e[i[a]]}}return e},jpescape:function(e){return e=(e=e.split("~").join("~0")).split("/").join("~1")},jpunescape:r}},function(e,t,n){"use strict";var r=n(35);e.exports=new r({explicit:[n(230),n(229),n(228)]})},function(e,t,n){"use strict";var r=n(233);e.exports=r},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){var r=n(12);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(50)("meta"),o=n(12),i=n(24),a=n(26).f,s=0,c=Object.isExtensible||function(){return!0},l=!n(38)(function(){return c(Object.preventExtensions({}))}),u=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!c(e))return"F";if(!t)return"E";u(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!c(e))return!0;if(!t)return!1;u(e)}return e[r].w},onFreeze:function(e){return l&&p.NEED&&c(e)&&!i(e,r)&&u(e),e}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(32);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t,n){var r=n(30),o=n(282),i=n(281),a=n(18),s=n(47),c=n(280),l={},u={};(t=e.exports=function(e,t,n,p,f){var d,h,m,g,y=f?function(){return e}:c(e),v=r(n,p,t?2:1),b=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(i(y)){for(d=s(e.length);d>b;b++)if((g=t?v(a(h=e[b])[0],h[1]):v(e[b]))===l||g===u)return g}else for(m=y.call(e);!(h=m.next()).done;)if((g=o(m,v,h.value,t))===l||g===u)return g}).BREAK=l,t.RETURN=u},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){for(var r=n(284),o=n(48),i=n(32),a=n(9),s=n(31),c=n(49),l=n(6),u=l("iterator"),p=l("toStringTag"),f=c.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=o(d),m=0;m<h.length;m++){var g,y=h[m],v=d[y],b=a[y],w=b&&b.prototype;if(w&&(w[u]||s(w,u,f),w[p]||s(w,p,y),c[y]=f,v))for(g in r)w[g]||i(w,g,r[g],!0)}},function(e,t,n){var r=n(60);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(90)("keys"),o=n(50);e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e,t,n){var r=n(39);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(18),o=n(288),i=n(81),a=n(82)("IE_PROTO"),s=function(){},c=function(){var e,t=n(89)("iframe"),r=i.length;for(t.style.display="none",n(135).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[i[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=c(),void 0===t?n:o(n,t)}},function(e,t,n){"use strict";var r=n(59),o=n(23),i=n(32),a=n(31),s=n(24),c=n(49),l=n(289),u=n(46),p=n(285),f=n(6)("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,m,g,y,v){l(n,t,m);var b,w,x,k=function(e){if(!d&&e in S)reLine truncated
|
|
||||||
/*!***************************************************
|
/*!***************************************************
|
||||||
* mark.js v8.11.1
|
* mark.js v8.11.1
|
||||||
* https://markjs.io/
|
* https://markjs.io/
|
||||||
* Copyright (c) 2014–2018, Julian Kühnel
|
* Copyright (c) 2014–2018, Julian Kühnel
|
||||||
* Released under the MIT license https://git.io/vwTVl
|
* Released under the MIT license https://git.io/vwTVl
|
||||||
*****************************************************/
|
*****************************************************/
|
||||||
e.exports=function(){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(n){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=o,this.iframesTimeout=i}return n(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(t){var n=e.filter(function(e){return e.contains(t)}).length>0;-1!==e.indexOf(t)||n||e.push(t)}),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var o=e.contentWindow;if(r=o.document,!o||!r)throw new Error("iframe inaccessible")}catch(e){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim(),r=e.contentWindow.location.href;return r===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,o=!1,i=null,a=function a(){if(!o){o=!0,clearTimeout(i);try{r.isIframeBlank(e)||(e.removeEventListener("load",a),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",a),i=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,function(){return!0},function(e){r++,n.waitForIframes(e.querySelector("html"),function(){--r||t()})},function(e){e||t()})}},{key:"forEachIframe",value:function(t,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=t.querySelectorAll("iframe"),s=a.length,c=0;a=Array.prototype.slice.call(a);var l=function(){--s<=0&&i(c)};s||l(),a.forEach(function(t){e.matches(t,o.exclude)?l():o.onIframeReady(t,function(e){n(t)&&(c++,r(e)),l()},l)})}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){var r=e.compareDocumentPosition(n),o=Node.DOCUMENT_POSITION_PRECEDING;if(r&o){if(null===t)return!0;var i=t.compareDocumentPosition(n),a=Node.DOCUMENT_POSITION_FOLLOWING;if(i&a)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode(),n=void 0;return n=null===t?e.nextNode():e.nextNode()&&e.nextNode(),{prevNode:t,node:n}}},{key:"checkIframeFilter",value:function(e,t,n,r){var o=!1,i=!1;return r.forEach(function(e,t){e.val===n&&(o=t,i=e.handled)}),this.compareNodeIframe(e,t,n)?(!1!==o||i?!1===o||i||(r[o].handled=!0):r.push({val:n,handled:!0}),!0):(!1===o&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var o=this;e.forEach(function(e){e.handled||o.getIframeContents(e.val,function(e){o.createInstanceOnIframe(e).forEachNode(t,n,r)})})}},{key:"iterateThroughNodes",value:function(e,t,n,r,o){for(var i=this,a=this.createIterator(t,e,r),s=[],c=[],l=void 0,u=void 0;void 0,p=i.getIteratorNode(a),u=p.prevNode,l=p.node;)this.iframes&&this.forEachIframe(t,function(e){return i.checkIframeFilter(l,u,e,s)},function(t){i.createInstanceOnIframe(t).forEachNode(e,function(e){return c.push(e)},r)}),c.push(l);var p;c.forEach(function(e){n(e)}),this.iframes&&this.handleOpenIframes(s,e,n,r),o()}},{key:"forEachNode",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},i=this.getContexts(),a=i.length;a||o(),i.forEach(function(i){var s=function(){r.iterateThroughNodes(e,i,t,n,function(){--a<=0&&o()})};r.iframes?r.waitForIframes(i,s):s()})}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var o=!1;return n.every(function(t){return!r.call(e,t)||(o=!0,!1)}),o}return!1}}]),e}(),i=function(){function i(e){t(this,Line truncated
|
e.exports=function(){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(n){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=o,this.iframesTimeout=i}return n(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(t){var n=e.filter(function(e){return e.contains(t)}).length>0;-1!==e.indexOf(t)||n||e.push(t)}),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var o=e.contentWindow;if(r=o.document,!o||!r)throw new Error("iframe inaccessible")}catch(e){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim(),r=e.contentWindow.location.href;return r===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,o=!1,i=null,a=function a(){if(!o){o=!0,clearTimeout(i);try{r.isIframeBlank(e)||(e.removeEventListener("load",a),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",a),i=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,function(){return!0},function(e){r++,n.waitForIframes(e.querySelector("html"),function(){--r||t()})},function(e){e||t()})}},{key:"forEachIframe",value:function(t,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=t.querySelectorAll("iframe"),s=a.length,l=0;a=Array.prototype.slice.call(a);var c=function(){--s<=0&&i(l)};s||c(),a.forEach(function(t){e.matches(t,o.exclude)?c():o.onIframeReady(t,function(e){n(t)&&(l++,r(e)),c()},c)})}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){var r=e.compareDocumentPosition(n),o=Node.DOCUMENT_POSITION_PRECEDING;if(r&o){if(null===t)return!0;var i=t.compareDocumentPosition(n),a=Node.DOCUMENT_POSITION_FOLLOWING;if(i&a)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode(),n=void 0;return n=null===t?e.nextNode():e.nextNode()&&e.nextNode(),{prevNode:t,node:n}}},{key:"checkIframeFilter",value:function(e,t,n,r){var o=!1,i=!1;return r.forEach(function(e,t){e.val===n&&(o=t,i=e.handled)}),this.compareNodeIframe(e,t,n)?(!1!==o||i?!1===o||i||(r[o].handled=!0):r.push({val:n,handled:!0}),!0):(!1===o&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var o=this;e.forEach(function(e){e.handled||o.getIframeContents(e.val,function(e){o.createInstanceOnIframe(e).forEachNode(t,n,r)})})}},{key:"iterateThroughNodes",value:function(e,t,n,r,o){for(var i=this,a=this.createIterator(t,e,r),s=[],l=[],c=void 0,u=void 0,p=function(){var e=i.getIteratorNode(a);return u=e.prevNode,c=e.node};p();)this.iframes&&this.forEachIframe(t,function(e){return i.checkIframeFilter(c,u,e,s)},function(t){i.createInstanceOnIframe(t).forEachNode(e,function(e){return l.push(e)},r)}),l.push(c);l.forEach(function(e){n(e)}),this.iframes&&this.handleOpenIframes(s,e,n,r),o()}},{key:"forEachNode",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},i=this.getContexts(),a=i.length;a||o(),i.forEach(function(i){var s=function(){r.iterateThroughNodes(e,i,t,n,function(){--a<=0&&o()})};r.iframes?r.waitForIframes(i,s):s()})}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var o=!1;return n.every(function(t){return!r.call(e,t)||(o=!0,!1)}),o}return!1}}]),e}(),i=function(){functLine truncated
|
||||||
/*
|
/*
|
||||||
object-assign
|
object-assign
|
||||||
(c) Sindre Sorhus
|
(c) Sindre Sorhus
|
||||||
@license MIT
|
@license MIT
|
||||||
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))o.call(n,l)&&(s[l]=n[l]);if(r){a=r(n);for(var u=0;u<a.length;u++)i.call(n,a[u])&&(s[a[u]]=n[a[u]])}}return s}},function(e,t,n){var r=n(136),o=n(81).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){t.f=n(6)},function(e,t,n){var r=n(57),o=n(61),i=n(37),a=n(88),s=n(24),c=n(137),l=Object.getOwnPropertyDescriptor;t.f=n(25)?l:function(e,t){if(e=i(e),t=a(t,!0),c)try{return l(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t,n){"use strict";var r=n(9),o=n(23),i=n(32),a=n(76),s=n(74),c=n(77),l=n(78),u=n(12),p=n(38),f=n(129),d=n(46),h=n(259);e.exports=function(e,t,n,m,g,y){var v=r[e],b=v,w=g?"set":"add",x=b&&b.prototype,k={},O=function(e){var t=x[e];i(x,e,"delete"==e?function(e){return!(y&&!u(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(y&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return y&&!u(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof b&&(y||x.forEach&&!p(function(){(new b).entries().next()}))){var _=new b,E=_[w](y?{}:-0,1)!=_,S=p(function(){_.has(1)}),C=f(function(e){new b(e)}),A=!y&&p(function(){for(var e=new b,t=5;t--;)e[w](t,t);return!e.has(-0)});C||((b=t(function(t,n){l(t,b,e);var r=h(new v,t,b);return void 0!=n&&c(n,g,r[w],r),r})).prototype=x,x.constructor=b),(S||A)&&(O("delete"),O("has"),g&&O("get")),(A||E)&&O(w),y&&x.clear&&delete x.clear}else b=m.getConstructor(t,e,g,w),a(b.prototype,n),s.NEED=!0;return d(b,e),k[e]=b,o(o.G+o.W+o.F*(b!=v),k),y||m.setStrong(b,e,g),b}},function(e,t,n){"use strict";var r=n(26).f,o=n(84),i=n(76),a=n(30),s=n(78),c=n(77),l=n(85),u=n(133),p=n(130),f=n(25),d=n(74).fastKey,h=n(73),m=f?"_s":"size",g=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,l){var u=e(function(e,r){s(e,u,t,"_i"),e._t=t,e._i=o(null),e._f=void 0,e._l=void 0,e[m]=0,void 0!=r&&c(r,n,e[l],e)});return i(u.prototype,{clear:function(){for(var e=h(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var n=h(this,t),r=g(n,e);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[m]--}return!!r},forEach:function(e){h(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!g(h(this,t),e)}}),f&&r(u.prototype,"size",{get:function(){return h(this,t)[m]}}),u},def:function(e,t,n){var r,o,i=g(e,t);return i?i.v=n:(e._l=i={i:o=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=i),r&&(r.n=i),e[m]++,"F"!==o&&(e._i[o]=i)),e},getEntry:g,setStrong:function(e,t,n){l(e,t,function(e,n){this._t=h(e,t),this._k=n,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?u(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,u(1))},n?"entries":"values",!n,!0),p(t)}}},function(e,t,n){var r=n(39);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(6)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(269),o=n(60);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(6)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},e(i)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(9),o=n(26),i=n(25),a=n(6)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(58);e.exports.f=function(e){return new function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)}(e)}},function(e,t,n){var r,o,i,a=n(30),s=nLine truncated
|
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]))o.call(n,c)&&(s[c]=n[c]);if(r){a=r(n);for(var u=0;u<a.length;u++)i.call(n,a[u])&&(s[a[u]]=n[a[u]])}}return s}},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,i,a,s,l){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,i,a,s,l],p=0;(c=new Error(t.replace(/%s/g,function(){return u[p++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(212),o=n(213),i=n(236),a=n(237),s=n(238),l=n(243);function c(e){u(this,c.defaults),u(this,e)}function u(e,t){if(p(t))for(var n=Object.keys(t),r=0;r<n.length;r++){var o=n[r],i=t[o],a=e[o];p(i)?e[o]=u(a||{},i):void 0!==i&&(e[o]=i)}return e}function p(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}e.exports=c,c.defaults={parse:{json:r,yaml:o,text:i,binary:a},resolve:{file:s,http:l,external:!0},dereference:{circular:!0}}},function(e,t,n){"use strict";var r=n(81),o=n(32);e.exports={parse:function(e,t){try{return r.safeLoad(e)}catch(e){throw e instanceof Error?e:o(e,e.message)}},stringify:function(e,t,n){try{var i=("string"==typeof n?n.length:n)||2;return r.safeDump(e,{indent:i})}catch(e){throw e instanceof Error?e:o(e,e.message)}}}},function(e,t,n){"use strict";var r=n(37);e.exports=new r({include:[n(117)]})},function(e,t,n){"use strict";var r=n(37);e.exports=new r({include:[n(82)],implicit:[n(220),n(221),n(222),n(223)]})},function(e,t,n){(function(e){var r=n(244),o=n(120),i=n(253),a=n(254),s=n(15),l=t;l.request=function(t,n){t="string"==typeof t?s.parse(t):i(t);var o=-1===e.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||o,l=t.hostname||t.host,c=t.port,u=t.path||"/";l&&-1!==l.indexOf(":")&&(l="["+l+"]"),t.url=(l?a+"//"+l:"")+(c?":"+c:"")+u,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var p=new r(t);return n&&p.on("response",n),p},l.get=function(e,t){var n=l.request(e,t);return n.end(),n},l.ClientRequest=r,l.IncomingMessage=o.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=a,l.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(8))},function(e,t,n){(function(e){t.fetch=s(e.fetch)&&s(e.ReadableStream),t.writableStream=s(e.WritableStream),t.abortController=s(e.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch(e){}var n;function r(){if(void 0!==n)return n;if(e.XMLHttpRequest){n=new e.XMLHttpRequest;try{n.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function o(e){var t=r();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var i=void 0!==e.ArrayBuffer,a=i&&s(e.ArrayBuffer.prototype.slice);function s(e){return"function"==typeof e}t.arraybuffer=t.fetch||i&&o("arraybuffer"),t.msstream=!t.fetch&&a&&o("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&i&&o("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!r()&&s(r().overrideMimeType),t.vbArray=s(e.VBArray),n=null}).call(this,n(8))},function(e,t,n){(function(e,r,o){var i=n(119),a=n(26),s=n(121),l=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(t,n,a,l){var c=this;if(s.Readable.call(c),c._mode=a,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){e.nextTick(function(){c.emit("close")})}),"fetch"===a){if(c._fetchResponse=n,c.url=n.url,c.statusCode=n.status,c.statusMessage=Line truncated
|
||||||
/*!
|
/** @license React v16.4.2
|
||||||
* perfect-scrollbar v1.3.0
|
* react.production.min.js
|
||||||
* (c) 2017 Hyunje Jun
|
*
|
||||||
* @license MIT
|
* Copyright (c) 2013-present, Facebook, Inc.
|
||||||
*/
|
*
|
||||||
function Oo(e){return getComputedStyle(e)}function _o(e,t){for(var n in t){var r=t[n];"number"==typeof r&&(r+="px"),e.style[n]=r}return e}function Eo(e){var t=document.createElement("div");return t.className=e,t}var So="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.msMatchesSelector);function Co(e,t){if(!So)throw new Error("No element matching method supported");return So.call(e,t)}function Ao(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function To(e,t){return Array.prototype.filter.call(e.children,function(e){return Co(e,t)})}var jo={main:"ps",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},Po={x:null,y:null};function Io(e,t){var n=e.element.classList,r=jo.state.scrolling(t);n.contains(r)?clearTimeout(Po[t]):n.add(r)}function Ro(e,t){Po[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(jo.state.scrolling(t))},e.settings.scrollingThreshold)}var No=function(e){this.element=e,this.handlers={}},Fo={isEmpty:{configurable:!0}};No.prototype.bind=function(e,t){void 0===this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)},No.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(r){return!(!t||r===t)||(n.element.removeEventListener(e,r,!1),!1)})},No.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)},Fo.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return 0===e.handlers[t].length})},Object.defineProperties(No.prototype,Fo);var Lo=function(){this.eventElements=[]};function Mo(e){if("function"==typeof window.CustomEvent)return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}Lo.prototype.eventElement=function(e){var t=this.eventElements.filter(function(t){return t.element===e})[0];return t||(t=new No(e),this.eventElements.push(t)),t},Lo.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)},Lo.prototype.unbind=function(e,t,n){var r=this.eventElement(e);r.unbind(t,n),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)},Lo.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]},Lo.prototype.once=function(e,t,n){var r=this.eventElement(e),o=function(e){r.unbind(t,o),n(e)};r.bind(t,o)};var Do=function(e,t,n,r,o){var i;if(void 0===r&&(r=!0),void 0===o&&(o=!1),"top"===t)i=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==t)throw new Error("A proper axis should be provided");i=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(e,t,n,r,o){var i=n[0],a=n[1],s=n[2],c=n[3],l=n[4],u=n[5];void 0===r&&(r=!0);void 0===o&&(o=!1);var p=e.element;e.reach[c]=null,p[s]<1&&(e.reach[c]="start");p[s]>e[i]-e[a]-1&&(e.reach[c]="end");t&&(p.dispatchEvent(Mo("ps-scroll-"+c)),t<0?p.dispatchEvent(Mo("ps-scroll-"+l)):t>0&&p.dispatchEvent(Mo("ps-scroll-"+u)),r&&function(e,t){Io(e,t),Ro(e,t)}(e,c));e.reach[c]&&(t||o)&&p.dispatchEvent(Mo("ps-"+c+"-reach-"+e.reach[c]))}(e,n,i,r,o)};function Bo(e){return parseInt(e,10)||0}var Uo={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},zo=function(e){var t=e.element;e.containerWidth=t.clientWidth,e.containerHeight=t.clientHeight,e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(To(t,jo.element.rail("x")).forEach(function(e){return Ao(e)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(To(t,jo.element.rail("y")).forEach(function(e){return Ao(e)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset<e.contentWidth?(e.scrollbarXActive=!0,e.railXWidth=e.containerWidth-e.railXMarginWidth,e.railXRatio=e.containerWidth/e.railXWidth,e.scrollbarXWidth=$o(e,Bo(e.railXWidth*e.containerWidth/e.contentWidth)),e.scrollbarXLeft=Bo((e.negativeScrollAdjustment+t.scrollLeft)*(e.railXWidth-e.scrollbarXWidth)/(e.contentWidth-e.containerWidth))):e.scrollbarXActive=!1,!e.settings.suppressScrollY&&e.containerHeight+e.settings.scrollYMarginOffset<e.contentHeight?(e.scrollbarYActive=!0,e.railYHeight=e.containerHeight-e.railYMarginHeight,e.railYRatio=e.containerHeight/e.railYHeight,e.scrollbarYHeight=$o(e,Bo(e.railYHeight*e.containerHeight/e.contentHeight)),e.scrollbarYTop=Bo(t.scrollTop*(e.railYHeight-e.scrollbarYHeight)/(e.contentHeight-e.containerHeight)Line truncated
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/var r=n(109),o=n(110),i=n(111),a=n(112),s="function"==typeof Symbol&&Symbol.for,l=s?Symbol.for("react.element"):60103,c=s?Symbol.for("react.portal"):60106,u=s?Symbol.for("react.fragment"):60107,p=s?Symbol.for("react.strict_mode"):60108,f=s?Symbol.for("react.profiler"):60114,d=s?Symbol.for("react.provider"):60109,h=s?Symbol.for("react.context"):60110,m=s?Symbol.for("react.async_mode"):60111,g=s?Symbol.for("react.forward_ref"):60112;s&&Symbol.for("react.timeout");var v="function"==typeof Symbol&&Symbol.iterator;function y(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);o(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function w(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}function x(){}function k(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&y("85"),this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=w.prototype;var E=k.prototype=new x;E.constructor=k,r(E,w.prototype),E.isPureReactComponent=!0;var _={current:null},S=Object.prototype.hasOwnProperty,O={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,n){var r=void 0,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)S.call(t,r)&&!O.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===o[r]&&(o[r]=s[r]);return{$$typeof:l,type:e,key:i,ref:a,props:o,_owner:_.current}}function T(e){return"object"==typeof e&&null!==e&&e.$$typeof===l}var A=/\/+/g,P=[];function I(e,t,n,r){if(P.length){var o=P.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function R(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>P.length&&P.push(e)}function j(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var i=!1;if(null===e)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case l:case c:i=!0}}if(i)return n(r,e,""===t?"."+N(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;a<e.length;a++){var s=t+N(o=e[a],a);i+=j(o,s,n,r)}else if(null===e||void 0===e?s=null:s="function"==typeof(s=v&&e[v]||e["@@iterator"])?s:null,"function"==typeof s)for(e=s.call(e),a=0;!(o=e.next()).done;)i+=j(o=o.value,s=t+N(o,a++),n,r);else"object"===o&&y("31","[object Object]"===(n=""+e)?"object with keys {"+Object.keys(e).join(", ")+"}":n,"");return i}function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function L(e,t){e.func.call(e.context,t,e.count++)}function M(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?D(e,r,n,a.thatReturnsArgument):null!=e&&(T(e)&&(t=o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(A,"$&/")+"/")+n,e={$$typeof:l,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function D(e,t,n,r,o){var i="";null!=n&&(i=(""+n).replace(A,"$&/")+"/"),t=I(t,i,r,o),null==e||j(e,"",M,t),R(t)}var F={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return D(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=I(null,null,t,n),null==e||j(e,"",L,t),R(t)},count:function(e){return null==e?0:j(e,"",a.thatReturnsNull,null)},toArray:function(e){var t=[];return D(e,t,null,a.thatReturnsArgument),t},only:function(e){return T(e)||y("143"),e}},createRef:function(){return{current:null}},Component:w,PureComponent:k,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:h,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null}).Provider={$$typeof:d,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:g,render:e}},Fragment:u,StrictMode:p,unstable_AsyncMode:m,unstable_Profiler:f,createElement:C,cloneElement:function(e,t,n){(null===e||void 0===e)&&y("267",e);var o=void 0,i=r({},e.props),a=e.key,s=e.ref,c=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,c=_.current),void 0!==t.key&&(a=""+t.key);var u=void 0;for(o in e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)S.call(t,o)&&!O.hasOwnProperty(o)&&(i[o]=void 0===t[o]&&void 0!==u?u[o]:t[o])}if(1===(o=arguments.length-2))i.children=n;else if(1<o){u=Array(o);for(var p=0;p<o;p++)u[p]=arguments[p+2];i.children=Line truncated
|
||||||
|
/** @license React v16.4.2
|
||||||
|
* react-dom.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/var r=n(110),o=n(0),i=n(193),a=n(109),s=n(112),l=n(194),c=n(195),u=n(196),p=n(111);function f(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);r(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}o||f("227");var d={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,invokeGuardedCallback:function(e,t,n,r,o,i,a,s,l){(function(e,t,n,r,o,i,a,s,l){this._hasCaughtError=!1,this._caughtError=null;var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this._caughtError=e,this._hasCaughtError=!0}}).apply(d,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,o,i,a,s,l){if(d.invokeGuardedCallback.apply(this,arguments),d.hasCaughtError()){var c=d.clearCaughtError();d._hasRethrowError||(d._hasRethrowError=!0,d._rethrowError=c)}},rethrowCaughtError:function(){return function(){if(d._hasRethrowError){var e=d._rethrowError;throw d._rethrowError=null,d._hasRethrowError=!1,e}}.apply(d,arguments)},hasCaughtError:function(){return d._hasCaughtError},clearCaughtError:function(){if(d._hasCaughtError){var e=d._caughtError;return d._caughtError=null,d._hasCaughtError=!1,e}f("198")}};var h=null,m={};function g(){if(h)for(var e in m){var t=m[e],n=h.indexOf(e);if(-1<n||f("96",e),!y[n])for(var r in t.extractEvents||f("97",e),y[n]=t,n=t.eventTypes){var o=void 0,i=n[r],a=t,s=r;b.hasOwnProperty(s)&&f("99",s),b[s]=i;var l=i.phasedRegistrationNames;if(l){for(o in l)l.hasOwnProperty(o)&&v(l[o],a,s);o=!0}else i.registrationName?(v(i.registrationName,a,s),o=!0):o=!1;o||f("98",r,e)}}}function v(e,t,n){w[e]&&f("100",e),w[e]=t,x[e]=t.eventTypes[n].dependencies}var y=[],b={},w={},x={};function k(e){h&&f("101"),h=Array.prototype.slice.call(e),g()}function E(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];m.hasOwnProperty(t)&&m[t]===r||(m[t]&&f("102",t),m[t]=r,n=!0)}n&&g()}var _={plugins:y,eventNameDispatchConfigs:b,registrationNameModules:w,registrationNameDependencies:x,possibleRegistrationNames:null,injectEventPluginOrder:k,injectEventPluginsByName:E},S=null,O=null,C=null;function T(e,t,n,r){t=e.type||"unknown-event",e.currentTarget=C(r),d.invokeGuardedCallbackAndCatchFirstError(t,n,void 0,e),e.currentTarget=null}function A(e,t){return null==t&&f("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function P(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var I=null;function R(e,t){if(e){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)T(e,t,n[o],r[o]);else n&&T(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function j(e){return R(e,!0)}function N(e){return R(e,!1)}var L={injectEventPluginOrder:k,injectEventPluginsByName:E};function M(e,t){var n=e.stateNode;if(!n)return null;var r=S(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}return e?null:(n&&"function"!=typeof n&&f("231",t,typeof n),n)}function D(e,t){null!==e&&(I=A(I,e)),e=I,I=null,e&&(P(e,t?j:N),I&&f("95"),d.rethrowCaughtError())}function F(e,t,n,r){for(var o=null,i=0;i<y.length;i++){var a=y[i];a&&(a=a.extractEvents(e,t,n,r))&&(o=A(o,a))}D(o,!1)}var U={injection:L,getListener:M,runEventsInBatch:D,runExtractedEventsInBatch:F},B=Math.random().toString(36).slice(2),z="__reactInternalInstance$"+B,$="__reactEventHandlers$"+B;function W(e){if(e[z])return e[z];for(;!e[z];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[z]).tag||6===e.tag?e:null}function q(e){if(5===e.tag||6===e.tag)return e.stateNode;f("33")}function H(e){return e[$]||null}var Y={precacheFiberNode:function(e,t){t[z]=e},getClosestInstanceFromNode:W,getInstanceFromNode:function(e){return!(e=e[z])||5!==e.tag&&6!==e.tag?null:e},getNodeFromInstance:q,getFiberCurrentPropsFromNode:H,updateFiberProps:function(e,t){e[$]=t}};function V(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Q(e,t,n){for(var r=[];e;)r.push(e),e=V(e);for(e=r.length;0<e--;)t(r[e],"captured",n);for(e=0;e<r.length;e++)t(r[e],"bubbled",n)}function X(e,t,n){(t=M(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=A(n._dispatchListeners,t),n._dispatchInstances=A(n._dispatchInstances,e))}function G(e){e&&e.dispatchConfig.phasedRegistrationNames&&Q(e._targetInst,X,e)}function K(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst;Q(t=t?V(t):null,X,e)}}function J(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=M(e,Line truncated
|
||||||
|
/** @license React v16.4.2
|
||||||
|
* react-is.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.timeout"):60113;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case a:case l:case s:return e;default:switch(e=e&&e.$$typeof){case u:case f:case c:return e;default:return t}}case i:return t}}}t.typeOf=h,t.AsyncMode=p,t.ContextConsumer=u,t.ContextProvider=c,t.Element=o,t.ForwardRef=f,t.Fragment=a,t.Profiler=l,t.Portal=i,t.StrictMode=s,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===l||e===s||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===c||e.$$typeof===u||e.$$typeof===f)},t.isAsyncMode=function(e){return h(e)===p},t.isContextConsumer=function(e){return h(e)===u},t.isContextProvider=function(e){return h(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return h(e)===f},t.isFragment=function(e){return h(e)===a},t.isProfiler=function(e){return h(e)===l},t.isPortal=function(e){return h(e)===i},t.isStrictMode=function(e){return h(e)===s}},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=c(e),r=n[0],a=n[1],s=new i(function(e,t,n){return 3*(t+n)/4-n}(0,r,a)),l=0,u=a>0?r-4:r,p=0;p<u;p+=4)t=o[e.charCodeAt(p)]<<18|o[e.charCodeAt(p+1)]<<12|o[e.charCodeAt(p+2)]<<6|o[e.charCodeAt(p+3)],s[l++]=t>>16&255,s[l++]=t>>8&255,s[l++]=255&t;2===a&&(t=o[e.charCodeAt(p)]<<2|o[e.charCodeAt(p+1)]>>4,s[l++]=255&t);1===a&&(t=o[e.charCodeAt(p)]<<10|o[e.charCodeAt(p+1)]<<4|o[e.charCodeAt(p+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(p(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function p(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(u(r));return o.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,p=n?o-1:0,f=n?-1:1,d=e[t+p];for(p+=f,i=d&(1<<-u)-1,d>>=-u,u+=s;u>0;i=256*i+e[t+p],p+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+p],p+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),i-=c}return(d?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,p=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+p>=1?f/l:f*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=u?(s=0,a=u):a+p>=1?(s=(t*l-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[n+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+d]=255&a,d+=h,a/=256,c-=8);e[n+d-h]|=128*m}},function(e,t,n){"use strict";(function(t){e.exports={order:100,allowEmpty:!0,canParse:".json",parse:function(e){return new Promise(function(n,r){var o=e.data;t.isBuffer(o)&&(o=o.toString()),"string"==typeof o?0===o.trim().length?n(void 0):n(JSON.parse(o)):n(o)})}}}).call(this,n(14).Buffer)},function(e,t,n){"use strict";(function(t){var r=n(115);e.exports={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],parse:function(e){return new Promise(function(n,o){var i=e.data;t.isBuffer(i)&&(i=i.toString()),n("string"==typeof i?r.parse(i):i)})}}}).call(this,n(14).Buffer)},function(e,t,n){"use strict";var r=n(215),o=n(234);function i(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(7),e.exports.Schema=n(37),e.exports.FAILSAFE_SCHEMA=n(82),e.exports.JSON_SCHEMA=n(117),e.exports.CORE_SCHEMA=n(116),e.exports.DEFAULT_SAFE_SCHEMA=n(56),e.exports.DEFAULT_FULL_SCHEMA=n(83),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=n(55),e.exports.MINIMAL_SCHEMA=n(82),e.exports.SAFE_SCHEMA=n(56),e.exportLine truncated
|
||||||
/*!
|
/*!
|
||||||
* Stickyfill -- `position: sticky` polyfill
|
* Stickyfill -- `position: sticky` polyfill
|
||||||
* v. 1.1.1 | https://github.com/wilddeer/stickyfill
|
* v. 1.1.1 | https://github.com/wilddeer/stickyfill
|
||||||
@@ -115,27 +96,11 @@ function Oo(e){return getComputedStyle(e)}function _o(e,t){for(var n in t){var r
|
|||||||
*
|
*
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
e.exports=function(e,t){e||(e=document),t||(t=window);var n,r,o=[],i=!1,a=e.documentElement,s=function(){},c="hidden",l="visibilitychange";void 0!==e.webkitHidden&&(c="webkitHidden",l="webkitvisibilitychange"),t.getComputedStyle||d();for(var u=["","-webkit-","-moz-","-ms-"],p=document.createElement("div"),f=u.length-1;f>=0;f--){try{p.style.position=u[f]+"sticky"}catch(e){}""!=p.style.position&&d()}function d(){j=F=P=I=R=N=s}function h(e){return parseFloat(e)||0}function m(){n={top:t.pageYOffset,left:t.pageXOffset}}function g(){if(t.pageXOffset!=n.left)return m(),void P();t.pageYOffset!=n.top&&(m(),v())}function y(e){setTimeout(function(){t.pageYOffset!=n.top&&(n.top=t.pageYOffset,v())},0)}function v(){for(var e=o.length-1;e>=0;e--)b(o[e])}function b(e){if(e.inited){var t=n.top<=e.limit.start?0:n.top>=e.limit.end?2:1;e.mode!=t&&function(e,t){var n=e.node.style;switch(t){case 0:n.position="absolute",n.left=e.offset.left+"px",n.right=e.offset.right+"px",n.top=e.offset.top+"px",n.bottom="auto",n.width="auto",n.marginLeft=0,n.marginRight=0,n.marginTop=0;break;case 1:n.position="fixed",n.left=e.box.left+"px",n.right=e.box.right+"px",n.top=e.css.top,n.bottom="auto",n.width="auto",n.marginLeft=0,n.marginRight=0,n.marginTop=0;break;case 2:n.position="absolute",n.left=e.offset.left+"px",n.right=e.offset.right+"px",n.top="auto",n.bottom=0,n.width="auto",n.marginLeft=0,n.marginRight=0}e.mode=t}(e,t)}}function w(e){isNaN(parseFloat(e.computed.top))||e.isCell||(e.inited=!0,e.clone||function(e){e.clone=document.createElement("div");var t=e.node.nextSibling||e.node,n=e.clone.style;n.height=e.height+"px",n.width=e.width+"px",n.marginTop=e.computed.marginTop,n.marginBottom=e.computed.marginBottom,n.marginLeft=e.computed.marginLeft,n.marginRight=e.computed.marginRight,n.padding=n.border=n.borderSpacing=0,n.fontSize="1em",n.position="static",n.cssFloat=e.computed.cssFloat,e.node.parentNode.insertBefore(e.clone,t)}(e),"absolute"!=e.parent.computed.position&&"relative"!=e.parent.computed.position&&(e.parent.node.style.position="relative"),b(e),e.parent.height=e.parent.node.offsetHeight,e.docOffsetTop=E(e.clone))}function x(e){var t=!0;e.clone&&function(e){e.clone.parentNode.removeChild(e.clone),e.clone=void 0}(e),function(e,t){for(key in t)t.hasOwnProperty(key)&&(e[key]=t[key])}(e.node.style,e.css);for(var n=o.length-1;n>=0;n--)if(o[n].node!==e.node&&o[n].parent.node===e.parent.node){t=!1;break}t&&(e.parent.node.style.position=e.parent.css.position),e.mode=-1}function k(){for(var e=o.length-1;e>=0;e--)w(o[e])}function O(){for(var e=o.length-1;e>=0;e--)x(o[e])}function _(e){var t=getComputedStyle(e),n=e.parentNode,r=getComputedStyle(n),o=e.style.position;e.style.position="relative";var i={top:t.top,marginTop:t.marginTop,marginBottom:t.marginBottom,marginLeft:t.marginLeft,marginRight:t.marginRight,cssFloat:t.cssFloat},s={top:h(t.top),marginBottom:h(t.marginBottom),paddingLeft:h(t.paddingLeft),paddingRight:h(t.paddingRight),borderLeftWidth:h(t.borderLeftWidth),borderRightWidth:h(t.borderRightWidth)};e.style.position=o;var c={position:e.style.position,top:e.style.top,bottom:e.style.bottom,left:e.style.left,right:e.style.right,width:e.style.width,marginTop:e.style.marginTop,marginLeft:e.style.marginLeft,marginRight:e.style.marginRight},l=S(e),u=S(n),p={node:n,css:{position:n.style.position},computed:{position:r.position},numeric:{borderLeftWidth:h(r.borderLeftWidth),borderRightWidth:h(r.borderRightWidth),borderTopWidth:h(r.borderTopWidth),borderBottomWidth:h(r.borderBottomWidth)}};return{node:e,box:{left:l.win.left,right:a.clientWidth-l.win.right},offset:{top:l.win.top-u.win.top-p.numeric.borderTopWidth,left:l.win.left-u.win.left-p.numeric.borderLeftWidth,right:-l.win.right+u.win.right-p.numeric.borderRightWidth},css:c,isCell:"table-cell"==t.display,computed:i,numeric:s,width:l.win.right-l.win.left,height:l.win.bottom-l.win.top,mode:-1,inited:!1,parent:p,limit:{start:l.doc.top-s.top,end:u.doc.top+n.offsetHeight-p.numeric.borderBottomWidth-e.offsetHeight-s.top-s.marginBottom}}}function E(e){for(var t=0;e;)t+=e.offsetTop,e=e.offsetParent;return t}function S(e){var n=e.getBoundingClientRect();return{doc:{top:n.top+t.pageYOffset,left:n.left+t.pageXOffset},win:n}}function C(){r=setInterval(function(){!function(){for(var e=o.length-1;e>=0;e--)if(o[e].inited){var t=Math.abs(E(o[e].clone)-o[e].docOffsetTop),n=Math.abs(o[e].parent.node.offsetHeight-o[e].parent.height);if(t>=2||n>=2)return!1}return!0}()&&P()},500)}function A(){clearInterval(r)}function T(){i&&(document[c]?A():C())}function j(){i||(m(),k(),t.addEventListener("scroll",g),t.addEventListener("wheel",y),t.addEventListener("resize",P),t.addEventListener("orientationchange",P),e.addEventListener(l,T),C(),i=!0)}function P(){if(i){O();for(var e=o.length-1;e>=0;e--)o[e]=_(o[e].node);k()}}function I(){t.removeEventListener("scroll",g),t.removeEventListener("wheel",y),t.removeEventListener("resize",P),t.removeEventListener("orientationchange",P),e.removeEventListener(l,T),A(),i=!1}functiLine truncated
|
e.exports=function(e,t){e||(e=document),t||(t=window);var n,r,o=[],i=!1,a=e.documentElement,s=function(){},l="hidden",c="visibilitychange";void 0!==e.webkitHidden&&(l="webkitHidden",c="webkitvisibilitychange"),t.getComputedStyle||d();for(var u=["","-webkit-","-moz-","-ms-"],p=document.createElement("div"),f=u.length-1;f>=0;f--){try{p.style.position=u[f]+"sticky"}catch(e){}""!=p.style.position&&d()}function d(){P=L=I=R=j=N=s}function h(e){return parseFloat(e)||0}function m(){n={top:t.pageYOffset,left:t.pageXOffset}}function g(){if(t.pageXOffset!=n.left)return m(),void I();t.pageYOffset!=n.top&&(m(),y())}function v(e){setTimeout(function(){t.pageYOffset!=n.top&&(n.top=t.pageYOffset,y())},0)}function y(){for(var e=o.length-1;e>=0;e--)b(o[e])}function b(e){if(e.inited){var t=n.top<=e.limit.start?0:n.top>=e.limit.end?2:1;e.mode!=t&&function(e,t){var n=e.node.style;switch(t){case 0:n.position="absolute",n.left=e.offset.left+"px",n.right=e.offset.right+"px",n.top=e.offset.top+"px",n.bottom="auto",n.width="auto",n.marginLeft=0,n.marginRight=0,n.marginTop=0;break;case 1:n.position="fixed",n.left=e.box.left+"px",n.right=e.box.right+"px",n.top=e.css.top,n.bottom="auto",n.width="auto",n.marginLeft=0,n.marginRight=0,n.marginTop=0;break;case 2:n.position="absolute",n.left=e.offset.left+"px",n.right=e.offset.right+"px",n.top="auto",n.bottom=0,n.width="auto",n.marginLeft=0,n.marginRight=0}e.mode=t}(e,t)}}function w(e){isNaN(parseFloat(e.computed.top))||e.isCell||(e.inited=!0,e.clone||function(e){e.clone=document.createElement("div");var t=e.node.nextSibling||e.node,n=e.clone.style;n.height=e.height+"px",n.width=e.width+"px",n.marginTop=e.computed.marginTop,n.marginBottom=e.computed.marginBottom,n.marginLeft=e.computed.marginLeft,n.marginRight=e.computed.marginRight,n.padding=n.border=n.borderSpacing=0,n.fontSize="1em",n.position="static",n.cssFloat=e.computed.cssFloat,e.node.parentNode.insertBefore(e.clone,t)}(e),"absolute"!=e.parent.computed.position&&"relative"!=e.parent.computed.position&&(e.parent.node.style.position="relative"),b(e),e.parent.height=e.parent.node.offsetHeight,e.docOffsetTop=S(e.clone))}function x(e){var t=!0;e.clone&&function(e){e.clone.parentNode.removeChild(e.clone),e.clone=void 0}(e),function(e,t){for(key in t)t.hasOwnProperty(key)&&(e[key]=t[key])}(e.node.style,e.css);for(var n=o.length-1;n>=0;n--)if(o[n].node!==e.node&&o[n].parent.node===e.parent.node){t=!1;break}t&&(e.parent.node.style.position=e.parent.css.position),e.mode=-1}function k(){for(var e=o.length-1;e>=0;e--)w(o[e])}function E(){for(var e=o.length-1;e>=0;e--)x(o[e])}function _(e){var t=getComputedStyle(e),n=e.parentNode,r=getComputedStyle(n),o=e.style.position;e.style.position="relative";var i={top:t.top,marginTop:t.marginTop,marginBottom:t.marginBottom,marginLeft:t.marginLeft,marginRight:t.marginRight,cssFloat:t.cssFloat},s={top:h(t.top),marginBottom:h(t.marginBottom),paddingLeft:h(t.paddingLeft),paddingRight:h(t.paddingRight),borderLeftWidth:h(t.borderLeftWidth),borderRightWidth:h(t.borderRightWidth)};e.style.position=o;var l={position:e.style.position,top:e.style.top,bottom:e.style.bottom,left:e.style.left,right:e.style.right,width:e.style.width,marginTop:e.style.marginTop,marginLeft:e.style.marginLeft,marginRight:e.style.marginRight},c=O(e),u=O(n),p={node:n,css:{position:n.style.position},computed:{position:r.position},numeric:{borderLeftWidth:h(r.borderLeftWidth),borderRightWidth:h(r.borderRightWidth),borderTopWidth:h(r.borderTopWidth),borderBottomWidth:h(r.borderBottomWidth)}};return{node:e,box:{left:c.win.left,right:a.clientWidth-c.win.right},offset:{top:c.win.top-u.win.top-p.numeric.borderTopWidth,left:c.win.left-u.win.left-p.numeric.borderLeftWidth,right:-c.win.right+u.win.right-p.numeric.borderRightWidth},css:l,isCell:"table-cell"==t.display,computed:i,numeric:s,width:c.win.right-c.win.left,height:c.win.bottom-c.win.top,mode:-1,inited:!1,parent:p,limit:{start:c.doc.top-s.top,end:u.doc.top+n.offsetHeight-p.numeric.borderBottomWidth-e.offsetHeight-s.top-s.marginBottom}}}function S(e){for(var t=0;e;)t+=e.offsetTop,e=e.offsetParent;return t}function O(e){var n=e.getBoundingClientRect();return{doc:{top:n.top+t.pageYOffset,left:n.left+t.pageXOffset},win:n}}function C(){r=setInterval(function(){!function(){for(var e=o.length-1;e>=0;e--)if(o[e].inited){var t=Math.abs(S(o[e].clone)-o[e].docOffsetTop),n=Math.abs(o[e].parent.node.offsetHeight-o[e].parent.height);if(t>=2||n>=2)return!1}return!0}()&&I()},500)}function T(){clearInterval(r)}function A(){i&&(document[l]?T():C())}function P(){i||(m(),k(),t.addEventListener("scroll",g),t.addEventListener("wheel",v),t.addEventListener("resize",I),t.addEventListener("orientationchange",I),e.addEventListener(c,A),C(),i=!0)}function I(){if(i){E();for(var e=o.length-1;e>=0;e--)o[e]=_(o[e].node);k()}}function R(){t.removeEventListener("scroll",g),t.removeEventListener("wheel",v),t.removeEventListener("resize",I),t.removeEventListener("orientationchange",I),e.removeEventListener(c,A),T(),i=!1}functiLine truncated
|
||||||
/*!
|
/*!
|
||||||
* isobject <https://github.com/jonschlinkert/isobject>
|
* perfect-scrollbar v1.4.0
|
||||||
*
|
* (c) 2018 Hyunje Jun
|
||||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
* @license MIT
|
||||||
* Released under the MIT License.
|
*/
|
||||||
*/e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,i,a,s,c){if(r(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,i,a,s,c],p=0;(l=new Error(t.replace(/%s/g,function(){return u[p++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,n){"use strict";var r=n(72),o=n(241),i=n(240);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},function(e,t,n){"use strict";var r=n(243);e.exports=function(e){return r(e)&&3==e.nodeType}},function(e,t,n){"use strict";var r=n(244);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!r.call(t,n[a])||!o(e[n[a]],t[n[a]]))return!1;return!0}},function(e,t,n){"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=o},function(e,t,n){"use strict";
|
function kn(e){return getComputedStyle(e)}function En(e,t){for(var n in t){var r=t[n];"number"==typeof r&&(r+="px"),e.style[n]=r}return e}function _n(e){var t=document.createElement("div");return t.className=e,t}var Sn="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function On(e,t){if(!Sn)throw new Error("No element matching method supported");return Sn.call(e,t)}function Cn(e){e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)}function Tn(e,t){return Array.prototype.filter.call(e.children,function(e){return On(e,t)})}var An={main:"ps",element:{thumb:function(e){return"ps__thumb-"+e},rail:function(e){return"ps__rail-"+e},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(e){return"ps--active-"+e},scrolling:function(e){return"ps--scrolling-"+e}}},Pn={x:null,y:null};function In(e,t){var n=e.element.classList,r=An.state.scrolling(t);n.contains(r)?clearTimeout(Pn[t]):n.add(r)}function Rn(e,t){Pn[t]=setTimeout(function(){return e.isAlive&&e.element.classList.remove(An.state.scrolling(t))},e.settings.scrollingThreshold)}var jn=function(e){this.element=e,this.handlers={}},Nn={isEmpty:{configurable:!0}};jn.prototype.bind=function(e,t){void 0===this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t),this.element.addEventListener(e,t,!1)},jn.prototype.unbind=function(e,t){var n=this;this.handlers[e]=this.handlers[e].filter(function(r){return!(!t||r===t)||(n.element.removeEventListener(e,r,!1),!1)})},jn.prototype.unbindAll=function(){for(var e in this.handlers)this.unbind(e)},Nn.isEmpty.get=function(){var e=this;return Object.keys(this.handlers).every(function(t){return 0===e.handlers[t].length})},Object.defineProperties(jn.prototype,Nn);var Ln=function(){this.eventElements=[]};function Mn(e){if("function"==typeof window.CustomEvent)return new CustomEvent(e);var t=document.createEvent("CustomEvent");return t.initCustomEvent(e,!1,!1,void 0),t}Ln.prototype.eventElement=function(e){var t=this.eventElements.filter(function(t){return t.element===e})[0];return t||(t=new jn(e),this.eventElements.push(t)),t},Ln.prototype.bind=function(e,t,n){this.eventElement(e).bind(t,n)},Ln.prototype.unbind=function(e,t,n){var r=this.eventElement(e);r.unbind(t,n),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)},Ln.prototype.unbindAll=function(){this.eventElements.forEach(function(e){return e.unbindAll()}),this.eventElements=[]},Ln.prototype.once=function(e,t,n){var r=this.eventElement(e),o=function(e){r.unbind(t,o),n(e)};r.bind(t,o)};var Dn=function(e,t,n,r,o){var i;if(void 0===r&&(r=!0),void 0===o&&(o=!1),"top"===t)i=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==t)throw new Error("A proper axis should be provided");i=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(e,t,n,r,o){var i=n[0],a=n[1],s=n[2],l=n[3],c=n[4],u=n[5];void 0===r&&(r=!0);void 0===o&&(o=!1);var p=e.element;e.reach[l]=null,p[s]<1&&(e.reach[l]="start");p[s]>e[i]-e[a]-1&&(e.reach[l]="end");t&&(p.dispatchEvent(Mn("ps-scroll-"+l)),t<0?p.dispatchEvent(Mn("ps-scroll-"+c)):t>0&&p.dispatchEvent(Mn("ps-scroll-"+u)),r&&function(e,t){In(e,t),Rn(e,t)}(e,l));e.reach[l]&&(t||o)&&p.dispatchEvent(Mn("ps-"+l+"-reach-"+e.reach[l]))}(e,n,i,r,o)};function Fn(e){return parseInt(e,10)||0}var Un={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},Bn=function(e){var t=e.element,n=Math.floor(t.scrollTop);e.containerWidth=t.clientWidth,e.containerHeight=t.clientHeight,e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight,t.contains(e.scrollbarXRail)||(Tn(t,An.element.rail("x")).forEach(function(e){return Cn(e)}),t.appendChild(e.scrollbarXRail)),t.contains(e.scrollbarYRail)||(Tn(t,An.element.rail("y")).forEach(function(e){return Cn(e)}),t.appendChild(e.scrollbarYRail)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset<e.contentWidth?(e.scrollbarXActive=!0,e.railXWidth=e.containerWidth-e.railXMarginWidth,e.railXRatio=e.containerWidth/e.railXWidth,e.scrollbarXWidth=zn(e,Fn(e.railXWidth*e.containerWidth/e.contentWidth)),e.scrollbarXLeft=Fn((e.negativeScrollAdjustment+t.scrollLeft)*(e.railXWidth-e.scrollbarXWidth)/(e.contentWidth-e.containerWidth))):e.scrollbarXActive=!1,!e.settings.suppressScrollY&&e.containerHeight+e.settings.scrollYMarginOffset<e.contentHeight?(e.scrollbarYActive=!0,e.railYHeight=e.containerHeight-e.railYMarginHeight,e.railYRatio=e.containerHeight/e.railYHeight,e.scrollbarYHeight=zn(e,Fn(e.railYHeight*e.containerHeight/e.contentHeight)),e.scrollbarYTLine truncated
|
||||||
/** @license React v16.3.0-alpha.2
|
|
||||||
* react-dom.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013-present, Facebook, Inc.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/var r=n(0),o=n(248),i=n(120),a=n(72),s=n(247),c=n(246),l=n(245),u=n(119);function p(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);throw(t=Error(n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.")).name="Invariant Violation",t.framesToPop=1,t}r||p("227");var f={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,invokeGuardedCallback:function(e,t,n,r,o,i,a,s,c){(function(e,t,n,r,o,i,a,s,c){this._hasCaughtError=!1,this._caughtError=null;var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this._caughtError=e,this._hasCaughtError=!0}}).apply(f,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,o,i,a,s,c){if(f.invokeGuardedCallback.apply(this,arguments),f.hasCaughtError()){var l=f.clearCaughtError();f._hasRethrowError||(f._hasRethrowError=!0,f._rethrowError=l)}},rethrowCaughtError:function(){return function(){if(f._hasRethrowError){var e=f._rethrowError;throw f._rethrowError=null,f._hasRethrowError=!1,e}}.apply(f,arguments)},hasCaughtError:function(){return f._hasCaughtError},clearCaughtError:function(){if(f._hasCaughtError){var e=f._caughtError;return f._caughtError=null,f._hasCaughtError=!1,e}p("198")}};var d=null,h={};function m(){if(d)for(var e in h){var t=h[e],n=d.indexOf(e);if(-1<n||p("96",e),!y[n])for(var r in t.extractEvents||p("97",e),y[n]=t,n=t.eventTypes){var o=void 0,i=n[r],a=t,s=r;v.hasOwnProperty(s)&&p("99",s),v[s]=i;var c=i.phasedRegistrationNames;if(c){for(o in c)c.hasOwnProperty(o)&&g(c[o],a,s);o=!0}else i.registrationName?(g(i.registrationName,a,s),o=!0):o=!1;o||p("98",r,e)}}}function g(e,t,n){b[e]&&p("100",e),b[e]=t,w[e]=t.eventTypes[n].dependencies}var y=[],v={},b={},w={};function x(e){d&&p("101"),d=Array.prototype.slice.call(e),m()}function k(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];h.hasOwnProperty(t)&&h[t]===r||(h[t]&&p("102",t),h[t]=r,n=!0)}n&&m()}var O=Object.freeze({plugins:y,eventNameDispatchConfigs:v,registrationNameModules:b,registrationNameDependencies:w,possibleRegistrationNames:null,injectEventPluginOrder:x,injectEventPluginsByName:k}),_=null,E=null,S=null;function C(e,t,n,r){t=e.type||"unknown-event",e.currentTarget=S(r),f.invokeGuardedCallbackAndCatchFirstError(t,n,void 0,e),e.currentTarget=null}function A(e,t){return null==t&&p("30"),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function T(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var j=null;function P(e,t){if(e){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o<n.length&&!e.isPropagationStopped();o++)C(e,t,n[o],r[o]);else n&&C(e,t,n,r);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function I(e){return P(e,!0)}function R(e){return P(e,!1)}var N={injectEventPluginOrder:x,injectEventPluginsByName:k};function F(e,t){var n=e.stateNode;if(!n)return null;var r=_(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}return e?null:(n&&"function"!=typeof n&&p("231",t,typeof n),n)}function L(e,t){null!==e&&(j=A(j,e)),e=j,j=null,e&&(T(e,t?I:R),j&&p("95"),f.rethrowCaughtError())}function M(e,t,n,r){for(var o=null,i=0;i<y.length;i++){var a=y[i];a&&(a=a.extractEvents(e,t,n,r))&&(o=A(o,a))}L(o,!1)}var D=Object.freeze({injection:N,getListener:F,runEventsInBatch:L,runExtractedEventsInBatch:M}),B=Math.random().toString(36).slice(2),U="__reactInternalInstance$"+B,z="__reactEventHandlers$"+B;function $(e){if(e[U])return e[U];for(;!e[U];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[U]).tag||6===e.tag?e:null}function W(e){if(5===e.tag||6===e.tag)return e.stateNode;p("33")}function q(e){return e[z]||null}var H=Object.freeze({precacheFiberNode:function(e,t){t[U]=e},getClosestInstanceFromNode:$,getInstanceFromNode:function(e){return!(e=e[U])||5!==e.tag&&6!==e.tag?null:e},getNodeFromInstance:W,getFiberCurrentPropsFromNode:q,updateFiberProps:function(e,t){e[z]=t}});function V(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Y(e,t,n){for(var r=[];e;)r.push(e),e=V(e);for(e=r.length;0<e--;)t(r[e],"captured",n);for(e=0;e<r.length;e++)t(r[e],"bubbled",n)}function Q(e,t,n){(t=F(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=A(n._dispatchListeners,t),n._dispatchInstances=A(n._dispatchInstances,e))}function G(e){e&&e.dispatchConfig.phasedRegistrationNames&&Y(e._targetInst,Q,e)}function X(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._Line truncated
|
|
||||||
/** @license React v16.3.0-alpha.2
|
|
||||||
* react.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013-present, Facebook, Inc.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/var r=n(120),o=n(119),i=n(72),a="function"==typeof Symbol&&Symbol.for,s=a?Symbol.for("react.element"):60103,c=a?Symbol.for("react.portal"):60106,l=a?Symbol.for("react.fragment"):60107,u=a?Symbol.for("react.strict_mode"):60108,p=a?Symbol.for("react.provider"):60109,f=a?Symbol.for("react.context"):60110,d=a?Symbol.for("react.async_mode"):60111,h=a?Symbol.for("react.forward_ref"):60112,m="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);throw(t=Error(n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.")).name="Invariant Violation",t.framesToPop=1,t}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function v(e,t,n){this.props=e,this.context=t,this.refs=o,this.updater=n||y}function b(){}function w(e,t,n){this.props=e,this.context=t,this.refs=o,this.updater=n||y}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=v.prototype;var x=w.prototype=new b;x.constructor=w,r(x,v.prototype),x.isPureReactComponent=!0;var k={current:null},O=Object.prototype.hasOwnProperty,_={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,n){var r=void 0,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)O.call(t,r)&&!_.hasOwnProperty(r)&&(o[r]=t[r]);var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in c=e.defaultProps)void 0===o[r]&&(o[r]=c[r]);return{$$typeof:s,type:e,key:i,ref:a,props:o,_owner:k.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===s}var C=/\/+/g,A=[];function T(e,t,n,r){if(A.length){var o=A.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function j(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>A.length&&A.push(e)}function P(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var i=!1;if(null===e)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case s:case c:i=!0}}if(i)return n(r,e,""===t?"."+I(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;a<e.length;a++){var l=t+I(o=e[a],a);i+=P(o,l,n,r)}else if(null===e||void 0===e?l=null:l="function"==typeof(l=m&&e[m]||e["@@iterator"])?l:null,"function"==typeof l)for(e=l.call(e),a=0;!(o=e.next()).done;)i+=P(o=o.value,l=t+I(o,a++),n,r);else"object"===o&&g("31","[object Object]"===(n=""+e)?"object with keys {"+Object.keys(e).join(", ")+"}":n,"");return i}function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function R(e,t){e.func.call(e.context,t,e.count++)}function N(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?F(e,r,n,i.thatReturnsArgument):null!=e&&(S(e)&&(t=o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(C,"$&/")+"/")+n,e={$$typeof:s,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function F(e,t,n,r,o){var i="";null!=n&&(i=(""+n).replace(C,"$&/")+"/"),t=T(t,i,r,o),null==e||P(e,"",N,t),j(t)}var L={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return F(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=T(null,null,t,n),null==e||P(e,"",R,t),j(t)},count:function(e){return null==e?0:P(e,"",i.thatReturnsNull,null)},toArray:function(e){var t=[];return F(e,t,null,i.thatReturnsArgument),t},only:function(e){return S(e)||g("143"),e}},createRef:function(){return{current:null}},Component:v,PureComponent:w,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_changedBits:0,Provider:null,Consumer:null}).Provider={$$typeof:p,context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:h,render:e}},Fragment:l,StrictMode:u,unstable_AsyncMode:d,createElement:E,cloneElement:function(e,t,n){var o=void 0,i=r({},e.props),a=e.key,c=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,l=k.current),void 0!==t.key&&(a=""+t.key);var u=void 0;for(o in e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)O.call(t,o)&&!_.hasOwnProperty(o)&&(i[o]=void 0===t[o]&&void 0!==u?u[o]:t[o])}if(1===(o=arguments.length-2))i.children=n;else if(1<o){u=Array(o);for(var p=0;p<o;p++)u[p]=arguments[p+2];i.children=u}return{$$typeof:s,type:e.type,key:a,ref:c,props:i,_owner:l}},createFactory:function(e){var t=E.bind(null,e)Line truncated
|
|
||||||
//# sourceMappingURL=redoc.standalone.js.map
|
//# sourceMappingURL=redoc.standalone.js.map
|
||||||
@@ -19,10 +19,6 @@ body.swagger-body {
|
|||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
}
|
}
|
||||||
|
|
||||||
#django-session-auth {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,106 +1,27 @@
|
|||||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=1164)}([function(e,t,n){"use strict";e.exports=n(92)},function(e,t,n){e.exports=n(949)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(323),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,o.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){e.exports={default:n(560),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r=a(n(549)),i=a(n(322)),o=a(n(38));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,o.default)(t)));e.prototype=(0,i.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.default?(0,r.default)(e,t):e.__proto__=t)}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(38),o=(r=i)&&r.__esModule?r:{default:r};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,o.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){var r;r=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:J(e)}function r(e){return s(e)?e:G(e)}function i(e){return u(e)?e:K(e)}function o(e){return a(e)&&!l(e)?e:X(e)}function a(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function l(e){return s(e)||u(e)}function c(e){return!(!e||!e[d])}t(r,n),t(i,n),t(o,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=u,n.isAssociative=l,n.isOrdered=c,n.Keyed=r,n.Indexed=i,n.Set=o;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m=5,v=1<<m,g=v-1,y={},_={value:!1},b={value:!1};function x(e){return e.value=!1,e}function k(e){e&&(e.value=!0)}function w(){}function E(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i<n;i++)r[i]=e[i+t];return r}function S(e){return void 0===e.size&&(e.size=e.__iterate(A)),e.size}function C(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?S(e)+t:t}function A(){return!0}function D(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function M(e,t){return T(e,t,0)}function O(e,t){return T(e,t,t)}function T(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var P=0,I=1,R=2,F="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",j=F||N;function B(e){this.next=e}function L(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function q(){return{value:void 0,done:!0}}function z(e){return!!V(e)}function U(e){return e&&"function"==typeof e.next}function W(e){var t=V(e);return t&&t.call(e)}function V(e){var t=e&&(F&&e[F]||e[N]);if("function"==typeof t)return t}function H(e){return e&&"number"==typeof e.length}function J(e){return null===e||void 0===e?oe():a(e)?e.toSeq():function(e){var t=ue(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function G(e){return null===e||void 0===e?oe().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():ae(e)}function K(e){return null===e||void 0===e?oe():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():se(e)}function X(e){return(null===e||void 0===e?oe():a(e)?s(e)?e.entrySeq():e:se(e)).toSetSeq()}B.prototype.toString=function(){return"[Iterator]"},B.KEYS=P,B.VALUES=I,B.ENTRIES=R,B.prototype.inspect=B.prototype.toSource=function(){return this.toString()},B.prototype[j]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=thiLine truncated
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=445)}([function(e,t,n){"use strict";e.exports=n(75)},function(e,t,n){e.exports=n(855)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(262),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){e.exports={default:n(768),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(45),i=(r=o)&&r.__esModule?r:{default:r};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){"use strict";t.__esModule=!0;var r=a(n(770)),o=a(n(349)),i=a(n(45));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,i.default)(t)));e.prototype=(0,o.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(r.default?(0,r.default)(e,t):e.__proto__=t)}},function(e,t,n){var r;r=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:J(e)}function r(e){return u(e)?e:Y(e)}function o(e){return s(e)?e:K(e)}function i(e){return a(e)&&!l(e)?e:G(e)}function a(e){return!(!e||!e[f])}function u(e){return!(!e||!e[p])}function s(e){return!(!e||!e[d])}function l(e){return u(e)||s(e)}function c(e){return!(!e||!e[h])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=u,n.isIndexed=s,n.isAssociative=l,n.isOrdered=c,n.Keyed=r,n.Indexed=o,n.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",d="@@__IMMUTABLE_INDEXED__@@",h="@@__IMMUTABLE_ORDERED__@@",v=5,m=1<<v,g=m-1,y={},b={value:!1},_={value:!1};function w(e){return e.value=!1,e}function E(e){e&&(e.value=!0)}function x(){}function S(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function C(e){return void 0===e.size&&(e.size=e.__iterate(A)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?C(e)+t:t}function A(){return!0}function O(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function P(e,t){return M(e,t,0)}function T(e,t){return M(e,t,t)}function M(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var I=0,j=1,N=2,R="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",L=R||D;function U(e){this.next=e}function q(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function F(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function B(e){return e&&"function"==typeof e.next}function V(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(R&&e[R]||e[D]);if("function"==typeof t)return t}function W(e){return e&&"number"==typeof e.length}function J(e){return null===e||void 0===e?ie():a(e)?e.toSeq():function(e){var t=se(e)||"object"==typeof e&&new te(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function Y(e){return null===e||void 0===e?ie().toKeyedSeq():a(e)?u(e)?e.toSeq():e.fromEntrySeq():ae(e)}function K(e){return null===e||void 0===e?ie():a(e)?u(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null===e||void 0===e?ie():a(e)?u(e)?e.entrySeq():e:ue(e)).toSetSeq()}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=I,U.VALUES=j,U.ENTRIES=N,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[L]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=Line truncated
|
||||||
/*
|
/*
|
||||||
object-assign
|
object-assign
|
||||||
(c) Sindre Sorhus
|
(c) Sindre Sorhus
|
||||||
@license MIT
|
@license MIT
|
||||||
*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))i.call(n,l)&&(s[l]=n[l]);if(r){a=r(n);for(var c=0;c<a.length;c++)o.call(n,a[c])&&(s[a[c]]=n[a[c]])}}return s}},function(e,t,n){"use strict";var r=n(11),i=n(89),o=n(437),a=(n(8),i.ID_ATTRIBUTE_NAME),s=o,u="__reactInternalInstance$"+Math.random().toString(36).slice(2);function l(e,t){return 1===e.nodeType&&e.getAttribute(a)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function c(e){for(var t;t=e._renderedComponent;)e=t;return e}function p(e,t){var n=c(e);n._hostNode=t,t[u]=n}function f(e,t){if(!(e._flags&s.hasCachedChildNodes)){var n=e._renderedChildren,i=t.firstChild;e:for(var o in n)if(n.hasOwnProperty(o)){var a=n[o],u=c(a)._domID;if(0!==u){for(;null!==i;i=i.nextSibling)if(l(i,u)){p(a,i);continue e}r("32",u)}}e._flags|=s.hasCachedChildNodes}}function h(e){if(e[u])return e[u];for(var t,n,r=[];!e[u];){if(r.push(e),!e.parentNode)return null;e=e.parentNode}for(;e&&(n=e[u]);e=r.pop())t=n,r.length&&f(n,e);return t}var d={getClosestInstanceFromNode:h,getInstanceFromNode:function(e){var t=h(e);return null!=t&&t._hostNode===e?t:null},getNodeFromInstance:function(e){if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())f(e,e._hostNode);return e._hostNode},precacheChildNodes:f,precacheNode:p,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[u],e._hostNode=null)}};e.exports=d},function(e,t){var n=e.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";var r=n(112),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){a[String(t)]=e})}),a),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,n){"use strict";t.__esModule=!0;var r=o(n(548)),i=o(n(95));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(){return function(e,t){if(Array.isArray(e))return e;if((0,r.default)(Object(e)))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var s,u=(0,i.default)(e);!(r=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&u.return&&u.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){var r=n(354)("wks"),i=n(200),o=n(32).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){var r=n(184)("wks"),i=n(129),o=n(25).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){e.exports={default:n(557),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(22),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){var r=n(25),i=n(15),o=n(53),a=n(56),s=function(e,t,n){var u,l,c,p=e&s.F,f=e&s.G,h=e&s.S,d=e&s.P,m=e&s.B,v=e&s.W,g=f?i:i[t]||(i[t]={}),y=g.prototype,_=f?r:h?r[t]:(r[t]||{}).prototype;for(u in f&&(n=t),n)(l=!p&&_&&void 0!==_[u])&&u in g||(c=l?_[u]:n[u],g[u]=f&&"function"!=typeof _[u]?n[u]:m&&l?o(c,r):v&&_[u]==c?function(e){var t=function(t,n,Line truncated
|
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,u=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var l in n=Object(arguments[s]))o.call(n,l)&&(u[l]=n[l]);if(r){a=r(n);for(var c=0;c<a.length;c++)i.call(n,a[c])&&(u[a[c]]=n[a[c]])}}return u}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";var r=n(10),o=n(87),i=n(350),a=(n(8),o.ID_ATTRIBUTE_NAME),u=i,s="__reactInternalInstance$"+Math.random().toString(36).slice(2);function l(e,t){return 1===e.nodeType&&e.getAttribute(a)===String(t)||8===e.nodeType&&e.nodeValue===" react-text: "+t+" "||8===e.nodeType&&e.nodeValue===" react-empty: "+t+" "}function c(e){for(var t;t=e._renderedComponent;)e=t;return e}function f(e,t){var n=c(e);n._hostNode=t,t[s]=n}function p(e,t){if(!(e._flags&u.hasCachedChildNodes)){var n=e._renderedChildren,o=t.firstChild;e:for(var i in n)if(n.hasOwnProperty(i)){var a=n[i],s=c(a)._domID;if(0!==s){for(;null!==o;o=o.nextSibling)if(l(o,s)){f(a,o);continue e}r("32",s)}}e._flags|=u.hasCachedChildNodes}}function d(e){if(e[s])return e[s];for(var t,n,r=[];!e[s];){if(r.push(e),!e.parentNode)return null;e=e.parentNode}for(;e&&(n=e[s]);e=r.pop())t=n,r.length&&p(n,e);return t}var h={getClosestInstanceFromNode:d,getInstanceFromNode:function(e){var t=d(e);return null!=t&&t._hostNode===e?t:null},getNodeFromInstance:function(e){if(void 0===e._hostNode&&r("33"),e._hostNode)return e._hostNode;for(var t=[];!e._hostNode;)t.push(e),e._hostParent||r("34"),e=e._hostParent;for(;t.length;e=t.pop())p(e,e._hostNode);return e._hostNode},precacheChildNodes:p,precacheNode:f,uncacheNode:function(e){var t=e._hostNode;t&&(delete t[s],e._hostNode=null)}};e.exports=h},function(e,t,n){"use strict";var r=n(108),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach(function(e){n[e].forEach(function(t){a[String(t)]=e})}),a),-1===i.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,n){var r=n(243)("wks"),o=n(168),i=n(29).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){"use strict";t.__esModule=!0;var r=i(n(569)),o=i(n(91));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(){return function(e,t){if(Array.isArray(e))return e;if((0,r.default)(Object(e)))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var u,s=(0,o.default)(e);!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(162)("wks"),o=n(116),i=n(19).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(19),o=n(14),i=n(49),a=n(50),u=n(52),s=function(e,t,n){var l,c,f,p=e&s.F,d=e&s.G,h=e&s.S,v=e&s.P,m=e&s.B,g=e&s.W,y=d?o:o[t]||(o[t]={}),b=y.prototype,_=d?r:h?r[t]:(r[t]||{}).prototype;for(l in d&&(n=t),n)(c=!p&&_&&void 0!==_[l])&&u(y,l)||(f=c?_[l]:n[l],y[l]=d&&"function"!=typeof _[l]?n[l]:m&&c?i(f,r):g&&_[l]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?i(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[l]=f,e&s.R&&b&&!b[l]&&a(b,l,f)))};s.F=1,s.G=2,s.SLine truncated
|
||||||
/*!
|
/*!
|
||||||
* The buffer module from node.js, for the browser.
|
* The buffer module from node.js, for the browser.
|
||||||
*
|
*
|
||||||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
var r=n(606),i=n(736),o=n(379);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):f(e,t);if("Buffer"===t.type&&o(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(c(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;o<s;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var p=!0,f=0;f<u;f++)if(l(e,o+f)!==l(t,f)){p=!1;break}if(p)return o}return-1}function y(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function _(e,t,n,r){return U(q(t,e.length-n),e,n,r)}function b(e,t,n,r){return U(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return b(e,t,n,r)}function k(e,t,n,r){return U(z(t),e,n,r)}function w(e,t,n,r){return U(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,u,l=e[i],c=null,p=l>239?4:l>223?3:l>191?2:1;if(i+p<=n)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128=Line truncated
|
var r=n(529),o=n(530),i=n(261);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=s.prototype:(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);s.TYPED_ARRAY_SUPPORT?(e=t).__proto__=s.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),o=(e=u(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(s.isBuffer(t)){var n=0|d(t.length);return 0===(e=u(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?u(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=u(e,t<0?0:0|d(t)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|d(t.length);e=u(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,o);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,o){var i,a=1,u=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,u/=2,s/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=n;i<u;i++)if(l(e,i)===l(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===s)return c*a}else-1!==c&&(i-=i-c),c=-1}else for(n+s>u&&(n=u-s),i=n;i>=0;i--){for(var f=!0,p=0;p<s;p++)if(l(e,i+p)!==l(t,p)){f=!1;break}if(f)return i}return-1}function y(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var u=parseInt(t.substr(2*a,2),16);if(isNaN(u))return a;e[n+a]=u}return a}function b(e,t,n,r){return B(F(t,e.length-n),e,n,r)}function _(e,t,n,r){return B(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function w(e,t,n,r){return _(e,t,n,r)}function E(e,t,n,r){return B(z(t),e,n,r)}function x(e,t,n,r){return B(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,u,s,l=e[o],c=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[o+1]))&&(s=(31&l)<<6|63&i)>127&&(c=s);break;case 3:i=e[o+1],a=e[o+2],128=Line truncated
|
||||||
/*!
|
/*!
|
||||||
Copyright (c) 2016 Jed Watson.
|
Copyright (c) 2017 Jed Watson.
|
||||||
Licensed under the MIT License (MIT), see
|
Licensed under the MIT License (MIT), see
|
||||||
http://jedwatson.github.io/classnames
|
http://jedwatson.github.io/classnames
|
||||||
*/
|
*/
|
||||||
/*!
|
/*!
|
||||||
Copyright (c) 2016 Jed Watson.
|
Copyright (c) 2017 Jed Watson.
|
||||||
Licensed under the MIT License (MIT), see
|
Licensed under the MIT License (MIT), see
|
||||||
http://jedwatson.github.io/classnames
|
http://jedwatson.github.io/classnames
|
||||||
*/
|
*/
|
||||||
!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(i.apply(null,r));else if("object"===o)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}void 0!==e&&e.exports?e.exports=i:void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";function r(e){switch(e._type){case"document":case"block_quote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"link":case"image":case"custom_inline":case"custom_block":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},s=a.prototype;Object.defineProperty(s,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(s,"type",{get:function(){return this._type}}),Object.defineProperty(s,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(s,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(s,"next",{get:function(){return this._next}}),Object.defineProperty(s,"prev",{get:function(){return this._prev}}),Object.defineProperty(s,"parent",{get:function(){return this._parent}}),Object.defineProperty(s,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(s,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(s,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(s,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(s,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(s,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(s,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(s,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(s,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(s,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(s,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(s,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),a.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},a.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},a.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},a.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},a.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},a.prototype.walker=function(){return new function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}}(this)},e.exports=a},function(e,t,n){var r=n(104),i=n(18)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(76),i=n(32).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(18)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{Line truncated
|
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var u in r)n.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}void 0!==e&&e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r=n(160),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(60),o=n(459),i=n(460),a=Object.defineProperty;t.f=n(101)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(121);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(465),o=n(54);e.exports=function(e){return r(o(e))}},function(e,t,n){"use strict";var r=n(59),o=n(73),i=n(102),a=n(54),u=n(17);e.exports=function(e,t,n){var s=u(e),l=n(a,s,""[e]),c=l[0],f=l[1];i(function(){var t={};return t[s]=function(){return 7},7!=""[e](t)})&&(o(String.prototype,e,c),r(RegExp.prototype,s,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(116)("meta"),o=n(28),i=n(52),a=n(39).f,u=0,s=Object.isExtensible||function(){return!0},l=!n(51)(function(){return s(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++u,w:{}}})},f=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!s(e))return"F";if(!t)return"E";c(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!s(e))return!0;if(!t)return!1;c(e)}return e[r].w},onFreeze:function(e){return l&&f.NEED&&s(e)&&!i(e,r)&&c(e),e}}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR_BY=t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=function(e){return{type:a,payload:(0,i.default)(e)}},t.newThrownErrBatch=function(e){return{type:u,payload:e}},t.newSpecErr=function(e){return{type:s,payload:e}},t.newSpecErrBatch=function(e){return{type:l,payload:e}},t.newAuthErr=function(e){return{type:c,payload:e}},t.clear=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:f,payload:e}},t.clearBy=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return{type:p,payload:e}};var r,o=n(180),i=(r=o)&&r.__esModule?r:{default:r};var a=t.NEW_THROWN_ERR="err_new_thrown_err",u=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",s=t.NEW_SPEC_ERR="err_new_spec_err",l=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",c=t.NEW_AUTH_ERR="err_new_auth_err",f=t.CLEAR="err_clear",p=t.CLEAR_BY="err_clear_by"},function(e,t,n){var r=n(62),o=n(47),i="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||o(e)&&r(e)==i}},function(e,t,n){var r=n(63)(Object,"create");e.exports=r},function(e,t,n){var r=n(601),o=n(602),i=n(603),a=n(604),u=n(605);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,e.exports=s},function(e,t,n){var r=n(106);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(607);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(612),o=n(640),i=n(192),a=n(24),u=n(645);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?a(e)?o(e[0],e[1]):r(e):u(e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?n:t)&&("number"==o||"symbol"!=o&&r.test(e))&&e>-1&&e%1==0&&e<t}},fLine truncated
|
||||||
/*!
|
|
||||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
||||||
* (c) 2017 Joachim Wester
|
|
||||||
* MIT license
|
|
||||||
*/function i(e,t){return r.call(e,t)}function o(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);t=[];for(var r in e)i(e,r)&&t.push(r);return t}function a(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function s(e,t){var n;for(var r in e)if(i(e,r)){if(e[r]===t)return a(r)+"/";if("object"==typeof e[r]&&""!=(n=s(e[r],t)))return a(r)+"/"+n}return""}t.hasOwnProperty=i,t._objectKeys=o,t._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},t.isInteger=function(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0},t.escapePathComponent=a,t.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=s,t.getPath=function(e,t){if(e===t)return"/";var n=s(e,t);if(""===n)throw new Error("Object not found in root");return"/"+n},t.hasUndefined=function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0}else if("object"==typeof t){var i=o(t),a=i.length;for(n=0;n<a;n++)if(e(t[i[n]]))return!0}return!1};var u=function(e){function t(t,n,r,i,o){e.call(this,t),this.message=t,this.name=n,this.index=r,this.operation=i,this.tree=o}return n(t,e),t}(Error);t.PatchError=u},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function i(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,t){if(i(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(!r.call(t,n[a])||!i(e[n[a]],t[n[a]]))return!1;return!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(737)),i=v(n(740)),o=v(n(739)),a=v(n(741)),s=v(n(742)),u=v(n(743)),l=v(n(744)),c=v(n(745)),p=v(n(746)),f=v(n(747)),h=v(n(748)),d=v(n(750)),m=v(n(738));function v(e){return e&&e.__esModule?e:{default:e}}var g=[o.default,i.default,a.default,u.default,l.default,c.default,p.default,f.default,h.default,s.default],y=(0,r.default)({prefixMap:m.default.prefixMap,plugins:g},d.default);t.default=y,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.exports=t.default},function(e,t,n){"use strict";var r=n(768);e.exports=r},function(e,t,n){"use strict";var r=n(81);e.exports=new r({explicit:[n(786),n(784),n(779)]})},function(e,t,n){var r=n(66)(n(40),"Map");e.exports=r},function(e,t,n){var r=n(882),i=n(883),o=n(884),a=n(885),s=n(886);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(142),i=n(897),o=n(898),a=n(899),s=n(900),u=n(901);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){var r=n(384);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){var r=n(409)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(807),i=n(419),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return o.call(e,t)}))}:i;e.exports=s},function(e,t,n){var r=n(20),i=n(153),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},function(e,t,n){(function(e){var r=n(401),i="object"==typeof t&&t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s}).call(t,n(120)(e))},function(e,t,n){var r=n(856)(n(913));e.exports=r},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(819),i=n(50),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){(function(e){var r=n(40),i=n(927),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u}).call(t,n(120)(e))},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t,n){var r=n(65),i=n(216),o=n(50),a="Line truncated
|
|
||||||
/**
|
|
||||||
* Checks if an event is supported in the current execution environment.
|
|
||||||
*
|
|
||||||
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
||||||
* `reset`, `load`, `error`, and `select`.
|
|
||||||
*
|
|
||||||
* Borrows from Modernizr.
|
|
||||||
*
|
|
||||||
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
||||||
* @param {?boolean} capture Check if the capture phase is supported.
|
|
||||||
* @return {boolean} True if the event is supported.
|
|
||||||
* @internal
|
|
||||||
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
||||||
*/,e.exports=function(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,o=n in document;if(!o){var a=document.createElement("div");a.setAttribute(n,"return;"),o="function"==typeof a[n]}return!o&&r&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}},function(e,t,n){"use strict";e.exports=function(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var i=typeof e,o=typeof t;return"string"===i||"number"===i?"string"===o||"number"===o:"object"===o&&e.type===t.type&&e.key===t.key}},function(e,t,n){"use strict";n(13);var r=n(33),i=(n(10),r);e.exports=i},function(e,t,n){"use strict";function r(e){switch(e._type){case"Document":case"BlockQuote":case"List":case"Item":case"Paragraph":case"Heading":case"Emph":case"Strong":case"Link":case"Image":case"CustomInline":case"CustomBlock":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},s=a.prototype;Object.defineProperty(s,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(s,"type",{get:function(){return this._type}}),Object.defineProperty(s,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(s,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(s,"next",{get:function(){return this._next}}),Object.defineProperty(s,"prev",{get:function(){return this._prev}}),Object.defineProperty(s,"parent",{get:function(){return this._parent}}),Object.defineProperty(s,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(s,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(s,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(s,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(s,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(s,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(s,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(s,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(s,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(s,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(s,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(s,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),a.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},a.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},a.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},a.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},a.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},a.prototype.walker=function(){return new function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}}(this)},e.exports=a},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=0);return t},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t,n){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(0!==n[r])return!1;var i="number"==tyLine truncated
|
|
||||||
/*!
|
|
||||||
* @description Recursive object extending
|
|
||||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
|
||||||
* @license MIT
|
|
||||||
*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013-2015 Viacheslav Lotsmanov
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,o=arguments[0];return Array.prototype.slice.call(arguments,1).forEach(function(a){"object"!=typeof a||Array.isArray(a)||Object.keys(a).forEach(function(s){return t=o[s],(e=a[s])===o?void 0:"object"!=typeof e||null===e?void(o[s]=e):Array.isArray(e)?void(o[s]=function e(t){var o=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?o[a]=e(t):n(t)?o[a]=r(t):o[a]=i({},t):o[a]=t}),o}(e)):n(e)?void(o[s]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(o[s]=i({},e)):void(o[s]=i(t,e))})}),o}}).call(t,n(48).Buffer)},function(e,t){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:Line truncated
|
|
||||||
/*! http://mths.be/repeat v0.2.0 by @mathias */
|
|
||||||
String.prototype.repeat||function(){"use strict";var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),t=function(e){if(null==this)throw TypeError();var t=String(this),n=e?Number(e):0;if(n!=n&&(n=0),n<0||n==1/0)throw RangeError();for(var r="";n;)n%2==1&&(r+=t),n>1&&(t+=t),n>>=1;return r};e?e(String.prototype,"repeat",{value:t,configurable:!0,writable:!0}):String.prototype.repeat=t}()},function(e,t,n){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=22)}([function(e,t){e.exports=n(37)},function(e,t){e.exports=n(38)},function(e,t){e.exports=n(22)},function(e,t){e.exports=n(23)},function(e,t){e.exports=n(343)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).v2OperationIdCompatibilityMode;return e&&"object"===(void 0===e?"undefined":(0,c.default)(e))?(e.operationId||"").replace(/\s/g,"").length?d(e.operationId):o(t,n,{v2OperationIdCompatibilityMode:r}):null}function o(e,t){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).v2OperationIdCompatibilityMode){var n=(t.toLowerCase()+"_"+e).replace(/[\s!@#$%^&*()_+=[{\]};:<>|.\/?,\\'""-]/g,"_");return(n=n||e.substring(1)+"_"+t).replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return""+h(t)+d(e)}function a(e,t){return h(t)+"-"+e}function s(e,t){return u(e,t,!0)||null}function u(e,t,n){if(!e||"object"!==(void 0===e?"undefined":(0,c.default)(e))||!e.paths||"object"!==(0,c.default)(e.paths))return null;var r=e.paths;for(var i in r)for(var o in r[i])if("PARAMETERS"!==o.toUpperCase()){var a=r[i][o];if(a&&"object"===(void 0===a?"undefined":(0,c.default)(a))){var s={spec:e,pathName:i,method:o.toUpperCase(),operation:a},u=t(s);if(n&&u)return s}}}Object.defineProperty(t,"__esModule",{value:!0});var l=r(n(17)),c=r(n(1));t.isOAS3=function(e){var t=e.openapi;return!!t&&(0,f.default)(t,"3")},t.isSwagger2=function(e){var t=e.swagger;return!!t&&(0,f.default)(t,"2")},t.opId=i,t.idFromPathMethod=o,t.legacyIdFromPathMethod=a,t.getOperationRaw=function(e,t){return e&&e.paths?s(e,function(e){var n=e.pathName,r=e.method,o=e.operation;if(!o||"object"!==(void 0===o?"undefined":(0,c.default)(o)))return!1;var s=o.operationId;return[i(o,n,r),a(n,r),s].some(function(e){return e&&e===t})}):null},t.findOperation=s,t.eachOperation=u,t.normalizeSwagger=function(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e;for(var o in n){var a=n[o];if((0,p.default)(a)){var s=a.parameters;for(var u in a)!function(e){var n=a[e];if(!(0,p.default)(n))return"continue";var u=i(n,o,e);if(u){r[u]?r[u].push(n):r[u]=[n];var c=r[u];if(c.length>1)c.forEach(function(e,t){e.__originalOperationId=e.__originalOperationId||e.operationId,e.operationId=""+u+(t+1)});else if(void 0!==n.operationId){var f=c[0];f.__originalOperationId=f.__originalOperationId||n.operationId,f.operationId=u}}if("parameters"!==e){var h=[],d={};for(var m in t)"produces"!==m&&"consumes"!==m&&"security"!==m||(d[m]=t[m],h.push(d));if(s&&(d.parameters=s,h.push(d)),h.length){var v=!0,g=!1,y=void 0;try{for(var _,b=(0,l.default)(h);!(v=(_=b.next()).done);v=!0){var x=_.value;for(var k in x)if(n[k]){if("parameters"===k){var w=!0,E=!1,S=void 0;try{for(var C,A=(0,l.default)(x[k]);!(w=(C=A.next()).done);w=!0)!function(){var e=C.value;n[k].some(function(t){return t.name&&t.name===e.name||t.$ref&&t.$ref===e.$ref||t.$$ref&&t.$$ref===e.$$ref||t===e})||n[k].push(e)}()}catch(e){E=!0,S=e}finally{try{!w&&A.return&&A.return()}finally{if(E)throw S}}}}else n[k]=x[k]}}catch(e){g=!0,y=e}finally{try{!v&&b.return&&b.return()}finally{if(g)throw y}}}}}(u)}}return t.$$normalized=!0,e};var p=r(n(46)),f=r(n(14)),h=function(e){return String.prototype.toLowerCase.call(e)},d=function(e){return e.replace(/[^\w]/gi,"_")}},function(e,t){e.exports=n(906)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).loadSpec,r=void 0!==n&&n,i={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:o(e.headers)},a=i.headers["content-type"],s=r||b(a);return(s?e.text:e.blob||e.buffer).call(e).then(function(e){if(i.text=e,i.data=e,s)try{var t=function(e,t){return"application/json"===t?JSON.parse(e):g.default.safeLoad(e)}(e,a);i.body=t,i.obj=t}catch(e){i.parseError=e}return i})}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return"function"==typeof e.forEach?(e.forEach(function(e,n){voLine truncated
|
|
||||||
/*!
|
|
||||||
* Autolinker.js
|
|
||||||
* 0.15.3
|
|
||||||
*
|
|
||||||
* Copyright(c) 2015 Gregory Jacobs <greg@greg-jacobs.com>
|
|
||||||
* MIT Licensed. http://www.opensource.org/licenses/mit-license.php
|
|
||||||
*
|
|
||||||
* https://github.com/gregjacobs/Autolinker.js
|
|
||||||
*/
|
|
||||||
var e,t,n,r,i=function(e){i.Util.assign(this,e)};return i.prototype={constructor:i,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser().parse(e),n=0,r=[],i=0,o=t.length;i<o;i++){var a=t[i],s=a.getType(),u=a.getText();if("element"===s)"a"===a.getTagName()&&(a.isClosing()?n=Math.max(n-1,0):n++),r.push(u);else if("entity"===s)r.push(u);else if(0===n){var l=this.linkifyStr(u);r.push(l)}else r.push(u)}return r.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this,this,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof i.HtmlTag?t.toString():this.getTagBuilder().build(e).toString()},getHtmlParser:function(){var e=this.htmlParser;return e||(e=this.htmlParser=new i.htmlParser.HtmlParser),e},getMatchParser:function(){var e=this.matchParser;return e||(e=this.matchParser=new i.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,stripPrefix:this.stripPrefix})),e},getTagBuilder:function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new i.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e}},i.link=function(e,t){return new i(t).link(e)},i.match={},i.htmlParser={},i.matchParser={},i.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},extend:function(e,t){var n,r=e.prototype,o=function(){};o.prototype=r;var a=(n=t.hasOwnProperty("constructor")?t.constructor:function(){r.constructor.apply(this,arguments)}).prototype=new o;return a.constructor=n,a.superclass=r,delete t.constructor,i.Util.assign(a,t),n},ellipsis:function(e,t,n){return e.length>t&&(n=null==n?"..":n,e=e.substring(0,t-n.length)+n),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}},i.HtmlTag=i.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(e){i.Util.assign(this,e),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(e){var t=this.getAttrs();return i.Util.assign(t,e),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=i.Util.indexOf,a=n?n.split(r):[],s=e.split(r);t=s.shift();)-1===o(a,t)&&a.push(t);return this.getAttrs().class=a.join(" "),this},removeClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,o=i.Util.indexOf,a=n?n.split(r):[],s=e.split(r);a.length&&(t=s.shift());){var u=o(a,t);-1!==u&&a.splice(u,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")}}),i.AnchorTagBuilder=i.Util.extend(Object,{constructor:function(e){i.Util.assign(this,e)},build:function(e){return new i.HtmlTag({tagName:"a",attrs:this.createAttrs(e.getType(),e.getAnchorHref()),innerHtml:this.processAnchorText(e.getAnchorText())})},createAttrs:function(e,t){var n={href:t},r=this.createCssClass(e);return r&&(n.class=r),this.newWindow&&(n.target="_blank"),n},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(e){return i.Util.ellipsis(e,this.truncate||Number.POSITIVE_INFINITY)}}),i.htmlParser.HtmlParser=i.Util.extend(Object,{htmlRegex:(e=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/.source+"(?:\\s*=\\s*"+e.source+")?",new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",t,"|",e.source+")",")*",">",")","|","(?:","<(/)?","("+/[0-9a-zA-Z][0-9a-zA-Z:]*/.source+")","(?:","\\s+",t,")*","\\s*/?",">",")"].join(""),"gi")),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,n,r=this.htmlRegex,i=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[1]||t[3],u=!!t[2],l=e.substring(i,t.index)Line truncated
|
|
||||||
/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */if(String.fromCodePoint)e.exports=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var r=String.fromCharCode,i=Math.floor;e.exports=function(){var e,t,n=[],o=-1,a=arguments.length;if(!a)return"";for(var s="";++o<a;){var u=Number(arguments[o]);if(!isFinite(u)||u<0||u>1114111||i(u)!==u)return String.fromCharCode(65533);u<=65535?n.push(u):(e=55296+((u-=65536)>>10),t=u%1024+56320,n.push(e,t)),(o+1===a||n.length>16384)&&(s+=r.apply(null,n),n.length=0)}return s}}},function(e,t,n){"use strict";e.exports.Node=n(192),e.exports.Parser=n(610),e.exports.HtmlRenderer=n(615),e.exports.XmlRenderer=n(616)},function(e,t,n){"use strict";var r=n(192),i=n(75),o=n(614),a=i.normalizeURI,s=i.unescapeString,u=n(611),l=n(138).decodeHTML;n(477);var c=i.ESCAPABLE,p="\\\\"+c,f=i.ENTITY,h=i.reHtmlTag,d=new RegExp(/[!"#$%&'()*+,\-./:;<=>?@\[\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),m=new RegExp('^(?:"('+p+'|[^"\\x00])*"|\'('+p+"|[^'\\x00])*'|\\(("+p+"|[^)\\x00])*\\))"),v=new RegExp("^(?:[<](?:[^ <>\\t\\n\\\\\\x00]|"+p+"|\\\\)*[>])"),g=new RegExp("^"+c),y=new RegExp("^"+f,"i"),_=/`+/,b=/^`+/,x=/\.\.\./g,k=/--+/g,w=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,E=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,S=/^ *(?:\n *)?/,C=/^[ \t\n\x0b\x0c\x0d]/,A=/[ \t\n\x0b\x0c\x0d]+/g,D=/^\s/,M=/ *$/,O=/^ */,T=/^ *(?:\n|$)/,P=new RegExp("^\\[(?:[^\\\\\\[\\]]|"+p+"|\\\\){0,1000}\\]"),I=/^[^\n`\[\]\\!<&*_'"]+/m,R=function(e){var t=new r("text");return t._literal=e,t},F=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},N=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},j=function(){return this.match(S),!0},B=function(e){var t=this.match(b);if(null===t)return!1;for(var n,i,o=this.pos;null!==(n=this.match(_));)if(n===t)return(i=new r("code"))._literal=this.subject.slice(o,this.pos-t.length).trim().replace(A," "),e.appendChild(i),!0;return this.pos=o,e.appendChild(R(t)),!0},L=function(e){var t,n=this.subject;return this.pos+=1,10===this.peek()?(this.pos+=1,t=new r("linebreak"),e.appendChild(t)):g.test(n.charAt(this.pos))?(e.appendChild(R(n.charAt(this.pos))),this.pos+=1):e.appendChild(R("\\")),!0},q=function(e){var t,n,i;return(t=this.match(w))?(n=t.slice(1,t.length-1),(i=new r("link"))._destination=a("mailto:"+n),i._title="",i.appendChild(R(n)),e.appendChild(i),!0):!!(t=this.match(E))&&(n=t.slice(1,t.length-1),(i=new r("link"))._destination=a(n),i._title="",i.appendChild(R(n)),e.appendChild(i),!0)},z=function(e){var t=this.match(h);if(null===t)return!1;var n=new r("html_inline");return n._literal=t,e.appendChild(n),!0},U=function(e){var t,n,r,i,o,a,s,l,c,p,f,h=0,m=this.pos;if(39===e||34===e)h++,this.pos++;else for(;this.peek()===e;)h++,this.pos++;return 0===h?null:(t=0===m?"\n":this.subject.charAt(m-1),n=-1===(r=this.peek())?"\n":u(r),l=D.test(n),c=d.test(n),p=D.test(t),f=d.test(t),i=!l&&(!c||p||f),o=!p&&(!f||l||c),95===e?(a=i&&(!o||f),s=o&&(!i||c)):39===e||34===e?(a=i&&!o,s=o):(a=i,s=o),this.pos=m,{numdelims:h,can_open:a,can_close:s})},W=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r,i=n.numdelims,o=this.pos;this.pos+=i,r=39===e?"Line truncated
|
|
||||||
/*!
|
|
||||||
* cookie
|
|
||||||
* Copyright(c) 2012-2014 Roman Shtylman
|
|
||||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
||||||
* MIT Licensed
|
|
||||||
*/t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},i=t||{},a=e.split(o),u=i.decode||r,l=0;l<a.length;l++){var c=a[l],p=c.indexOf("=");if(!(p<0)){var f=c.substr(0,p).trim(),h=c.substr(++p,c.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),void 0==n[f]&&(n[f]=s(h,u))}}return n},t.serialize=function(e,t,n){var r=n||{},o=r.encode||i;if("function"!=typeof o)throw new TypeError("option encode is invalid");if(!a.test(e))throw new TypeError("argument name is invalid");var s=o(t);if(s&&!a.test(s))throw new TypeError("argument val is invalid");var u=e+"="+s;if(null!=r.maxAge){var l=r.maxAge-0;if(isNaN(l))throw new Error("maxAge should be a Number");u+="; Max-Age="+Math.floor(l)}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");u+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");u+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");u+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(u+="; HttpOnly");r.secure&&(u+="; Secure");if(r.sameSite){var c="string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return u};var r=decodeURIComponent,i=encodeURIComponent,o=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(t){return e}}},function(e,t,n){n(661),n(665),n(672),n(359),n(656),n(657),n(662),n(666),n(668),n(652),n(653),n(654),n(655),n(658),n(659),n(660),n(663),n(664),n(667),n(669),n(670),n(671),n(648),n(649),n(650),n(651),e.exports=n(62).String},function(e,t,n){n(646),n(359),n(675),n(647),n(673),n(674),e.exports=n(62).Promise},function(e,t,n){var r=n(18)("unscopables"),i=Array.prototype;void 0==i[r]&&n(63)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(136),i=n(108),o=n(358);e.exports=function(e){return function(t,n,a){var s,u=r(t),l=i(u.length),c=o(a,l);if(e&&n!=n){for(;l>c;)if((s=u[c++])!=s)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},function(e,t,n){var r=n(131),i=n(628),o=n(627),a=n(61),s=n(108),u=n(644),l={},c={};(t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v}).BREAK=l,t.RETURN=c},function(e,t,n){e.exports=!n(105)&&!n(106)(function(){return 7!=Object.defineProperty(n(194)("div"),"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(104);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(107),i=n(18)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(61);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){"use strict";var r=n(633),i=n(353),o=n(197),a={};n(63)(a,n(18)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(18)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(32),i=n(357).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(104)(a);e.exports=function(){var e,t,n,l=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(l)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var c=s.resolve();n=function(){c.then(l)}}else n=function(){i.call(r,l)};else{var p=!0,f=document.createTextNode("");new o(l).observe(f,{characterData:!0}),n=function(){f.data=p=!p}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(61),i=n(634),o=n(345),a=n(198)("ILine truncated
|
|
||||||
/*!
|
|
||||||
* pascalcase <https://github.com/jonschlinkert/pascalcase>
|
|
||||||
*
|
|
||||||
* Copyright (c) 2015, Jon Schlinkert.
|
|
||||||
* Licensed under the MIT License.
|
|
||||||
*/
|
|
||||||
function(e){if("string"!=typeof e)throw new TypeError("expected a string.");return 1===(e=e.replace(/([A-Z])/g," $1")).length?e.toUpperCase():(e=(e=e.replace(/^[\W_]+|[\W_]+$/g,"").toLowerCase()).charAt(0).toUpperCase()+e.slice(1)).replace(/[\W_]+(\w|$)/g,function(e,t){return t.toUpperCase()})}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){}},function(e,t,n){"use strict";var r=n(33),i=n(8),o=n(428);e.exports=function(){function e(e,t,n,r,a,s){s!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(33),i=n(8),o=n(10),a=n(13),s=n(428),u=n(948);e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l="@@iterator";var c="<<anonymous>>",p={array:m("array"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:d(r.thatReturnsNull),arrayOf:function(e){return d(function(t,n,r,i,o){if("function"!=typeof e)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){var u=g(a);return new h("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected an array.")}for(var l=0;l<a.length;l++){var c=e(a,l,r,i,o+"["+l+"]",s);if(c instanceof Error)return c}return null})},element:function(){return d(function(t,n,r,i,o){var a=t[n];if(!e(a)){var s=g(a);return new h("Invalid "+i+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected a single ReactElement.")}return null})}(),instanceOf:function(e){return d(function(t,n,r,i,o){if(!(t[n]instanceof e)){var a=e.name||c,s=function(e){if(!e.constructor||!e.constructor.name)return c;return e.constructor.name}(t[n]);return new h("Invalid "+i+" `"+o+"` of type `"+s+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null})},node:function(){return d(function(e,t,n,r,i){if(!v(e[t]))return new h("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.");return null})}(),objectOf:function(e){return d(function(t,n,r,i,o){if("function"!=typeof e)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],u=g(a);if("object"!==u)return new h("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var l in a)if(a.hasOwnProperty(l)){var c=e(a,l,r,i,o+"."+l,s);if(c instanceof Error)return c}return null})},oneOf:function(e){if(!Array.isArray(e))return r.thatReturnsNull;return d(function(t,n,r,i,o){for(var a=t[n],s=0;s<e.length;s++)if(f(a,e[s]))return null;var u=JSON.stringify(e);return new h("Invalid "+i+" `"+o+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+u+".")})},oneOfType:function(e){if(!Array.isArray(e))return r.thatReturnsNull;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return o(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",_(n),t),r.thatReturnsNull}return d(function(t,n,r,i,o){for(var a=0;a<e.length;a++){var u=e[a];if(null==u(t,n,r,i,o,s))return null}return new h("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")})},shape:function(e){return d(function(t,n,r,i,o){var a=t[n],u=g(a);if("object"!==u)return new h("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var c=e[l];if(c){var p=c(a,l,r,i,o+"."+l,s);if(p)return p}}return null})},exact:function(e){return d(function(t,n,r,i,o){var u=t[n],l=g(u);if("object"!==l)return new h("Invalid "+i+" `"+o+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");var c=a({},t[n],e);for(var p in c){var f=e[p];if(!f)return new h("Invalid "+i+" `"+o+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var d=f(u,p,r,i,o+"."+p,s);if(d)return d}return null})}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e){this.message=e,this.stack=""}function d(e){function n(n,r,o,a,u,l,p){(a=a||c,l=l||o,p!==s)&&(t&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"));return null==r[o]?n?null===r[o]?new h("The "+u+" `"+l+"` is marked as required in `"+a+"`, but its value is `null`."):new h("The "+u+" `"+l+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,u,l)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function m(e){return d(function(t,n,r,i,o,a){var s=t[n];return g(s)!==e?new h("Invalid "+i+" `"+o+"` of type `"+y(s)+"` supplied to `"+r+"`, expected `"+e+"`."):null})}functiLine truncated
|
|
||||||
/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */if(String.fromCodePoint)e.exports=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var r=String.fromCharCode,i=Math.floor;e.exports=function(){var e,t,n=[],o=-1,a=arguments.length;if(!a)return"";for(var s="";++o<a;){var u=Number(arguments[o]);if(!isFinite(u)||u<0||u>1114111||i(u)!==u)return String.fromCharCode(65533);u<=65535?n.push(u):(e=55296+((u-=65536)>>10),t=u%1024+56320,n.push(e,t)),(o+1===a||n.length>16384)&&(s+=r.apply(null,n),n.length=0)}return s}}},function(e,t,n){"use strict";var r=n(91).escapeXml,i=function(e,t,n){var r="<"+e;if(t&&t.length>0)for(var i,o=0;void 0!==(i=t[o]);)r+=" "+i[0]+'="'+i[1]+'"',o++;return n&&(r+=" /"),r+=">"},o=/\<[^>]*\>/,a=/^javascript:|vbscript:|file:|data:/i,s=/^data:image\/(?:png|gif|jpeg|webp)/i,u=function(e){return a.test(e)&&!s.test(e)},l=function(e){var t,n,r,a,s,l,c,p=e.walker(),f="",h="\n",d=0,m=function(e){f+=d>0?e.replace(o,""):e,h=e},v=this.escape,g=function(){"\n"!==h&&(f+="\n",h="\n")},y=this.options;for(y.time&&console.time("rendering");a=p.next();){if(l=a.entering,s=a.node,t=[],y.sourcepos){var _=s.sourcepos;_&&t.push(["data-sourcepos",String(_[0][0])+":"+String(_[0][1])+"-"+String(_[1][0])+":"+String(_[1][1])])}switch(s.type){case"Text":m(v(s.literal,!1));break;case"Softbreak":m(this.softbreak);break;case"Hardbreak":m(i("br",[],!0)),g();break;case"Emph":m(i(l?"em":"/em"));break;case"Strong":m(i(l?"strong":"/strong"));break;case"HtmlInline":y.safe?m("\x3c!-- raw HTML omitted --\x3e"):m(s.literal);break;case"CustomInline":l&&s.onEnter?m(s.onEnter):!l&&s.onExit&&m(s.onExit);break;case"Link":l?(y.safe&&u(s.destination)||t.push(["href",v(s.destination,!0)]),s.title&&t.push(["title",v(s.title,!0)]),m(i("a",t))):m(i("/a"));break;case"Image":l?(0===d&&(y.safe&&u(s.destination)?m('<img src="" alt="'):m('<img src="'+v(s.destination,!0)+'" alt="')),d+=1):0===(d-=1)&&(s.title&&m('" title="'+v(s.title,!0)),m('" />'));break;case"Code":m(i("code")+v(s.literal,!1)+i("/code"));break;case"Document":break;case"Paragraph":if(null!==(c=s.parent.parent)&&"List"===c.type&&c.listTight)break;l?(g(),m(i("p",t))):(m(i("/p")),g());break;case"BlockQuote":l?(g(),m(i("blockquote",t)),g()):(g(),m(i("/blockquote")),g());break;case"Item":l?m(i("li",t)):(m(i("/li")),g());break;case"List":if(r="Bullet"===s.listType?"ul":"ol",l){var b=s.listStart;null!==b&&1!==b&&t.push(["start",b.toString()]),g(),m(i(r,t)),g()}else g(),m(i("/"+r)),g();break;case"Heading":r="h"+s.level,l?(g(),m(i(r,t))):(m(i("/"+r)),g());break;case"CodeBlock":(n=s.info?s.info.split(/\s+/):[]).length>0&&n[0].length>0&&t.push(["class","language-"+v(n[0],!0)]),g(),m(i("pre")+i("code",t)),m(v(s.literal,!1)),m(i("/code")+i("/pre")),g();break;case"HtmlBlock":g(),y.safe?m("\x3c!-- raw HTML omitted --\x3e"):m(s.literal),g();break;case"CustomBlock":g(),l&&s.onEnter?m(s.onEnter):!l&&s.onExit&&m(s.onExit),g();break;case"ThematicBreak":g(),m(i("hr",t,!0)),g();break;default:throw"Unknown node type "+s.type}}return y.time&&console.timeEnd("rendering"),f};e.exports=function(e){return{softbreak:"\n",escape:r,options:e||{},render:l}}},function(e,t,n){"use strict";e.exports.version="0.24.0",e.exports.Node=n(245),e.exports.Parser=n(1028),e.exports.HtmlRenderer=n(1030),e.exports.XmlRenderer=n(1034)},function(e,t,n){"use strict";var r=n(245),i=n(91),o=n(1033),a=i.normalizeURI,s=i.unescapeString,u=n(1029),l=n(138).decodeHTML;n(477);var c=i.ESCAPABLE,p="\\\\"+c,f="\\(([^\\\\()\\x00-\\x20]|"+p+"|\\\\)*\\)",h=i.ENTITY,d=i.reHtmlTag,m=new RegExp(/^[\u2000-\u206F\u2E00-\u2E7F\\'!"#\$%&\(\)\*\+,\-\.\/:;<=>\?@\[\]\^_`\{\|\}~]/),v=new RegExp('^(?:"('+p+'|[^"\\x00])*"|\'('+p+"|[^'\\x00])*'|\\(("+p+"|[^)\\x00])*\\))"),g=new RegExp("^(?:[<](?:[^ <>\\t\\n\\\\\\x00]|"+p+"|\\\\)*[>])"),y=new RegExp("^(?:[^\\\\()\\x00-\\x20]+|"+p+"|\\\\|"+f+")*"),_=new RegExp("^"+c),b=new RegExp("^"+h,"i"),x=/`+/,k=/^`+/,w=/\.\.\./g,E=/--+/g,S=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,C=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,A=/^ *(?:\n *)?/,D=/^\s/,M=/\s+/g,O=/ *$/,T=/^ */,P=/^ *(?:\n|$)/,I=new RegExp("^\\[(?:[^\\\\\\[\\]]|"+p+"|\\\\){0,1000}\\]"),R=/^[^\n`\[\]\\!<&*_'"]+/m,F=function(e){var t=new r("Text");return t._literal=e,t},N=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},j=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},B=function(){return this.match(A),!0},L=function(e){var t=this.match(k);if(null===t)return!1;for(var n,i,o=this.pos;null!==(n=this.match(x));)if(n===t)return(i=new r("Code"))._literal=this.subject.slice(o,this.pos-t.length).trim().replace(M," "),e.appendChild(i),!0;return this.pos=o,e.appendChild(F(t)),!0},q=function(e){var t,n=this.subject;return this.pos+=1,10===this.peek()?(this.pos+=1,t=new r("Hardbreak")Line truncated
|
|
||||||
/*!
|
|
||||||
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|
||||||
* Licensed under the MIT License.
|
|
||||||
*/var r,i="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,i="";else if(i.length>=n)return i.substr(0,n);for(;n>i.length&&t>1;)1&t&&(i+=e),t>>=1,e+=e;return i=(i+=e).substr(0,n)}},function(e,t,n){"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,a,s,u=1,l={},c=!1,p=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){o.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(i=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return l[u]=i,r(u),u++},f.clearImmediate=h}function h(e){delete l[e]}function d(e){if(c)setTimeout(d,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(21),n(42))},function(e,t,n){e.exports=i;var r=n(203).EventEmitter;function i(){r.call(this)}n(79)(i,r),i.Readable=n(251),i.Writable=n(1070),i.Duplex=n(1065),i.Transform=n(1069),i.PassThrough=n(1068),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t,n){"use strict";(function(t){
|
|
||||||
/*!
|
/*!
|
||||||
* @description Recursive object extending
|
* @description Recursive object extending
|
||||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
||||||
@@ -127,5 +48,46 @@ function(e){if("string"!=typeof e)throw new TypeError("expected a string.");retu
|
|||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function i(e,t){return"__proto__"===t?void 0:e[t]}var o=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,a=arguments[0];return Array.prototype.slice.call(arguments,1).forEach(function(s){"object"!=typeof s||null===s||Array.isArray(s)||Object.keys(s).forEach(function(u){return t=i(a,u),(e=i(s,u))===a?void 0:"object"!=typeof e||null===e?void(a[u]=e):Array.isArray(e)?void(a[u]=function e(t){var i=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?i[a]=e(t):n(t)?i[a]=r(t):i[a]=o({},t):i[a]=t}),i}(e)):n(e)?void(a[u]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(a[u]=o({},e)):void(a[u]=o(t,e))})}),a}}).call(t,n(48).Buffer)},function(e,t,n){e.exports=n(1138)},function(e,t,n){"use strict";(function(e,r){Object.defineProperty(t,"__esModule",{value:!0});var i,o,a=n(1139),s=(i=a)&&i.__esModule?i:{default:i};o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var u=(0,s.default)(o);t.default=u}).call(t,n(21),n(120)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n=e.Symbol;"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable";return t}},function(e,t,n){"use strict";e.exports=2147483647},function(e,t,n){"use strict";var r=n(64),i=n(1140);e.exports=function(e){if((e=r(e))>i)throw new TypeError(e+" exceeds maximum possible timeout");return e}},function(e,t,n){"use strict";var r=n(951),i=n(1143);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=_,t.resolve=function(e,t){return _(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?_(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=_(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),p=["%","/","?",";","#"].concat(c),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(957);function _(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var _=e=l.join(s);if(_=_.trim(),!n&&1===e.split("#").length){var b=u.exec(_);if(b)return this.path=_,this.href=_,this.pathname=b[1],b[2]?(this.search=b[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=a.exec(_);if(x){var k=(x=x[0]).toLowerCase();this.protocol=k,_=_.substr(x.length)}if(n||x||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var w="//"===_.substr(0,2);!w||x&&v[x]||(_=_.substr(2),this.slashes=!0)}if(!v[x]&&(w||x&&!g[x])){for(var E,S,C=-1,A=0;A<f.length;A++){-1!==(D=_.indexOf(f[A]))&&(-1===C||D<C)&&(C=D)}-1!==(S=-1===C?_.lastIndexOf("@"):_.lastIndexOf("@",C))&&(E=_.slice(0,S),_=_.slice(S+1),this.auth=decodeURIComponent(E)),C=-1;for(A=0;A<p.length;A++){var D;-1!==(D=_.indexOf(p[A]))&&(-1===C||D<C)&&(C=D)}-1===C&&(C=_.length),this.host=_.slice(0,C),_=_.slice(C),this.parseHost(),this.hostname=this.hostname||"";var M="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!M)for(var O=this.hostname.split(/\./),T=(A=0,O.length);A<T;A++){var P=O[A];if(P&&!P.match(h)){for(var I="",R=0,F=P.length;R<F;R++)P.charCodeAt(R)>127?I+="x":I+=P[R];if(!I.match(h)){var N=O.slice(0,A),j=O.slice(A+1),B=P.match(d);B&&(N.push(B[1]),j.unshift(B[2])),j.length&&(_="/"+j.join(".")+_),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=r.toASCII(this.hostname));var L=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+L,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!m[k])for(A=0,T=c.length;A<T;A++){var z=c[A];if(-1!==_.indexOf(z)){var U=encodeURIComponent(z);U===z&&(U=escape(z)),_=_.split(z).join(U)}}var W=_.indexOf("#");-1!==W&&(this.hash=_.substr(W),_=_.slice(0,W));var V=_.indexOf("?");if(-1!==V?(this.search=_.substr(V),this.query=_.substr(V+1),t&Line truncated
|
function n(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(n),n}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e,t){return"__proto__"===t?void 0:e[t]}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,a=arguments[0];return Array.prototype.slice.call(arguments,1).forEach(function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach(function(s){return t=o(a,s),(e=o(u,s))===a?void 0:"object"!=typeof e||null===e?void(a[s]=e):Array.isArray(e)?void(a[s]=function e(t){var o=[];return t.forEach(function(t,a){"object"==typeof t&&null!==t?Array.isArray(t)?o[a]=e(t):n(t)?o[a]=r(t):o[a]=i({},t):o[a]=t}),o}(e)):n(e)?void(a[s]=r(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(a[s]=i({},e)):void(a[s]=i(t,e))})}),a}}).call(t,n(55).Buffer)},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e?function e(t,n){var r;r=Array.isArray(t)?[]:{};n.push(t);Object.keys(t).forEach(function(o){var i=t[o];"function"!=typeof i&&(i&&"object"==typeof i?-1!==n.indexOf(t[o])?r[o]="[Circular]":r[o]=e(t[o],n.slice(0)):r[o]=i)});"string"==typeof t.name&&(r.name=t.name);"string"==typeof t.message&&(r.message=t.message);"string"==typeof t.stack&&(r.stack=t.stack);return r}(e,[]):"function"==typeof e?"[Function: "+(e.name||"anonymous")+"]":e}},function(e,t,n){var r=n(590),o=n(606),i=n(608),a=n(609),u=n(610);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=i,s.prototype.has=a,s.prototype.set=u,e.exports=s},function(e,t,n){var r=n(63)(n(36),"Map");e.exports=r},function(e,t,n){var r=n(130),o=n(614),i=n(615),a=n(616),u=n(617),s=n(618);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=u,l.prototype.set=s,e.exports=l},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(628),o=n(294),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(e){return null==e?[]:(e=Object(e),r(a(e),function(t){return i.call(e,t)}))}:o;e.exports=u},function(e,t,n){var r=n(630),o=n(47),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},function(e,t,n){(function(e){var r=n(36),o=n(631),i="object"==typeof t&&t&&!t.nodeType&&t,a=i&&"object"==typeof e&&e&&!e.nodeType&&e,u=a&&a.exports===i?r.Buffer:void 0,s=(u?u.isBuffer:void 0)||o;e.exports=s}).call(t,n(134)(e))},function(e,t){var n=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(278),o="object"==typeof t&&t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,u=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u}).call(t,n(134)(e))},function(e,t,n){var r=n(24),o=n(128),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!i.test(e)||null!=t&&e in Object(t)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=f;var r=n(9),o=a(n(657)),i=a(n(670));function a(e){return e&&e.__esModule?e:{default:e}}var u={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},s=function(e){var t=e=(0,r.objectify)(e),n=t.type,o=t.format,i=u[n+"_"+o]||u[n];return(0,r.isFunc)(i)?i(e):"Unknown Type: "+e.type},l=t.sampleFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(0,r.objectify)(t),i=o.type,a=o.example,u=o.properties,l=o.additionalProperties,c=o.items,f=n.includeReadOnly,p=n.includeWriteOnly;if(void 0!==a)return(0,r.deeplyStripKey)(a,"$$ref",function(e){return"string"==typeof e&&e.indexOf("#")>-1});if(!i)if(u)i="object";else{if(!c)return;i="array"}if("object"===i){var d=(0,r.objectify)(u),h={};for(var v in d)d[v]&&d[v].deprecated||d[v]&&d[v].readOnly&&!f||d[v]&&d[v].writeOnly&&!p||(h[v]=e(d[v],n));if(!0===Line truncated
|
||||||
|
/**
|
||||||
|
* Checks if an event is supported in the current execution environment.
|
||||||
|
*
|
||||||
|
* NOTE: This will not work correctly for non-generic events such as `change`,
|
||||||
|
* `reset`, `load`, `error`, and `select`.
|
||||||
|
*
|
||||||
|
* Borrows from Modernizr.
|
||||||
|
*
|
||||||
|
* @param {string} eventNameSuffix Event name, e.g. "click".
|
||||||
|
* @param {?boolean} capture Check if the capture phase is supported.
|
||||||
|
* @return {boolean} True if the event is supported.
|
||||||
|
* @internal
|
||||||
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
||||||
|
*/,e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},function(e,t,n){"use strict";var r={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function o(e){var t=this.nativeEvent;if(t.getModifierState)return t.getModifierState(e);var n=r[e];return!!n&&!!t[n]}e.exports=function(e){return o}},function(e,t,n){"use strict";var r=n(89),o=n(791),i=(n(15),n(38),n(219)),a=n(149),u=n(359);function s(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}var l=i(function(e,t,n){e.insertBefore(t,n)});function c(e,t,n){r.insertTreeBefore(e,t,n)}function f(e,t,n){Array.isArray(t)?function(e,t,n,r){var o=t;for(;;){var i=o.nextSibling;if(l(e,o,r),o===n)break;o=i}}(e,t[0],t[1],n):l(e,t,n)}function p(e,t){if(Array.isArray(t)){var n=t[1];d(e,t=t[0],n),e.removeChild(n)}e.removeChild(t)}function d(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}var h=o.dangerouslyReplaceNodeWithMarkup;var v={dangerouslyReplaceNodeWithMarkup:h,replaceDelimitedText:function(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&l(r,document.createTextNode(n),o):n?(u(o,n),d(r,o,t)):d(r,e,t)},processUpdates:function(e,t){for(var n=0;n<t.length;n++){var r=t[n];switch(r.type){case"INSERT_MARKUP":c(e,r.content,s(e,r.afterNode));break;case"MOVE_EXISTING":f(e,r.fromNode,s(e,r.afterNode));break;case"SET_MARKUP":a(e,r.content);break;case"TEXT_CONTENT":u(e,r.content);break;case"REMOVE_NODE":p(e,r.fromNode)}}}};e.exports=v},function(e,t,n){"use strict";e.exports={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}},function(e,t,n){"use strict";e.exports=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}},function(e,t,n){"use strict";var r=n(10),o=n(809),i=n(268)(n(75).isValidElement),a=(n(8),n(12),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0});function u(e){null!=e.checkedLink&&null!=e.valueLink&&r("87")}function s(e){u(e),(null!=e.value||null!=e.onChange)&&r("88")}function l(e){u(e),(null!=e.checked||null!=e.onChange)&&r("89")}var c={value:function(e,t,n){return!e[t]||a[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:i.func},f={};function p(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var d={checkPropTypes:function(e,t,n){for(var r in c){if(c.hasOwnProperty(r))var i=c[r](t,r,e,"prop",null,o);if(i instanceof Error&&!(i.message in f)){f[i.message]=!0;p(n)}}},getValue:function(e){return e.valueLink?(s(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(l(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(s(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(l(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=d},function(e,t,n){"use strict";var r=n(10),o=(n(8),!1),i={replaceNodeWithMarkup:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o&&r("104"),i.replaceNodeWithMarkup=e.replaceNodeWithMarkup,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=i},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,t){if(o(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var a=0;a<n.length;a++)if(!r.call(t,n[a])||!o(e[n[a]],t[n[a]]))return!1;return!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n=null===e||!1===e,r=null===t||!1===t;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}},function(e,t,n){"use strict";var r={escape:function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})},unescape:function(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}};e.exports=r},function(e,t,n){"use strict";var r=n(10),o=(n(46),n(113)
Line truncated
|
||||||
|
/*!
|
||||||
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
||||||
|
* (c) 2017 Joachim Wester
|
||||||
|
* MIT license
|
||||||
|
*/function o(e,t){return r.call(e,t)}function i(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);t=[];for(var r in e)o(e,r)&&t.push(r);return t}function a(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function u(e,t){var n;for(var r in e)if(o(e,r)){if(e[r]===t)return a(r)+"/";if("object"==typeof e[r]&&""!=(n=u(e[r],t)))return a(r)+"/"+n}return""}t.hasOwnProperty=o,t._objectKeys=i,t._deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}},t.isInteger=function(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0},t.escapePathComponent=a,t.unescapePathComponent=function(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")},t._getPathRecursive=u,t.getPath=function(e,t){if(e===t)return"/";var n=u(e,t);if(""===n)throw new Error("Object not found in root");return"/"+n},t.hasUndefined=function e(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0}else if("object"==typeof t){var o=i(t),a=o.length;for(n=0;n<a;n++)if(e(t[o[n]]))return!0}return!1};var s=function(e){function t(t,n,r,o,i){e.call(this,t),this.message=t,this.name=n,this.index=r,this.operation=o,this.tree=i}return n(t,e),t}(Error);t.PatchError=s},function(e,t,n){var r=n(49),o=n(154),i=n(72),a=n(115),u=n(919);e.exports=function(e,t){var n=1==e,s=2==e,l=3==e,c=4==e,f=6==e,p=5==e||f,d=t||u;return function(t,u,h){for(var v,m,g=i(t),y=o(g),b=r(u,h,3),_=a(y.length),w=0,E=n?d(t,_):s?d(t,0):void 0;_>w;w++)if((p||w in y)&&(m=b(v=y[w],w,g),e))if(n)E[w]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:E.push(v)}else if(c)return!1;return f?-1:l||c?c:E}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authorizeRequest=t.authorizeAccessCodeWithBasicAuthentication=t.authorizeAccessCodeWithFormParams=t.authorizeApplication=t.authorizePassword=t.preAuthorizeImplicit=t.CONFIGURE_AUTH=t.VALIDATE=t.AUTHORIZE_OAUTH2=t.PRE_AUTHORIZE_OAUTH2=t.LOGOUT=t.AUTHORIZE=t.SHOW_AUTH_POPUP=void 0;var r=l(n(45)),o=l(n(23)),i=l(n(40));t.showDefinitions=function(e){return{type:c,payload:e}},t.authorize=function(e){return{type:f,payload:e}},t.logout=function(e){return{type:p,payload:e}},t.authorizeOauth2=function(e){return{type:d,payload:e}},t.configureAuth=function(e){return{type:h,payload:e}};var a=l(n(210)),u=l(n(33)),s=n(9);function l(e){return e&&e.__esModule?e:{default:e}}var c=t.SHOW_AUTH_POPUP="show_popup",f=t.AUTHORIZE="authorize",p=t.LOGOUT="logout",d=(t.PRE_AUTHORIZE_OAUTH2="pre_authorize_oauth2",t.AUTHORIZE_OAUTH2="authorize_oauth2"),h=(t.VALIDATE="validate",t.CONFIGURE_AUTH="configure_auth");t.preAuthorizeImplicit=function(e){return function(t){var n=t.authActions,r=t.errActions,o=e.auth,a=e.token,s=e.isValid,l=o.schema,c=o.name,f=l.get("flow");delete u.default.swaggerUIRedirectOauth2,"accessCode"===f||s||r.newAuthErr({authId:c,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),a.error?r.newAuthErr({authId:c,source:"auth",level:"error",message:(0,i.default)(a)}):n.authorizeOauth2({auth:o,token:a})}};t.authorizePassword=function(e){return function(t){var n=t.authActions,r=e.schema,i=e.name,a=e.username,u=e.password,l=e.passwordType,c=e.clientId,f=e.clientSecret,p={grant_type:"password",scope:e.scopes.join(" ")},d={},h={};return"basic"===l?h.Authorization="Basic "+(0,s.btoa)(a+":"+u):((0,o.default)(p,{username:a},{password:u}),"query"===l?(c&&(d.client_id=c),f&&(d.client_secret=f)):h.Authorization="Basic "+(0,s.btoa)(c+":"+f)),n.authorizeRequest({body:(0,s.buildFormData)(p),url:r.get("tokenUrl"),name:i,headers:h,query:d,auth:e})}},t.authorizeApplication=function(e){return function(t){var n=t.authActions,r=e.schema,o=e.scopes,i=e.name,a=e.clientId,u=e.clientSecret,l={Authorization:"Basic "+(0,s.btoa)(a+":"+u)},c={grant_type:"client_credentials",scope:o.join(" ")};return n.authorizeRequest({body:(0,s.buildFormData)(c),name:i,url:r.get("tokenUrl"),auth:e,headers:l})}},t.authorizeAccessCodeWithFormParams=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,u=t.clientSecret,l={grant_type:"authorization_code",code:t.code,client_id:a,client_secret:u,redirect_uri:n};return r.authorizeRequest({body:(0,s.buildFormData)(l),name:i,url:o.get("tokenUrl"),auth:t})}},t.authorizeAccessCodeWithBasicAuthentication=function(e){var t=e.auth,n=e.redirectUrl;return function(e){var r=e.authActions,o=t.schema,i=t.name,a=t.clientId,u=t.clientSecret,l={Authorization:"Basic "+(0,s.btoa)(a+":"+u)},c={grant_type:"authorization_code",code:t.code,client_id:a,redirect_uri:n};return r.authorizeRequest({body:(0,s.buildFormData)(c),name:i,url:o.get("tokenUrl"),auth:t,headers:l})}},t.authorizeRequest=function(eLine truncated
|
||||||
|
/*!
|
||||||
|
* cookie
|
||||||
|
* Copyright(c) 2012-2014 Roman Shtylman
|
||||||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||||
|
* MIT Licensed
|
||||||
|
*/t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},o=t||{},a=e.split(i),s=o.decode||r,l=0;l<a.length;l++){var c=a[l],f=c.indexOf("=");if(!(f<0)){var p=c.substr(0,f).trim(),d=c.substr(++f,c.length).trim();'"'==d[0]&&(d=d.slice(1,-1)),void 0==n[p]&&(n[p]=u(d,s))}}return n},t.serialize=function(e,t,n){var r=n||{},i=r.encode||o;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!a.test(e))throw new TypeError("argument name is invalid");var u=i(t);if(u&&!a.test(u))throw new TypeError("argument val is invalid");var s=e+"="+u;if(null!=r.maxAge){var l=r.maxAge-0;if(isNaN(l))throw new Error("maxAge should be a Number");s+="; Max-Age="+Math.floor(l)}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");s+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(s+="; HttpOnly");r.secure&&(s+="; Secure");if(r.sameSite){var c="string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;default:throw new TypeError("option sameSite is invalid")}}return s};var r=decodeURIComponent,o=encodeURIComponent,i=/; */,a=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function u(e,t){try{return t(e)}catch(t){return e}}},function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},function(e,t){e.exports=function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){var o=e.charCodeAt(n+1);if(o>=56320&&o<=57343){var i=1024*(r-55296)+o-56320+65536;t.push(240+Math.floor(i/64/64/64),128+Math.floor(i/64/64)%64,128+Math.floor(i/64)%64,128+i%64),n+=1;continue}}r>=2048?t.push(224+Math.floor(r/64/64),128+Math.floor(r/64)%64,128+r%64):r>=128?t.push(192+Math.floor(r/64),128+r%64):t.push(r)}return t}},function(e,t){!function(){var e;function n(e,t){function n(e,t,n){if(!r(e))return n;var o=0,i=0;do{var a=t.exec(e);if(null===a)break;if(!(i<n))break;o+=a[0].length,i++}while(null!==a);return o>=e.length?-1:o}function r(e){return a.test(e)}function o(e,n){void 0==e&&(e=["[^]"]),void 0==n&&(n="g");var r=[];return t.forEach(function(e){r.push(e.source)}),r.push(i.source),r=r.concat(e),new RegExp(r.join("|"),n)}e.findCharIndex=function(e,t){if(t>=e.length)return-1;if(!r(e))return t;for(var n=o(),i=0;null!==n.exec(e)&&!(n.lastIndex>t);)i++;return i},e.findByteIndex=function(e,t){return t>=this.length(e)?-1:n(e,o(),t)},e.charAt=function(e,t){var n=this.findByteIndex(e,t);if(n<0||n>=e.length)return"";var r=e.slice(n,n+8),o=a.exec(r);return null===o?r[0]:o[0]},e.charCodeAt=function(e,t){var r=function(e,t){return n(e,new RegExp(i.source,"g"),t)}(e,t);if(r<0)return NaN;var o=e.charCodeAt(r);return 55296<=o&&o<=56319?1024*(o-55296)+(e.charCodeAt(r+1)-56320)+65536:o},e.fromCharCode=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e)},e.indexOf=function(e,t,n){void 0!==n&&null!==n||(n=0);var r=this.findByteIndex(e,n),o=e.indexOf(t,r);return o<0?-1:this.findCharIndex(e,o)},e.lastIndexOf=function(e,t,n){var r;if(void 0===n||null===n)r=e.lastIndexOf(t);else{var o=this.findByteIndex(e,n);r=e.lastIndexOf(t,o)}return r<0?-1:this.findCharIndex(e,r)},e.slice=function(e,t,n){var r,o=this.findByteIndex(e,t);return o<0&&(o=e.length),void 0===n||null===n?r=e.length:(r=this.findByteIndex(e,n))<0&&(r=e.length),e.slice(o,r)},e.substr=function(e,t,n){return t<0&&(t=this.length(e)+t),void 0===n||null===n?this.slice(e,t):this.slice(e,t,t+n)},e.substring=e.slice,e.length=function(e){return this.findCharIndex(e,e.length-1)+1},e.stringToCodePoints=function(e){for(var t=[],n=0;n<e.length&&(codePoint=this.charCodeAt(e,n),codePoint);n++)t.push(codePoint);return t},e.codePointsToString=function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.fromCharCode(e[n]));return t.join("")},e.stringToBytes=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e.charCodeAt(n),o=[];r>0;)o.push(255&r),r>>=8;1==o.length&&o.push(0),t=t.concat(o.reverse())}return t},e.bytesToString=function(e){for(var t=[],n=0;n<e.length;n+=2){var r=e[n]<<8|e[n+1];t.push(String.fromCharCode(r))}return t.join("")},e.stringToCharArray=function(e){var t=[],n=o();do{var r=n.exec(e);if(null===r)break;t.push(r[0])}while(null!==r);return t};var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,a=o([],"")}void 0!==t&&null!==t?e=t:"undefined"!=typeof window&&null!==window&&(void 0!==window.UtfString&&null!==window.UtfString||(window.UtfString={}),e=window.UtfString);e.visual={},n(e,[]),n(e.visual,[/\uD83C[\uDDE6-\uDDFF]\uD83C[\uDDE6-\uDDFF]/])}()},function(e,t){e.exports='---\nurl: "https://
Line truncated
|
||||||
|
/*!
|
||||||
|
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
||||||
|
*
|
||||||
|
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||||
|
* Licensed under the MIT License.
|
||||||
|
*/var r,o="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1&t&&(o+=e),t>>=1,e+=e;return o=(o+=e).substr(0,n)}},function(e,t,n){var r=n(61);e.exports=function(e){return r(e).toLowerCase()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(4)),o=f(n(2)),i=f(n(3)),a=f(n(5)),u=f(n(6)),s=n(0),l=f(s),c=(f(n(1)),f(n(11)),f(n(7)));function f(e){return e&&e.__esModule?e:{default:e}}var p=function(e){function t(){var e,n,i,u;(0,o.default)(this,t);for(var s=arguments.length,l=Array(s),c=0;c<s;c++)l[c]=arguments[c];return n=i=(0,a.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),i.onChange=function(e,t,n){var r=i.props;(0,r.specActions.changeParamByIdentity)(r.onChangeKey,e,t,n)},i.onChangeConsumesWrapper=function(e){var t=i.props;(0,t.specActions.changeConsumesValue)(t.onChangeKey,e)},u=n,(0,a.default)(i,u)}return(0,u.default)(t,e),(0,i.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.onTryoutClick,r=t.onCancelClick,o=t.parameters,i=t.allowTryItOut,a=t.tryItOutEnabled,u=t.specPath,s=t.fn,f=t.getComponent,p=t.getConfigs,d=t.specSelectors,h=t.specActions,v=t.pathMethod,m=f("parameterRow"),g=f("TryItOutButton"),y=a&&i;return l.default.createElement("div",{className:"opblock-section"},l.default.createElement("div",{className:"opblock-section-header"},l.default.createElement("div",{className:"tab-header"},l.default.createElement("h4",{className:"opblock-title"},"Parameters")),i?l.default.createElement(g,{enabled:a,onCancelClick:r,onTryoutClick:n}):null),o.count()?l.default.createElement("div",{className:"table-container"},l.default.createElement("table",{className:"parameters"},l.default.createElement("thead",null,l.default.createElement("tr",null,l.default.createElement("th",{className:"col col_header parameters-col_name"},"Name"),l.default.createElement("th",{className:"col col_header parameters-col_description"},"Description"))),l.default.createElement("tbody",null,function(e,t){return e.valueSeq().filter(c.default.Map.isMap).map(t)}(o,function(t,n){return l.default.createElement(m,{fn:s,specPath:u.push(n.toString()),getComponent:f,getConfigs:p,rawParam:t,param:d.parameterWithMetaByIdentity(v,t),key:t.get("in")+"."+t.get("name"),onChange:e.onChange,onChangeConsumes:e.onChangeConsumesWrapper,specSelectors:d,specActions:h,pathMethod:v,isExecute:y})}).toArray()))):l.default.createElement("div",{className:"opblock-description-wrapper"},l.default.createElement("p",null,"No parameters")))}}]),t}(s.Component);p.defaultProps={onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParameterExt=void 0;var r=o(n(0));o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var i=t.ParameterExt=function(e){var t=e.xKey,n=e.xVal;return r.default.createElement("div",{className:"parameter__extension"},t,": ",String(n))};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParameterIncludeEmpty=void 0;var r=i(n(0)),o=i(n(114));i(n(1)),i(n(11));function i(e){return e&&e.__esModule?e:{default:e}}var a=t.ParameterIncludeEmpty=function(e){var t=e.param,n=e.isIncluded,i=e.onChange,a=e.isDisabled;return t.get("allowEmptyValue")?r.default.createElement("div",{className:(0,o.default)("parameter__empty_value_toggle",{disabled:a})},r.default.createElement("input",{type:"checkbox",disabled:a,checked:!a&&n,onChange:function(e){i(e.target.checked)}}),"Send empty value"):null};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=d(n(4)),o=d(n(2)),i=d(n(3)),a=d(n(5)),u=d(n(6)),s=n(0),l=d(s),c=n(7),f=(d(n(1)),d(n(11)),d(n(33))),p=n(9);function d(e){return e&&e.__esModule?e:{default:e}}var h=function(e){function t(e,n){(0,o.default)(this,t);var i=(0,a.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e,n));return i.onChangeWrapper=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=i.props;return(0,n.onChange)(n.rawParam,""===e||e&&0===e.size?null:e,t)},i.onChangeIncludeEmpty=function(e){var t=i.props,n=t.specActions,r=t.param,o=t.pathMethod,a=r.get("name"),u=r.get("in");return n.updateEmptyParamInclusion(o,a,u,e)},i.setDefaultValue=function(){var e=i.props,t=e.specSelectors,n=e.pathMethod,r=e.rawParam,o=t.parameterWithMetaByIdentity(n,r);if(void 0===o.get("value")&&"body"!==o.get("in")){var a=void 0;t.isSwagger2()?a=o.get("x-example")||o.getIn(["default"])||o.getIn(["schema","example"])||o.getIn(["schema","default"]):t.isOAS3()&&(a=o.get("example")||o.getIn(["schema","example"])||o.getIn(["schema","default"])),void 0!==a&&i.onChangeWrapper((0,p.numberToString)(a))}},i.setDefaultValue(),i}return(Line truncated
|
||||||
|
/*!
|
||||||
|
* Autolinker.js
|
||||||
|
* 0.15.3
|
||||||
|
*
|
||||||
|
* Copyright(c) 2015 Gregory Jacobs <greg@greg-jacobs.com>
|
||||||
|
* MIT Licensed. http://www.opensource.org/licenses/mit-license.php
|
||||||
|
*
|
||||||
|
* https://github.com/gregjacobs/Autolinker.js
|
||||||
|
*/
|
||||||
|
var e,t,n,r,o=function(e){o.Util.assign(this,e)};return o.prototype={constructor:o,urls:!0,email:!0,twitter:!0,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser().parse(e),n=0,r=[],o=0,i=t.length;o<i;o++){var a=t[o],u=a.getType(),s=a.getText();if("element"===u)"a"===a.getTagName()&&(a.isClosing()?n=Math.max(n-1,0):n++),r.push(s);else if("entity"===u)r.push(s);else if(0===n){var l=this.linkifyStr(s);r.push(l)}else r.push(s)}return r.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this,this,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof o.HtmlTag?t.toString():this.getTagBuilder().build(e).toString()},getHtmlParser:function(){var e=this.htmlParser;return e||(e=this.htmlParser=new o.htmlParser.HtmlParser),e},getMatchParser:function(){var e=this.matchParser;return e||(e=this.matchParser=new o.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,stripPrefix:this.stripPrefix})),e},getTagBuilder:function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new o.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e}},o.link=function(e,t){return new o(t).link(e)},o.match={},o.htmlParser={},o.matchParser={},o.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},extend:function(e,t){var n,r=e.prototype,i=function(){};i.prototype=r;var a=(n=t.hasOwnProperty("constructor")?t.constructor:function(){r.constructor.apply(this,arguments)}).prototype=new i;return a.constructor=n,a.superclass=r,delete t.constructor,o.Util.assign(a,t),n},ellipsis:function(e,t,n){return e.length>t&&(n=null==n?"..":n,e=e.substring(0,t-n.length)+n),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],o=0;n=t.exec(e);)r.push(e.substring(o,n.index)),r.push(n[0]),o=n.index+n[0].length;return r.push(e.substring(o)),r}},o.HtmlTag=o.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(e){o.Util.assign(this,e),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(e){var t=this.getAttrs();return o.Util.assign(t,e),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=o.Util.indexOf,a=n?n.split(r):[],u=e.split(r);t=u.shift();)-1===i(a,t)&&a.push(t);return this.getAttrs().class=a.join(" "),this},removeClass:function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=o.Util.indexOf,a=n?n.split(r):[],u=e.split(r);a.length&&(t=u.shift());){var s=i(a,t);-1!==s&&a.splice(s,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")}}),o.AnchorTagBuilder=o.Util.extend(Object,{constructor:function(e){o.Util.assign(this,e)},build:function(e){return new o.HtmlTag({tagName:"a",attrs:this.createAttrs(e.getType(),e.getAnchorHref()),innerHtml:this.processAnchorText(e.getAnchorText())})},createAttrs:function(e,t){var n={href:t},r=this.createCssClass(e);return r&&(n.class=r),this.newWindow&&(n.target="_blank"),n},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(e){return o.Util.ellipsis(e,this.truncate||Number.POSITIVE_INFINITY)}}),o.htmlParser.HtmlParser=o.Util.extend(Object,{htmlRegex:(e=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/.source+"(?:\\s*=\\s*"+e.source+")?",new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",t,"|",e.source+")",")*",">",")","|","(?:","<(/)?","("+/[0-9a-zA-Z][0-9a-zA-Z:]*/.source+")","(?:","\\s+",t,")*","\\s*/?",">",")"].join(""),"gi")),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,n,r=this.htmlRegex,o=0,i=[];null!==(t=r.exec(e));){var a=t[0],u=t[1]||t[3],s=!!t[2],l=e.substring(o,t.index)Line truncated
|
||||||
//# sourceMappingURL=swagger-ui-bundle.js.map
|
//# sourceMappingURL=swagger-ui-bundle.js.map
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist",n(n.s=538)}([function(t,e,n){"use strict";var r=n(48),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];t.exports=function(t,e){var n,s;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===i.indexOf(e))throw new r('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(n=e.styleAliases||null,s={},null!==n&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){s[String(e)]=t})}),s),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},function(t,e,n){var r=n(154)("wks"),i=n(107),o=n(5).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(5),i=n(17),o=n(18),s=n(29),a=n(60),u=function(t,e,n){var c,l,h,f,p=t&u.F,d=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,g=d?r:m?r[e]||(r[e]={}):(r[e]||{}).prototype,x=d?i:i[e]||(i[e]={}),b=x.prototype||(x.prototype={});for(c in d&&(n=e),n)h=((l=!p&&g&&void 0!==g[c])?g:n)[c],f=y&&l?a(h,r):v&&"function"==typeof h?a(Function.call,h):h,g&&s(g,c,h,t&u.U),x[c]!=h&&o(x,c,f),v&&b[c]!=h&&(b[c]=h)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){var r=n(3),i=n(43),o=n(10),s=/"/g,a=function(t,e,n,r){var i=String(o(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(r).replace(s,""")+'"'),a+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(a),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(93)("wks"),i=n(58),o=n(9).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(178),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){t.exports=!n(25)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(9),i=n(2),o=n(134),s=n(26),a=function(t,e,n){var u,c,l,h=t&a.F,f=t&a.G,p=t&a.S,d=t&a.P,m=t&a.B,v=t&a.W,y=f?i:i[e]||(i[e]={}),g=y.prototype,x=f?r:p?r[e]:(r[e]||{}).prototype;for(u in f&&(n=e),n)(c=!h&&x&&void 0!==x[u])&&u in y||(l=c?x[u]:n[u],y[u]=f&&"function"!=typeof x[u]?n[u]:m&&c?o(l,r):v&&x[u]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):d&&"function"==typeof l?o(Function.call,l):l,d&&((y.virtual||(y.virtual={}))[u]=l,t&a.R&&g&&!g[u]&&s(g,u,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(24),i=n(136),o=n(95),s=Object.defineProperty;e.f=n(12)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(28);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports={version:"Line truncated
|
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist",n(n.s=206)}([function(t,e,n){"use strict";var r=n(52),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];t.exports=function(t,e){var n,u;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===i.indexOf(e))throw new r('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(n=e.styleAliases||null,u={},null!==n&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){u[String(e)]=t})}),u),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},function(t,e,n){var r=n(133)("wks"),i=n(97),o=n(3).Symbol,u="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(3),i=n(10),o=n(18),u=n(29),a=n(61),s=function(t,e,n){var c,f,l,p,h=t&s.F,d=t&s.G,v=t&s.S,y=t&s.P,g=t&s.B,m=d?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,_=d?i:i[e]||(i[e]={}),b=_.prototype||(_.prototype={});for(c in d&&(n=e),n)l=((f=!h&&m&&void 0!==m[c])?m:n)[c],p=g&&f?a(l,r):y&&"function"==typeof l?a(Function.call,l):l,m&&u(m,c,l,t&s.U),_[c]!=l&&o(_,c,p),y&&b[c]!=l&&(b[c]=l)};r.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var r=n(4),i=n(42),o=n(11),u=/"/g,a=function(t,e,n,r){var i=String(o(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(r).replace(u,""")+'"'),a+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(a),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e,n){var r=n(91)("wks"),i=n(56),o=n(9).Symbol,u="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(169),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){var r=n(9),i=n(2),o=n(126),u=n(25),a=n(17),s=function(t,e,n){var c,f,l,p=t&s.F,h=t&s.G,d=t&s.S,v=t&s.P,y=t&s.B,g=t&s.W,m=h?i:i[e]||(i[e]={}),_=m.prototype,b=h?r:d?r[e]:(r[e]||{}).prototype;for(c in h&&(n=e),n)(f=!p&&b&&void 0!==b[c])&&a(m,c)||(l=f?b[c]:n[c],m[c]=h&&"function"!=typeof b[c]?n[c]:y&&f?o(l,r):g&&b[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&s.R&&_&&!_[c]&&u(_,c,l)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var r=n(26),i=n(127),o=n(87),u=Object.defineProperty;e.f=n(16)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(28)(function(){return 7!=Object.defineProperty({},"a",{get:function(){rLine truncated
|
||||||
|
/*
|
||||||
|
object-assign
|
||||||
|
(c) Sindre Sorhus
|
||||||
|
@license MIT
|
||||||
|
*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,u,a=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),s=1;s<arguments.length;s++){for(var c in n=Object(arguments[s]))i.call(n,c)&&(a[c]=n[c]);if(r){u=r(n);for(var f=0;f<u.length;f++)o.call(n,u[f])&&(a[u[f]]=n[u[f]])}}return a}},function(t,e,n){"use strict";var r=function(t){};t.exports=function(t,e,n,i,o,u,a,s){if(r(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,i,o,u,a,s],l=0;(c=new Error(e.replace(/%s/g,function(){return f[l++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(t,e,n){var r=n(344);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(68),i=n(346),o=n(347),u="[object Null]",a="[object Undefined]",s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?a:u:s&&s in Object(t)?i(t):o(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){(function(t){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(e,n(67).Buffer)},function(t,e,n){"use strict";function r(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(t){var e=this.name+": ";return e+=this.reason||"(unknown reason)",!t&&this.mark&&(e+=" "+this.mark.toString()),e},t.exports=r},function(t,e,n){"use strict";var r=n(37);t.exports=new r({include:[n(202)],implicit:[n(532),n(533)],explicit:[n(534),n(535),n(536),n(537)]})},function(t,e){t.exports=!0},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(86);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(19),i=n(224),o=n(225),u=Object.defineProperty;e.f=n(41)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(62);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(230),i=n(11);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(18),i=n(29),o=n(42),u=n(11),a=n(1);t.exports=function(t,e,n){var s=a(t),c=n(u,s,""[t]),f=c[0],l=c[1];o(function(){var e={};return e[s]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,f),r(RegExp.prototype,s,2==e?function(t,e){return l.call(t,this,e)}:function(t){returnLine truncated
|
||||||
/*!
|
/*!
|
||||||
* The buffer module from node.js, for the browser.
|
* The buffer module from node.js, for the browser.
|
||||||
*
|
*
|
||||||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
var r=n(266),i=n(359),o=n(169);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|p(e.length);return 0===(t=a(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|p(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(t).length;default:if(r)return z(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=n;o<a;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(c(t,o+f)!==c(e,f)){h=!1;break}if(h)return o}return-1}function g(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function x(t,e,n,r){return J(z(e,t.length-n),t,n,r)}function b(t,e,n,r){return J(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function D(t,e,n,r){return b(t,e,n,r)}function w(t,e,n,r){return J(U(e),t,n,r)}function E(t,e,n,r){return J(function(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function _(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128=Line truncated
|
var r=n(326),i=n(327),o=n(167);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(u()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=s.prototype:(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);s.TYPED_ARRAY_SUPPORT?(t=e).__proto__=s.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(s.isBuffer(e)){var n=0|h(e.length);return 0===(t=a(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(f(e),t=a(t,e<0?0:0|h(e)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|h(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function h(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:g(t,e,n,r,i);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):g(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,n,r,i){var o,u=1,a=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,n/=2}function c(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(i){var f=-1;for(o=n;o<a;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===s)return f*u}else-1!==f&&(o-=o-f),f=-1}else for(n+s>a&&(n=a-s),o=n;o>=0;o--){for(var l=!0,p=0;p<s;p++)if(c(t,o+p)!==c(e,p)){l=!1;break}if(l)return o}return-1}function m(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var u=0;u<r;++u){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))return u;t[n+u]=a}return u}function _(t,e,n,r){return q(U(e,t.length-n),t,n,r)}function b(t,e,n,r){return q(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function w(t,e,n,r){return b(t,e,n,r)}function x(t,e,n,r){return q(B(e),t,n,r)}function S(t,e,n,r){return q(function(t,e){for(var n,r,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)n=t.charCodeAt(u),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function E(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function A(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,u,a,s,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&c)<<6|63&o)>127&&(f=s);break;case 3:o=t[i+1],u=t[i+2],128=Line truncated
|
||||||
/*
|
|
||||||
object-assign
|
|
||||||
(c) Sindre Sorhus
|
|
||||||
@license MIT
|
|
||||||
*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,s,a=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),u=1;u<arguments.length;u++){for(var c in n=Object(arguments[u]))i.call(n,c)&&(a[c]=n[c]);if(r){s=r(n);for(var l=0;l<s.length;l++)o.call(n,s[l])&&(a[s[l]]=n[s[l]])}}return a}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(86);t.exports=function(t){return Object(r(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(59);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";var r=n(18),i=n(29),o=n(43),s=n(10),a=n(1);t.exports=function(t,e,n){var u=a(t),c=n(s,u,""[t]),l=c[0],h=c[1];o(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,l),r(RegExp.prototype,u,2==e?function(t,e){return h.call(t,this,e)}:function(t){return h.call(t,this)}))}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(16),i=n(273),o=n(292),s=Object.defineProperty;e.f=n(42)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(275),i=n(10);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(162),i=n(165),o=n(343),s=n(348);(t.exports=function(t,e){var n,o,a,u,c;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],null==t?(n=a=!0,o=!1):(n=s.call(t,"c"),o=s.call(t,"e"),a=s.call(t,"w")),c={value:e,configurable:n,enumerable:o,writable:a},u?r(i(u),c):c}).gs=function(t,e,n){var a,u,c,l;return"string"!=typeof t?(c=n,n=e,e=t,t=null):c=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(c=n,n=void 0):(c=e,e=n=void 0),null==t?(a=!0,u=!1):(a=s.call(t,"c"),u=s.call(t,"e")),l={get:e,set:n,configurable:a,enumerable:u},c?r(i(c),l):l}},function(t,e,n){"use strict";t.exports=n(340)("forEach")},function(t,e,n){"use strict";function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t},t.exports=i},function(t,e,n){"use strict";var r=n(68);t.exports=r},function(t,e,n){"use strict";var r=n(33);t.exports=r.DEFAULT=new r({include:[n(49)],explicit:[n(371),n(370),n(369)]})},function(t,e,n){var r=n(445),i=n(446),o=n(447),s=n(448),a=n(449);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,t.exports=u},function(t,e,n){var r=n(7).Symbol;t.exports=r},function(t,e,n){var r=n(77);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(442);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(34)(Object,"create");t.exports=r},function(t,e,n){var r=n(79),i=1/0;t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(185),i=n(117);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(50),i=n(52),o="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||i(t)&&r(t)==o}},function(t,e,n){var r=n(389),i=n(406),o=n(78);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports=function(t,n,r,i){if("function"!=typeof t)throLine truncated
|
|
||||||
//# sourceMappingURL=swagger-ui-standalone-preset.js.map
|
//# sourceMappingURL=swagger-ui-standalone-preset.js.map
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
.swagger-ui{
|
.swagger-ui{
|
||||||
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */font-family:Open Sans,sans-serif;color:#3b4151}.swagger-ui html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{background-color:transparent;-webkit-text-decoration-skip:objects}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui [hidden],.swagger-ui template{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0Line truncated
|
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */font-family:sans-serif;color:#3b4151}.swagger-ui html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{background-color:transparent;-webkit-text-decoration-skip:objects}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui [hidden],.swagger-ui template{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTRDOTY4N0U2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTRDOTY4N0Q2N0VFMTFFNjg2MzZDQjkwNkQ4MjgwMEIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3NjcyQkQ3NjY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3NjcyQkQ3NzY3QzUxMUU2QjJCQ0UyNDA4MTAwMjE3MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsBS+GMAAAAjSURBVHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54Line truncated
|
||||||
/*# sourceMappingURL=swagger-ui.css.map*/
|
/*# sourceMappingURL=swagger-ui.css.map*/
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("immutable"),require("react-immutable-proptypes"),require("reselect"),require("classnames"),require("serialize-error"),require("deep-extend"),require("js-yaml"),require("react-collapse"),require("swagger-client"),require("url-parse"),require("base64-js"),require("commonmark"),require("css.escape"),require("dompurify"),require("ieee754"),require("isarray"),require("js-file-download"),require("memoizee"),require("react-debounce-input"),require("react-dom"),require("react-immutable-pure-component"),require("react-markdown"),require("react-redux"),require("react-split-pane"),require("redux"),require("redux-immutable"),require("regenerator-runtime"),require("remarkable"),require("xml"),require("xml-but-prettier"),require("yaml-js"),require("zenscroll")):"function"==typeof define&&define.amd?define(["react","prop-types","immutable","react-immutable-proptypes","reselect","classnames","serialize-error","deep-extend","js-yaml","react-collapse","swagger-client","url-parse","base64-js","commonmark","css.escape","dompurify","ieee754","isarray","js-file-download","memoizee","react-debounce-input","react-dom","react-immutable-pure-component","react-markdown","react-redux","react-split-pane","redux","redux-immutable","regenerator-runtime","remarkable","xml","xml-but-prettier","yaml-js","zenscroll"],t):"object"==typeof exports?exports.SwaggerUICore=t(require("react"),require("prop-types"),require("immutable"),require("react-immutable-proptypes"),require("reselect"),require("classnames"),require("serialize-error"),require("deep-extend"),require("js-yaml"),require("react-collapse"),require("swagger-client"),require("url-parse"),require("base64-js"),require("commonmark"),require("css.escape"),require("dompurify"),require("ieee754"),require("isarray"),require("js-file-download"),require("memoizee"),require("react-debounce-input"),require("react-dom"),require("react-immutable-pure-component"),require("react-markdown"),require("react-redux"),require("react-split-pane"),require("redux"),require("redux-immutable"),require("regenerator-runtime"),require("remarkable"),require("xml"),require("xml-but-prettier"),require("yaml-js"),require("zenscroll")):e.SwaggerUICore=t(e.react,e["prop-types"],e.immutable,e["react-immutable-proptypes"],e.reselect,e.classnames,e["serialize-error"],e["deep-extend"],e["js-yaml"],e["react-collapse"],e["swagger-client"],e["url-parse"],e["base64-js"],e.commonmark,e["css.escape"],e.dompurify,e.ieee754,e.isarray,e["js-file-download"],e.memoizee,e["react-debounce-input"],e["react-dom"],e["react-immutable-pure-component"],e["react-markdown"],e["react-redux"],e["react-split-pane"],e.redux,e["redux-immutable"],e["regenerator-runtime"],e.remarkable,e.xml,e["xml-but-prettier"],e["yaml-js"],e.zenscroll)}(this,function(e,t,r,n,a,o,u,i,l,s,c,f,d,p,h,m,v,g,y,_,b,E,S,x,C,w,j,A,R,O,P,M,T,k){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist",r(r.s=614)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){"use strict";t.__esModule=!0;var n,a=r(210),o=(n=a)&&n.__esModule?n:{default:n};t.default=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,o.default)(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()},function(e,t,r){e.exports={default:r(355),__esModule:!0}},function(e,t,r){"use strict";t.__esModule=!0;var n=u(r(344)),a=u(r(343)),o=u(r(30));function u(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,o.default)(t)));e.prototype=(0,a.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}},function(e,t,r){"use strict";t.__esModule=!0;var n,a=r(30),o=(n=a)&&n.__esModule?n:{default:n};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,o.default)(t))&&"function"!=typeof t?e:t}},function(e,t){e.exports=require("immutable")},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModulLine truncated
|
(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory();else if(typeof define==="function"&&define.amd)define([],factory);else if(typeof exports==="object")exports["SwaggerUICore"]=factory();else root["SwaggerUICore"]=factory()})(typeof self!=="undefined"?self:this,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{configurable:false,enumerable:true,get:getter})}};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module["default"]}:function getModuleExports(){return module};__webpack_require__.d(getter,"a",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p="/dist";return __webpack_require__(__webpack_require__.s=287)}([function(module,exports){module.exports=require("react")},function(module,exports){module.exports=require("prop-types")},function(module,exports,__webpack_require__){"use strict";exports.__esModule=true;exports.default=function(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=true;var _defineProperty=__webpack_require__(179);var _defineProperty2=_interopRequireDefault(_defineProperty);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;(0,_defineProperty2.default)(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor}}()},function(module,exports,__webpack_require__){module.exports={default:__webpack_require__(530),__esModule:true}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=true;var _typeof2=__webpack_require__(37);var _typeof3=_interopRequireDefault(_typeof2);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default=function(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return call&&((typeof call==="undefined"?"undefined":(0,_typeof3.default)(call))==="object"||typeof call==="function")?call:self}},function(module,exports,__webpack_require__){"use strict";exports.__esModule=true;var _setPrototypeOf=__webpack_require__(532);var _setPrototypeOf2=_interopRequireDefault(_setPrototypeOf);var _create=__webpack_require__(536);var _create2=_interopRequireDefault(_create);var _typeof2=__webpack_require__(37);var _typeof3=_interopRequireDefault(_typeof2);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default=function(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==="undefined"?"undefined":(0,_typeof3.default)(superClass)))}subClass.prototype=(0,_create2.default)(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)_setPrototypeOf2.default?(0,_setPrototypeOf2.default)(subClass,superClass):subClass.__proto__=superClass}},function(module,exports){module.exports=require("immutable")},function(module,exports,__webpack_require__){"use strict";(function(Buffer){Object.defineProperty(exports,"__esModule",{value:true});exports.getCommonExtensions=exports.getExtensions=exports.escapeDeepLinkPath=exports.createDeepLinkPath=exports.shallowEqualKeys=exports.buildFormData=exports.sorters=exports.btoa=exports.serializeSearch=exports.parseSearch=exports.getSampleSchema=exports.validateParam=exports.validatePattern=exports.validateMinLength=exports.validateMaxLength=exports.validateGuid=exports.validateDateTime=exports.validateString=exports.validateBoolean=exports.validateFile=exports.validateInteger=exports.validateNumber=exports.validateMinimum=exports.validateMaximum=exports.propChecker=exports.memoize=exports.isImmutable=undefined;var _stringify=__webpack_require__(30);var _stringify2=_interopRequireDefault(_stringiLine truncated
|
||||||
/*!
|
/*!
|
||||||
* The buffer module from node.js, for the browser.
|
* The buffer module from node.js, for the browser.
|
||||||
*
|
*
|
||||||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
var n=r(592),a=r(596),o=r(597);function u(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(u()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,r){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return s(this,e,t,r)}function s(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(t,r),a=(e=i(e,n)).write(t,r);a!==n&&(e=e.slice(0,a));return e}(e,t,r):function(e,t){if(l.isBuffer(t)){var r=0|p(t.length);return 0===(e=i(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?i(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=i(e,t<0?0:0|p(t)),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|p(t.length);e=i(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,a);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,a){var o,u=1,i=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;u=2,i/=2,l/=2,r/=2}function s(e,t){return 1===u?e[t]:e.readUInt16BE(t*u)}if(a){var c=-1;for(o=r;o<i;o++)if(s(e,o)===s(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*u}else-1!==c&&(o-=o-c),c=-1}else for(r+l>i&&(r=i-l),o=r;o>=0;o--){for(var f=!0,d=0;d<l;d++)if(s(e,o+d)!==s(t,d)){f=!1;break}if(f)return o}return-1}function y(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var i=parseInt(t.substr(2*u,2),16);if(isNaN(i))return u;e[r+u]=i}return u}function _(e,t,r,n){return B(U(t,e.length-r),e,r,n)}function b(e,t,r,n){return B(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return b(e,t,r,n)}function S(e,t,r,n){return B(V(t),e,r,n)}function x(e,t,r,n){return B(function(e,t){for(var r,n,a,o=[],u=0;u<e.length&&!((t-=2)<0);++u)r=e.charCodeAt(u),n=r>>8,a=r%256,o.push(a),o.push(n);return o}(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function w(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var o,u,i,l,s=e[a],c=null,f=s>239?4:s>223?3:s>191?2:1;if(a+f<=r)switch(f){case 1:s<128&&(c=s);break;case 2:128==(192&(o=e[a+1]))&&(l=(31&s)<<6|63&o)>127&&(c=l);break;case 3:o=e[a+1],u=e[a+2],128=Line truncated
|
var base64=__webpack_require__(383);var ieee754=__webpack_require__(384);var isArray=__webpack_require__(385);exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global.TYPED_ARRAY_SUPPORT!==undefined?global.TYPED_ARRAY_SUPPORT:typedArraySupport();exports.kMaxLength=kMaxLength();function typedArraySupport(){try{var arr=new Uint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return arr.foo()===42&&typeof arr.subarray==="function"&&arr.subarray(1,1).byteLength===0}catch(e){return false}}function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()<length){throw new RangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){that=new Uint8Array(length);that.__proto__=Buffer.prototype}else{if(that===null){that=new Buffer(length)}that.length=length}return that}function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length)}if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(this,arg)}return from(this,arg,encodingOrOffset,length)}Buffer.poolSize=8192;Buffer._augment=function(arr){arr.__proto__=Buffer.prototype;return arr};function from(that,value,encodingOrOffset,length){if(typeof value==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&value instanceof ArrayBuffer){return fromArrayBuffer(that,value,encodingOrOffset,length)}if(typeof value==="string"){return fromString(that,value,encodingOrOffset)}return fromObject(that,value)}Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;if(typeof Symbol!=="undefined"&&Symbol.species&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true})}}function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be a number')}else if(size<0){throw new RangeError('"size" argument must not be negative')}}function alloc(that,size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(that,size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill)}return createBuffer(that,size)}Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)};function allocUnsafe(that,size){assertSize(size);that=createBuffer(that,size<0?0:checked(size)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<size;++i){that[i]=0}}return that}Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)};function fromString(that,string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError('"encoding" must be a valid string encoding')}var length=byteLength(string,encoding)|0;that=createBuffer(that,length);var actual=that.write(string,encoding);if(actual!==length){that=that.slice(0,actual)}return that}function fromArrayLike(that,array){var length=array.length<0?0:checked(array.length)|0;that=createBuffer(that,length);for(var i=0;i<length;i+=1){that[i]=array[i]&255}return that}function fromArrayBuffer(that,array,byteOffset,length){array.byteLength;if(byteOffset<0||array.byteLength<byteOffset){throw new RangeError("'offset' is out of bounds")}if(array.byteLength<byteOffset+(length||0)){throw new RangeError("'length' is out of bounds")}if(byteOffset===undefined&&length===undefined){array=new Uint8Array(array)}else if(length===undefined){array=new Uint8Array(array,byteOffset)}else{array=new Uint8Array(array,byteOffset,length)}if(Buffer.TYPED_ARRAY_SUPPORT){that=array;that.__proto__=Buffer.prototype}else{that=fromArrayLike(that,array)}return that}function fromObject(that,obj){if(Buffer.isBuffer(obj)){var len=checked(obj.length)|0;that=createBuffer(that,len);if(that.length===0){return that}obj.copy(that,0,0,len);return that}if(obj){if(typeof ArrayBuffer!=="undefined"&&obj.buffer instanceof ArrayBuffer||"length"in obj){if(typeof obj.length!=="number"||isnan(obj.length)){return createBuffer(that,0)}return fromArrayLike(that,obj)}if(obj.type==="Buffer"&&isArray(obj.data)){return fromArrayLike(that,obj.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(length){if(length>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){returnLine truncated
|
||||||
//# sourceMappingURL=swagger-ui.js.map
|
//# sourceMappingURL=swagger-ui.js.map
|
||||||
@@ -6,6 +6,11 @@ function patchSwaggerUi() {
|
|||||||
var authWrapper = document.querySelector('.auth-wrapper');
|
var authWrapper = document.querySelector('.auth-wrapper');
|
||||||
var authorizeButton = document.querySelector('.auth-wrapper .authorize');
|
var authorizeButton = document.querySelector('.auth-wrapper .authorize');
|
||||||
var djangoSessionAuth = document.querySelector('#django-session-auth');
|
var djangoSessionAuth = document.querySelector('#django-session-auth');
|
||||||
|
if (!djangoSessionAuth) {
|
||||||
|
console.log("WARNING: session auth disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (document.querySelector('.auth-wrapper #django-session-auth')) {
|
if (document.querySelector('.auth-wrapper #django-session-auth')) {
|
||||||
console.log("WARNING: session auth already patched; skipping patchSwaggerUi()");
|
console.log("WARNING: session auth already patched; skipping patchSwaggerUi()");
|
||||||
return;
|
return;
|
||||||
@@ -27,7 +32,6 @@ function initSwaggerUi() {
|
|||||||
var swaggerConfig = {
|
var swaggerConfig = {
|
||||||
url: specURL,
|
url: specURL,
|
||||||
dom_id: '#swagger-ui',
|
dom_id: '#swagger-ui',
|
||||||
displayOperationId: true,
|
|
||||||
displayRequestDuration: true,
|
displayRequestDuration: true,
|
||||||
presets: [
|
presets: [
|
||||||
SwaggerUIBundle.presets.apis,
|
SwaggerUIBundle.presets.apis,
|
||||||
@@ -57,7 +61,7 @@ function initSwaggerUi() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(swaggerSettings);
|
console.log('swaggerSettings', swaggerSettings);
|
||||||
for (var p in swaggerSettings) {
|
for (var p in swaggerSettings) {
|
||||||
if (swaggerSettings.hasOwnProperty(p)) {
|
if (swaggerSettings.hasOwnProperty(p)) {
|
||||||
swaggerConfig[p] = swaggerSettings[p];
|
swaggerConfig[p] = swaggerSettings[p];
|
||||||
@@ -66,7 +70,7 @@ function initSwaggerUi() {
|
|||||||
window.ui = SwaggerUIBundle(swaggerConfig);
|
window.ui = SwaggerUIBundle(swaggerConfig);
|
||||||
|
|
||||||
var oauth2Config = JSON.parse(document.getElementById('oauth2-config').innerHTML);
|
var oauth2Config = JSON.parse(document.getElementById('oauth2-config').innerHTML);
|
||||||
console.log(oauth2Config);
|
console.log('oauth2Config', oauth2Config);
|
||||||
window.ui.initOAuth(oauth2Config);
|
window.ui.initOAuth(oauth2Config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{% load static %}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>{{ title }}</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static 'drf-yasg/style.css' %}"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script id="redoc-settings" type="application/json">{{ redoc_settings | safe }}</script>
|
||||||
|
|
||||||
|
<script src="{% static 'drf-yasg/insQ.min.js' %}"></script>
|
||||||
|
<script src="{% static 'drf-yasg/redoc-init.js' %}"> </script>
|
||||||
|
<script src="{% static 'drf-yasg/redoc-old/redoc.min.js' %}"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -7,12 +7,18 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="{% static 'drf-yasg/style.css' %}"/>
|
<link rel="stylesheet" type="text/css" href="{% static 'drf-yasg/style.css' %}"/>
|
||||||
|
{% block extra_styles %}
|
||||||
|
{# -- Add any additional CSS scripts here -- #}
|
||||||
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script id="redoc-settings" type="application/json">{{ redoc_settings | safe }}</script>
|
<script id="redoc-settings" type="application/json">{{ redoc_settings | safe }}</script>
|
||||||
|
|
||||||
<script src="{% static 'drf-yasg/insQ.min.js' %}"></script>
|
<script src="{% static 'drf-yasg/insQ.min.js' %}"></script>
|
||||||
<script src="{% static 'drf-yasg/redoc-init.js' %}"> </script>
|
<script src="{% static 'drf-yasg/redoc-init.js' %}"></script>
|
||||||
<script src="{% static 'drf-yasg/redoc/redoc.min.js' %}"></script>
|
<script src="{% static 'drf-yasg/redoc/redoc.min.js' %}"></script>
|
||||||
|
{% block extra_scripts %}
|
||||||
|
{# -- Add any additional scripts here -- #}
|
||||||
|
{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -11,53 +11,14 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="{% static 'drf-yasg/swagger-ui-dist/swagger-ui.css' %}">
|
<link rel="stylesheet" type="text/css" href="{% static 'drf-yasg/swagger-ui-dist/swagger-ui.css' %}">
|
||||||
<link rel="icon" type="image/png" href="{% static 'drf-yasg/swagger-ui-dist/favicon-32x32.png' %}" sizes="32x32"/>
|
<link rel="icon" type="image/png" href="{% static 'drf-yasg/swagger-ui-dist/favicon-32x32.png' %}" sizes="32x32"/>
|
||||||
<link rel="icon" type="image/png" href="{% static 'drf-yasg/swagger-ui-dist/favicon-16x16.png' %}" sizes="16x16"/>
|
<link rel="icon" type="image/png" href="{% static 'drf-yasg/swagger-ui-dist/favicon-16x16.png' %}" sizes="16x16"/>
|
||||||
|
{% block extra_styles %}
|
||||||
|
{# -- Add any additional CSS scripts here -- #}
|
||||||
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="swagger-body">
|
<body class="swagger-body">
|
||||||
|
|
||||||
<svg class="swagger-defs" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<defs>
|
|
||||||
<symbol viewBox="0 0 20 20" id="unlocked">
|
|
||||||
<path
|
|
||||||
d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"></path>
|
|
||||||
</symbol>
|
|
||||||
|
|
||||||
<symbol viewBox="0 0 20 20" id="locked">
|
|
||||||
<path
|
|
||||||
d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"></path>
|
|
||||||
</symbol>
|
|
||||||
|
|
||||||
<symbol viewBox="0 0 20 20" id="close">
|
|
||||||
<path
|
|
||||||
d="M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"></path>
|
|
||||||
</symbol>
|
|
||||||
|
|
||||||
<symbol viewBox="0 0 20 20" id="large-arrow">
|
|
||||||
<path
|
|
||||||
d="M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"></path>
|
|
||||||
</symbol>
|
|
||||||
|
|
||||||
<symbol viewBox="0 0 20 20" id="large-arrow-down">
|
|
||||||
<path
|
|
||||||
d="M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"></path>
|
|
||||||
</symbol>
|
|
||||||
|
|
||||||
|
|
||||||
<symbol viewBox="0 0 24 24" id="jump-to">
|
|
||||||
<path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"></path>
|
|
||||||
</symbol>
|
|
||||||
|
|
||||||
<symbol viewBox="0 0 24 24" id="expand">
|
|
||||||
<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"></path>
|
|
||||||
</symbol>
|
|
||||||
|
|
||||||
</defs>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<div id="swagger-ui"></div>
|
<div id="swagger-ui"></div>
|
||||||
<div id="spec-error" class="hidden alert alert-danger"></div>
|
|
||||||
|
|
||||||
|
|
||||||
<script id="swagger-settings" type="application/json">{{ swagger_settings | safe }}</script>
|
<script id="swagger-settings" type="application/json">{{ swagger_settings | safe }}</script>
|
||||||
<script id="oauth2-config" type="application/json">{{ oauth2_config | safe }}</script>
|
<script id="oauth2-config" type="application/json">{{ oauth2_config | safe }}</script>
|
||||||
@@ -66,33 +27,43 @@
|
|||||||
<script src="{% static 'drf-yasg/swagger-ui-dist/swagger-ui-standalone-preset.js' %}"></script>
|
<script src="{% static 'drf-yasg/swagger-ui-dist/swagger-ui-standalone-preset.js' %}"></script>
|
||||||
<script src="{% static 'drf-yasg/insQ.min.js' %}"></script>
|
<script src="{% static 'drf-yasg/insQ.min.js' %}"></script>
|
||||||
<script src="{% static 'drf-yasg/swagger-ui-init.js' %}"></script>
|
<script src="{% static 'drf-yasg/swagger-ui-init.js' %}"></script>
|
||||||
|
{% block extra_scripts %}
|
||||||
|
{# -- Add any additional scripts here -- #}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
<a id="oauth2-redirect-url" href="{% static 'drf-yasg/swagger-ui-dist/oauth2-redirect.html' %}" class="hidden"></a>
|
<a id="oauth2-redirect-url" href="{% static 'drf-yasg/swagger-ui-dist/oauth2-redirect.html' %}" class="hidden"></a>
|
||||||
|
|
||||||
<div id="django-session-auth" class="hidden">
|
{% if USE_SESSION_AUTH %}
|
||||||
{% if USE_SESSION_AUTH %}
|
<div id="django-session-auth" class="hidden">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
|
{% block user_context_message %}
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<div class="hello">
|
<div class="hello">
|
||||||
<span class="django-session">Django</span> <span class="label label-primary">{{ request.user }}</span>
|
<span class="django-session">Django</span> <span class="label label-primary">{{ request.user }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<div class='btn authorize'>
|
<div class='btn authorize'>
|
||||||
<a id="auth" class="header__btn" href="{{ LOGOUT_URL }}?next={{ request.path }}" data-sw-translate>
|
<a id="auth" class="header__btn" href="{{ LOGOUT_URL }}?next={{ request.path }}" data-sw-translate>
|
||||||
|
{% block django_logout_message %}
|
||||||
Django Logout
|
Django Logout
|
||||||
|
{% endblock %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class='btn authorize'>
|
<div class='btn authorize'>
|
||||||
<a id="auth" class="header__btn" href="{{ LOGIN_URL }}?next={{ request.path }}" data-sw-translate>
|
<a id="auth" class="header__btn" href="{{ LOGIN_URL }}?next={{ request.path }}" data-sw-translate>
|
||||||
|
{% block django_login_message %}
|
||||||
Django Login
|
Django Login
|
||||||
|
{% endblock %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
</div>
|
||||||
</div>
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
+137
-20
@@ -3,12 +3,16 @@ import logging
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.utils.encoding import force_text
|
||||||
from rest_framework import serializers, status
|
from rest_framework import serializers, status
|
||||||
from rest_framework.mixins import DestroyModelMixin, RetrieveModelMixin, UpdateModelMixin
|
from rest_framework.mixins import DestroyModelMixin, RetrieveModelMixin, UpdateModelMixin
|
||||||
from rest_framework.request import is_form_media_type
|
from rest_framework.request import is_form_media_type
|
||||||
from rest_framework.settings import api_settings as rest_framework_settings
|
from rest_framework.settings import api_settings as rest_framework_settings
|
||||||
|
from rest_framework.utils import encoders, json
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
|
||||||
|
from .app_settings import swagger_settings
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -23,9 +27,9 @@ class unset(object):
|
|||||||
|
|
||||||
|
|
||||||
def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_body=None, query_serializer=None,
|
def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_body=None, query_serializer=None,
|
||||||
manual_parameters=None, operation_id=None, operation_description=None, security=None,
|
manual_parameters=None, operation_id=None, operation_description=None, operation_summary=None,
|
||||||
responses=None, field_inspectors=None, filter_inspectors=None, paginator_inspectors=None,
|
security=None, deprecated=None, responses=None, field_inspectors=None, filter_inspectors=None,
|
||||||
**extra_overrides):
|
paginator_inspectors=None, **extra_overrides):
|
||||||
"""Decorate a view method to customize the :class:`.Operation` object generated from it.
|
"""Decorate a view method to customize the :class:`.Operation` object generated from it.
|
||||||
|
|
||||||
`method` and `methods` are mutually exclusive and must only be present when decorating a view method that accepts
|
`method` and `methods` are mutually exclusive and must only be present when decorating a view method that accepts
|
||||||
@@ -46,7 +50,7 @@ def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_bo
|
|||||||
the `manual_parameters` argument.
|
the `manual_parameters` argument.
|
||||||
|
|
||||||
If a ``Serializer`` class or instance is given, it will be automatically converted into a :class:`.Schema`
|
If a ``Serializer`` class or instance is given, it will be automatically converted into a :class:`.Schema`
|
||||||
used as a ``body`` :class:`.Parameter`, or into a list of ``form`` :class:`.Parameter`\ s, as appropriate.
|
used as a ``body`` :class:`.Parameter`, or into a list of ``form`` :class:`.Parameter`\\ s, as appropriate.
|
||||||
|
|
||||||
:param .Serializer query_serializer: if you use a ``Serializer`` to parse query parameters, you can pass it here
|
:param .Serializer query_serializer: if you use a ``Serializer`` to parse query parameters, you can pass it here
|
||||||
and have :class:`.Parameter` objects be generated automatically from it.
|
and have :class:`.Parameter` objects be generated automatically from it.
|
||||||
@@ -59,16 +63,18 @@ def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_bo
|
|||||||
|
|
||||||
:param list[.Parameter] manual_parameters: a list of manual parameters to override the automatically generated ones
|
:param list[.Parameter] manual_parameters: a list of manual parameters to override the automatically generated ones
|
||||||
|
|
||||||
:class:`.Parameter`\ s are identified by their (``name``, ``in``) combination, and any parameters given
|
:class:`.Parameter`\\ s are identified by their (``name``, ``in``) combination, and any parameters given
|
||||||
here will fully override automatically generated parameters if they collide.
|
here will fully override automatically generated parameters if they collide.
|
||||||
|
|
||||||
It is an error to supply ``form`` parameters when the request does not consume form-data.
|
It is an error to supply ``form`` parameters when the request does not consume form-data.
|
||||||
|
|
||||||
:param str operation_id: operation ID override; the operation ID must be unique accross the whole API
|
:param str operation_id: operation ID override; the operation ID must be unique accross the whole API
|
||||||
:param str operation_description: operation description override
|
:param str operation_description: operation description override
|
||||||
|
:param str operation_summary: operation summary string
|
||||||
:param list[dict] security: security requirements override; used to specify which authetication mechanism
|
:param list[dict] security: security requirements override; used to specify which authetication mechanism
|
||||||
is requried to call this API; an empty list marks the endpoint as unauthenticated (i.e. removes all accepted
|
is requried to call this API; an empty list marks the endpoint as unauthenticated (i.e. removes all accepted
|
||||||
authentication schemes), and ``None`` will inherit the top-level secuirty requirements
|
authentication schemes), and ``None`` will inherit the top-level secuirty requirements
|
||||||
|
:param bool deprecated: deprecation status for operation
|
||||||
:param dict[str,(.Schema,.SchemaRef,.Response,str,Serializer)] responses: a dict of documented manual responses
|
:param dict[str,(.Schema,.SchemaRef,.Response,str,Serializer)] responses: a dict of documented manual responses
|
||||||
keyed on response status code. If no success (``2xx``) response is given, one will automatically be
|
keyed on response status code. If no success (``2xx``) response is given, one will automatically be
|
||||||
generated from the request body and http method. If any ``2xx`` response is given the automatic response is
|
generated from the request body and http method. If any ``2xx`` response is given the automatic response is
|
||||||
@@ -76,6 +82,8 @@ def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_bo
|
|||||||
|
|
||||||
* if a plain string is given as value, a :class:`.Response` with no body and that string as its description
|
* if a plain string is given as value, a :class:`.Response` with no body and that string as its description
|
||||||
will be generated
|
will be generated
|
||||||
|
* if ``None`` is given as a value, the response is ignored; this is mainly useful for disabling default
|
||||||
|
2xx responses, i.e. ``responses={200: None, 302: 'something'}``
|
||||||
* if a :class:`.Schema`, :class:`.SchemaRef` is given, a :class:`.Response` with the schema as its body and
|
* if a :class:`.Schema`, :class:`.SchemaRef` is given, a :class:`.Response` with the schema as its body and
|
||||||
an empty description will be generated
|
an empty description will be generated
|
||||||
* a ``Serializer`` class or instance will be converted into a :class:`.Schema` and treated as above
|
* a ``Serializer`` class or instance will be converted into a :class:`.Schema` and treated as above
|
||||||
@@ -99,6 +107,8 @@ def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_bo
|
|||||||
'query_serializer': query_serializer,
|
'query_serializer': query_serializer,
|
||||||
'manual_parameters': manual_parameters,
|
'manual_parameters': manual_parameters,
|
||||||
'operation_id': operation_id,
|
'operation_id': operation_id,
|
||||||
|
'operation_summary': operation_summary,
|
||||||
|
'deprecated': deprecated,
|
||||||
'operation_description': operation_description,
|
'operation_description': operation_description,
|
||||||
'security': security,
|
'security': security,
|
||||||
'responses': responses,
|
'responses': responses,
|
||||||
@@ -112,21 +122,24 @@ def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_bo
|
|||||||
data.update(extra_overrides)
|
data.update(extra_overrides)
|
||||||
if not data: # pragma: no cover
|
if not data: # pragma: no cover
|
||||||
# no overrides to set, no use in doing more work
|
# no overrides to set, no use in doing more work
|
||||||
return
|
return view_method
|
||||||
|
|
||||||
# if the method is an @action, it will have a bind_to_methods attribute
|
# if the method is an @action, it will have a bind_to_methods attribute, or a mapping attribute for drf>3.8
|
||||||
bind_to_methods = getattr(view_method, 'bind_to_methods', [])
|
bind_to_methods = getattr(view_method, 'bind_to_methods', [])
|
||||||
|
mapping = getattr(view_method, 'mapping', {})
|
||||||
|
mapping_methods = [mth for mth, name in mapping.items() if name == view_method.__name__]
|
||||||
|
action_http_methods = bind_to_methods + mapping_methods
|
||||||
|
|
||||||
# if the method is actually a function based view (@api_view), it will have a 'cls' attribute
|
# if the method is actually a function based view (@api_view), it will have a 'cls' attribute
|
||||||
view_cls = getattr(view_method, 'cls', None)
|
view_cls = getattr(view_method, 'cls', None)
|
||||||
http_method_names = [m for m in getattr(view_cls, 'http_method_names', []) if hasattr(view_cls, m)]
|
api_view_http_methods = [m for m in getattr(view_cls, 'http_method_names', []) if hasattr(view_cls, m)]
|
||||||
|
|
||||||
available_methods = http_method_names + bind_to_methods
|
available_http_methods = api_view_http_methods + action_http_methods
|
||||||
existing_data = getattr(view_method, '_swagger_auto_schema', {})
|
existing_data = getattr(view_method, '_swagger_auto_schema', {})
|
||||||
|
|
||||||
_methods = methods
|
_methods = methods
|
||||||
if methods or method:
|
if methods or method:
|
||||||
assert available_methods or http_method_names, "`method` or `methods` can only be specified " \
|
assert available_http_methods, "`method` or `methods` can only be specified on @action or @api_view views"
|
||||||
"on @action or @api_view views"
|
|
||||||
assert bool(methods) != bool(method), "specify either method or methods"
|
assert bool(methods) != bool(method), "specify either method or methods"
|
||||||
assert not isinstance(methods, str), "`methods` expects to receive a list of methods;" \
|
assert not isinstance(methods, str), "`methods` expects to receive a list of methods;" \
|
||||||
" use `method` for a single argument"
|
" use `method` for a single argument"
|
||||||
@@ -134,20 +147,20 @@ def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_bo
|
|||||||
_methods = [method.lower()]
|
_methods = [method.lower()]
|
||||||
else:
|
else:
|
||||||
_methods = [mth.lower() for mth in methods]
|
_methods = [mth.lower() for mth in methods]
|
||||||
assert all(mth in available_methods for mth in _methods), "http method not bound to view"
|
assert all(mth in available_http_methods for mth in _methods), "http method not bound to view"
|
||||||
assert not any(mth in existing_data for mth in _methods), "http method defined multiple times"
|
assert not any(mth in existing_data for mth in _methods), "http method defined multiple times"
|
||||||
|
|
||||||
if available_methods:
|
if available_http_methods:
|
||||||
# action or api_view
|
# action or api_view
|
||||||
assert bool(http_method_names) != bool(bind_to_methods), "this should never happen"
|
assert bool(api_view_http_methods) != bool(action_http_methods), "this should never happen"
|
||||||
|
|
||||||
if len(available_methods) > 1:
|
if len(available_http_methods) > 1:
|
||||||
assert _methods, \
|
assert _methods, \
|
||||||
"on multi-method api_view, action, detail_route or list_route, you must specify " \
|
"on multi-method api_view, action, detail_route or list_route, you must specify " \
|
||||||
"swagger_auto_schema on a per-method basis using one of the `method` or `methods` arguments"
|
"swagger_auto_schema on a per-method basis using one of the `method` or `methods` arguments"
|
||||||
else:
|
else:
|
||||||
# for a single-method view we assume that single method as the decorator target
|
# for a single-method view we assume that single method as the decorator target
|
||||||
_methods = _methods or available_methods
|
_methods = _methods or available_http_methods
|
||||||
|
|
||||||
assert not any(hasattr(getattr(view_cls, mth, None), '_swagger_auto_schema') for mth in _methods), \
|
assert not any(hasattr(getattr(view_cls, mth, None), '_swagger_auto_schema') for mth in _methods), \
|
||||||
"swagger_auto_schema applied twice to method"
|
"swagger_auto_schema applied twice to method"
|
||||||
@@ -167,6 +180,23 @@ def swagger_auto_schema(method=None, methods=None, auto_schema=unset, request_bo
|
|||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
|
def swagger_serializer_method(serializer_or_field):
|
||||||
|
"""
|
||||||
|
Decorates the method of a serializers.SerializerMethodField
|
||||||
|
to hint as to how Swagger should be generated for this field.
|
||||||
|
|
||||||
|
:param serializer_or_field: ``Serializer``/``Field`` class or instance
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
|
||||||
|
def decorator(serializer_method):
|
||||||
|
# stash the serializer for SerializerMethodFieldInspector to find
|
||||||
|
serializer_method._swagger_serializer = serializer_or_field
|
||||||
|
return serializer_method
|
||||||
|
|
||||||
|
return decorator
|
||||||
|
|
||||||
|
|
||||||
def is_list_view(path, method, view):
|
def is_list_view(path, method, view):
|
||||||
"""Check if the given path/method appears to represent a list view (as opposed to a detail/instance view).
|
"""Check if the given path/method appears to represent a list view (as opposed to a detail/instance view).
|
||||||
|
|
||||||
@@ -224,6 +254,22 @@ def param_list_to_odict(parameters):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def merge_params(parameters, overrides):
|
||||||
|
"""Merge `overrides` into `parameters`. This is the same as appending `overrides` to `parameters`, but any element
|
||||||
|
of `parameters` whose ``(name, in_)`` tuple collides with an element in `overrides` is replaced by it.
|
||||||
|
|
||||||
|
Raises an ``AssertionError`` if either list contains duplicate parameters.
|
||||||
|
|
||||||
|
:param list[.Parameter] parameters: initial parameters
|
||||||
|
:param list[.Parameter] overrides: overriding parameters
|
||||||
|
:return: merged list
|
||||||
|
:rtype: list[.Parameter]
|
||||||
|
"""
|
||||||
|
parameters = param_list_to_odict(parameters)
|
||||||
|
parameters.update(param_list_to_odict(overrides))
|
||||||
|
return list(parameters.values())
|
||||||
|
|
||||||
|
|
||||||
def filter_none(obj):
|
def filter_none(obj):
|
||||||
"""Remove ``None`` values from tuples, lists or dictionaries. Return other objects as-is.
|
"""Remove ``None`` values from tuples, lists or dictionaries. Return other objects as-is.
|
||||||
|
|
||||||
@@ -248,6 +294,7 @@ def force_serializer_instance(serializer):
|
|||||||
|
|
||||||
:param serializer: serializer class or instance
|
:param serializer: serializer class or instance
|
||||||
:return: serializer instance
|
:return: serializer instance
|
||||||
|
:rtype: serializers.BaseSerializer
|
||||||
"""
|
"""
|
||||||
if inspect.isclass(serializer):
|
if inspect.isclass(serializer):
|
||||||
assert issubclass(serializer, serializers.BaseSerializer), "Serializer required, not %s" % serializer.__name__
|
assert issubclass(serializer, serializers.BaseSerializer), "Serializer required, not %s" % serializer.__name__
|
||||||
@@ -258,6 +305,26 @@ def force_serializer_instance(serializer):
|
|||||||
return serializer
|
return serializer
|
||||||
|
|
||||||
|
|
||||||
|
def get_serializer_class(serializer):
|
||||||
|
"""Given a ``Serializer`` class or intance, return the ``Serializer`` class. If `serializer` is not a ``Serializer``
|
||||||
|
class or instance, raises an assertion error.
|
||||||
|
|
||||||
|
:param serializer: serializer class or instance, or ``None``
|
||||||
|
:return: serializer class
|
||||||
|
:rtype: type[serializers.BaseSerializer]
|
||||||
|
"""
|
||||||
|
if serializer is None:
|
||||||
|
return None
|
||||||
|
|
||||||
|
if inspect.isclass(serializer):
|
||||||
|
assert issubclass(serializer, serializers.BaseSerializer), "Serializer required, not %s" % serializer.__name__
|
||||||
|
return serializer
|
||||||
|
|
||||||
|
assert isinstance(serializer, serializers.BaseSerializer), \
|
||||||
|
"Serializer class or instance required, not %s" % type(serializer).__name__
|
||||||
|
return type(serializer)
|
||||||
|
|
||||||
|
|
||||||
def get_consumes(parser_classes):
|
def get_consumes(parser_classes):
|
||||||
"""Extract ``consumes`` MIME types from a list of parser classes.
|
"""Extract ``consumes`` MIME types from a list of parser classes.
|
||||||
|
|
||||||
@@ -281,7 +348,8 @@ def get_produces(renderer_classes):
|
|||||||
:rtype: list[str]
|
:rtype: list[str]
|
||||||
"""
|
"""
|
||||||
media_types = [renderer.media_type for renderer in renderer_classes or []]
|
media_types = [renderer.media_type for renderer in renderer_classes or []]
|
||||||
media_types = [encoding for encoding in media_types if 'html' not in encoding]
|
media_types = [encoding for encoding in media_types
|
||||||
|
if not any(excluded in encoding for excluded in swagger_settings.EXCLUDED_MEDIA_TYPES)]
|
||||||
return media_types
|
return media_types
|
||||||
|
|
||||||
|
|
||||||
@@ -302,18 +370,67 @@ def get_serializer_ref_name(serializer):
|
|||||||
Get serializer's ref_name (or None for ModelSerializer if it is named 'NestedSerializer')
|
Get serializer's ref_name (or None for ModelSerializer if it is named 'NestedSerializer')
|
||||||
|
|
||||||
:param serializer: Serializer instance
|
:param serializer: Serializer instance
|
||||||
:return: Serializer's ref_name or None for inline serializer
|
:return: Serializer's ``ref_name`` or ``None`` for inline serializer
|
||||||
:rtype: str or None
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
serializer_meta = getattr(serializer, 'Meta', None)
|
serializer_meta = getattr(serializer, 'Meta', None)
|
||||||
serializer_name = type(serializer).__name__
|
serializer_name = type(serializer).__name__
|
||||||
if hasattr(serializer_meta, 'ref_name'):
|
if hasattr(serializer_meta, 'ref_name'):
|
||||||
ref_name = serializer_meta.ref_name
|
ref_name = serializer_meta.ref_name
|
||||||
elif serializer_name == 'NestedSerializer' and isinstance(serializer, serializers.ModelSerializer):
|
elif serializer_name == 'NestedSerializer' and isinstance(serializer, serializers.ModelSerializer):
|
||||||
logger.debug("Forcing inline output for ModelSerializer named 'NestedSerializer': " + str(serializer))
|
logger.debug("Forcing inline output for ModelSerializer named 'NestedSerializer':\n" + str(serializer))
|
||||||
ref_name = None
|
ref_name = None
|
||||||
else:
|
else:
|
||||||
ref_name = serializer_name
|
ref_name = serializer_name
|
||||||
if ref_name.endswith('Serializer'):
|
if ref_name.endswith('Serializer'):
|
||||||
ref_name = ref_name[:-len('Serializer')]
|
ref_name = ref_name[:-len('Serializer')]
|
||||||
return ref_name
|
return ref_name
|
||||||
|
|
||||||
|
|
||||||
|
def force_real_str(s, encoding='utf-8', strings_only=False, errors='strict'):
|
||||||
|
"""
|
||||||
|
Force `s` into a ``str`` instance.
|
||||||
|
|
||||||
|
Fix for https://github.com/axnsan12/drf-yasg/issues/159
|
||||||
|
"""
|
||||||
|
if s is not None:
|
||||||
|
s = force_text(s, encoding, strings_only, errors)
|
||||||
|
if type(s) != str:
|
||||||
|
s = '' + s
|
||||||
|
|
||||||
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
def get_field_default(field):
|
||||||
|
"""
|
||||||
|
Get the default value for a field, converted to a JSON-compatible value while properly handling callables.
|
||||||
|
|
||||||
|
:param field: field instance
|
||||||
|
:return: default value
|
||||||
|
"""
|
||||||
|
default = getattr(field, 'default', serializers.empty)
|
||||||
|
if default is not serializers.empty:
|
||||||
|
if callable(default):
|
||||||
|
try:
|
||||||
|
if hasattr(default, 'set_context'):
|
||||||
|
default.set_context(field)
|
||||||
|
default = default()
|
||||||
|
except Exception: # pragma: no cover
|
||||||
|
logger.warning("default for %s is callable but it raised an exception when "
|
||||||
|
"called; 'default' will not be set on schema", field, exc_info=True)
|
||||||
|
default = serializers.empty
|
||||||
|
|
||||||
|
if default is not serializers.empty and default is not None:
|
||||||
|
try:
|
||||||
|
default = field.to_representation(default)
|
||||||
|
# JSON roundtrip ensures that the value is valid JSON;
|
||||||
|
# for example, sets and tuples get transformed into lists
|
||||||
|
default = json.loads(json.dumps(default, cls=encoders.JSONEncoder))
|
||||||
|
if decimal_as_float(field):
|
||||||
|
default = float(default)
|
||||||
|
except Exception: # pragma: no cover
|
||||||
|
logger.warning("'default' on schema for %s will not be set because "
|
||||||
|
"to_representation raised an exception", field, exc_info=True)
|
||||||
|
default = serializers.empty
|
||||||
|
|
||||||
|
return default
|
||||||
+10
-6
@@ -11,13 +11,15 @@ from rest_framework.settings import api_settings
|
|||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
|
||||||
from .app_settings import swagger_settings
|
from .app_settings import swagger_settings
|
||||||
from .generators import OpenAPISchemaGenerator
|
from .renderers import (
|
||||||
from .renderers import OpenAPIRenderer, ReDocRenderer, SwaggerJSONRenderer, SwaggerUIRenderer, SwaggerYAMLRenderer
|
OpenAPIRenderer, ReDocOldRenderer, ReDocRenderer, SwaggerJSONRenderer, SwaggerUIRenderer, SwaggerYAMLRenderer
|
||||||
|
)
|
||||||
|
|
||||||
SPEC_RENDERERS = (SwaggerYAMLRenderer, SwaggerJSONRenderer, OpenAPIRenderer)
|
SPEC_RENDERERS = (SwaggerYAMLRenderer, SwaggerJSONRenderer, OpenAPIRenderer)
|
||||||
UI_RENDERERS = {
|
UI_RENDERERS = {
|
||||||
'swagger': (SwaggerUIRenderer, ReDocRenderer),
|
'swagger': (SwaggerUIRenderer, ReDocRenderer),
|
||||||
'redoc': (ReDocRenderer, SwaggerUIRenderer),
|
'redoc': (ReDocRenderer, SwaggerUIRenderer),
|
||||||
|
'redoc-old': (ReDocOldRenderer, ReDocRenderer, SwaggerUIRenderer),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -46,9 +48,7 @@ def deferred_never_cache(view_func):
|
|||||||
|
|
||||||
|
|
||||||
def get_schema_view(info=None, url=None, patterns=None, urlconf=None, public=False, validators=None,
|
def get_schema_view(info=None, url=None, patterns=None, urlconf=None, public=False, validators=None,
|
||||||
generator_class=OpenAPISchemaGenerator,
|
generator_class=None, authentication_classes=None, permission_classes=None):
|
||||||
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
|
|
||||||
permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES):
|
|
||||||
"""Create a SchemaView class with default renderers and generators.
|
"""Create a SchemaView class with default renderers and generators.
|
||||||
|
|
||||||
:param .Info info: information about the API; if omitted, defaults to :ref:`DEFAULT_INFO <default-swagger-settings>`
|
:param .Info info: information about the API; if omitted, defaults to :ref:`DEFAULT_INFO <default-swagger-settings>`
|
||||||
@@ -64,9 +64,13 @@ def get_schema_view(info=None, url=None, patterns=None, urlconf=None, public=Fal
|
|||||||
:rtype: type[.SchemaView]
|
:rtype: type[.SchemaView]
|
||||||
"""
|
"""
|
||||||
_public = public
|
_public = public
|
||||||
_generator_class = generator_class
|
_generator_class = generator_class or swagger_settings.DEFAULT_GENERATOR_CLASS
|
||||||
_auth_classes = authentication_classes
|
_auth_classes = authentication_classes
|
||||||
|
if _auth_classes is None:
|
||||||
|
_auth_classes = api_settings.DEFAULT_AUTHENTICATION_CLASSES
|
||||||
_perm_classes = permission_classes
|
_perm_classes = permission_classes
|
||||||
|
if _perm_classes is None:
|
||||||
|
_perm_classes = api_settings.DEFAULT_PERMISSION_CLASSES
|
||||||
info = info or swagger_settings.DEFAULT_INFO
|
info = info or swagger_settings.DEFAULT_INFO
|
||||||
validators = validators or []
|
validators = validators or []
|
||||||
_spec_renderers = tuple(renderer.with_validators(validators) for renderer in SPEC_RENDERERS)
|
_spec_renderers = tuple(renderer.with_validators(validators) for renderer in SPEC_RENDERERS)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class ArticleSerializer(serializers.ModelSerializer):
|
|||||||
read_only=True,
|
read_only=True,
|
||||||
)
|
)
|
||||||
uuid = serializers.UUIDField(help_text="should articles have UUIDs?", read_only=True)
|
uuid = serializers.UUIDField(help_text="should articles have UUIDs?", read_only=True)
|
||||||
cover_name = serializers.FileField(use_url=False, source='cover', read_only=True)
|
cover_name = serializers.FileField(use_url=False, source='cover', required=True)
|
||||||
group = serializers.SlugRelatedField(slug_field='uuid', queryset=ArticleGroup.objects.all())
|
group = serializers.SlugRelatedField(slug_field='uuid', queryset=ArticleGroup.objects.all())
|
||||||
original_group = serializers.SlugRelatedField(slug_field='uuid', read_only=True)
|
original_group = serializers.SlugRelatedField(slug_field='uuid', read_only=True)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from articles.models import Article
|
|||||||
from drf_yasg import openapi
|
from drf_yasg import openapi
|
||||||
from drf_yasg.app_settings import swagger_settings
|
from drf_yasg.app_settings import swagger_settings
|
||||||
from drf_yasg.inspectors import CoreAPICompatInspector, FieldInspector, NotHandled, SwaggerAutoSchema
|
from drf_yasg.inspectors import CoreAPICompatInspector, FieldInspector, NotHandled, SwaggerAutoSchema
|
||||||
from drf_yasg.utils import swagger_auto_schema
|
from drf_yasg.utils import no_body, swagger_auto_schema
|
||||||
|
|
||||||
|
|
||||||
class DjangoFilterDescriptionInspector(CoreAPICompatInspector):
|
class DjangoFilterDescriptionInspector(CoreAPICompatInspector):
|
||||||
@@ -133,11 +133,13 @@ class ArticleViewSet(viewsets.ModelViewSet):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@swagger_auto_schema(request_body=no_body, operation_id='no_body_test')
|
||||||
def update(self, request, *args, **kwargs):
|
def update(self, request, *args, **kwargs):
|
||||||
"""update method docstring"""
|
"""update method docstring"""
|
||||||
return super(ArticleViewSet, self).update(request, *args, **kwargs)
|
return super(ArticleViewSet, self).update(request, *args, **kwargs)
|
||||||
|
|
||||||
@swagger_auto_schema(operation_description="partial_update description override", responses={404: 'slug not found'})
|
@swagger_auto_schema(operation_description="partial_update description override", responses={404: 'slug not found'},
|
||||||
|
operation_summary='partial_update summary', deprecated=True)
|
||||||
def partial_update(self, request, *args, **kwargs):
|
def partial_update(self, request, *args, **kwargs):
|
||||||
"""partial_update method docstring"""
|
"""partial_update method docstring"""
|
||||||
return super(ArticleViewSet, self).partial_update(request, *args, **kwargs)
|
return super(ArticleViewSet, self).partial_update(request, *args, **kwargs)
|
||||||
|
|||||||
Regular → Executable
File mode changed.
@@ -0,0 +1,28 @@
|
|||||||
|
# Generated by Django 2.1 on 2018-08-06 13:34
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('people', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='identity',
|
||||||
|
name='lastName',
|
||||||
|
field=models.CharField(help_text="<strong>Here's some HTML!</strong>", max_length=30, null=True),
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='identity',
|
||||||
|
old_name='firstName',
|
||||||
|
new_name='first_name',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='identity',
|
||||||
|
old_name='lastName',
|
||||||
|
new_name='last_name',
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
|
|
||||||
|
|
||||||
class Identity(models.Model):
|
class Identity(models.Model):
|
||||||
firstName = models.CharField(max_length=30, null=True)
|
first_name = models.CharField(max_length=30, null=True)
|
||||||
lastName = models.CharField(max_length=30, null=True)
|
last_name = models.CharField(max_length=30, null=True, help_text=mark_safe("<strong>Here's some HTML!</strong>"))
|
||||||
|
|
||||||
|
|
||||||
class Person(models.Model):
|
class Person(models.Model):
|
||||||
|
|||||||
@@ -23,12 +23,34 @@ class ExampleProjectSerializer(serializers.Serializer):
|
|||||||
ref_name = 'Project'
|
ref_name = 'Project'
|
||||||
|
|
||||||
|
|
||||||
|
class UnixTimestampField(serializers.DateTimeField):
|
||||||
|
def to_representation(self, value):
|
||||||
|
""" Return epoch time for a datetime object or ``None``"""
|
||||||
|
from django.utils.dateformat import format
|
||||||
|
try:
|
||||||
|
return int(format(value, 'U'))
|
||||||
|
except (AttributeError, TypeError):
|
||||||
|
return None
|
||||||
|
|
||||||
|
def to_internal_value(self, value):
|
||||||
|
import datetime
|
||||||
|
return datetime.datetime.fromtimestamp(int(value))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
swagger_schema_fields = {
|
||||||
|
'format': 'integer',
|
||||||
|
'title': 'Client date time suu',
|
||||||
|
'description': 'Date time in unix timestamp format',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class SnippetSerializer(serializers.Serializer):
|
class SnippetSerializer(serializers.Serializer):
|
||||||
"""SnippetSerializer classdoc
|
"""SnippetSerializer classdoc
|
||||||
|
|
||||||
create: docstring for create from serializer classdoc
|
create: docstring for create from serializer classdoc
|
||||||
"""
|
"""
|
||||||
id = serializers.IntegerField(read_only=True, help_text="id serializer help text")
|
id = serializers.IntegerField(read_only=True, help_text="id serializer help text")
|
||||||
|
created = UnixTimestampField(read_only=True)
|
||||||
owner = serializers.PrimaryKeyRelatedField(
|
owner = serializers.PrimaryKeyRelatedField(
|
||||||
queryset=get_user_model().objects.all(),
|
queryset=get_user_model().objects.all(),
|
||||||
default=serializers.CurrentUserDefault(),
|
default=serializers.CurrentUserDefault(),
|
||||||
|
|||||||
@@ -33,6 +33,25 @@ class SnippetList(generics.ListCreateAPIView):
|
|||||||
"""post method docstring"""
|
"""post method docstring"""
|
||||||
return super(SnippetList, self).post(request, *args, **kwargs)
|
return super(SnippetList, self).post(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@swagger_auto_schema(
|
||||||
|
operation_id='snippets_delete_bulk',
|
||||||
|
request_body=openapi.Schema(
|
||||||
|
type=openapi.TYPE_OBJECT,
|
||||||
|
properties={
|
||||||
|
'body': openapi.Schema(
|
||||||
|
type=openapi.TYPE_STRING,
|
||||||
|
description='this should not crash (request body on DELETE method)'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
),
|
||||||
|
)
|
||||||
|
def delete(self, *args, **kwargs):
|
||||||
|
"""summary from docstring
|
||||||
|
|
||||||
|
description body is here, summary is not included
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class SnippetDetail(generics.RetrieveUpdateDestroyAPIView):
|
class SnippetDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||||
"""
|
"""
|
||||||
@@ -56,18 +75,26 @@ class SnippetDetail(generics.RetrieveUpdateDestroyAPIView):
|
|||||||
"""patch method docstring"""
|
"""patch method docstring"""
|
||||||
return super(SnippetDetail, self).patch(request, *args, **kwargs)
|
return super(SnippetDetail, self).patch(request, *args, **kwargs)
|
||||||
|
|
||||||
@swagger_auto_schema(manual_parameters=[
|
@swagger_auto_schema(
|
||||||
|
manual_parameters=[
|
||||||
openapi.Parameter(
|
openapi.Parameter(
|
||||||
name='id', in_=openapi.IN_PATH,
|
name='id', in_=openapi.IN_PATH,
|
||||||
type=openapi.TYPE_INTEGER,
|
type=openapi.TYPE_INTEGER,
|
||||||
description="path parameter override",
|
description="path parameter override",
|
||||||
required=True
|
required=True
|
||||||
),
|
),
|
||||||
], responses={
|
openapi.Parameter(
|
||||||
|
name='delete_form_param', in_=openapi.IN_FORM,
|
||||||
|
type=openapi.TYPE_INTEGER,
|
||||||
|
description="this should not crash (form parameter on DELETE method)"
|
||||||
|
),
|
||||||
|
],
|
||||||
|
responses={
|
||||||
status.HTTP_204_NO_CONTENT: openapi.Response(
|
status.HTTP_204_NO_CONTENT: openapi.Response(
|
||||||
description="This should not crash"
|
description="this should not crash (response object with no schema)"
|
||||||
|
)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
})
|
|
||||||
def delete(self, request, *args, **kwargs):
|
def delete(self, request, *args, **kwargs):
|
||||||
"""delete method docstring"""
|
"""delete method docstring"""
|
||||||
return super(SnippetDetail, self).patch(request, *args, **kwargs)
|
return super(SnippetDetail, self).patch(request, *args, **kwargs)
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
|
from django.urls import reverse_lazy
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
ALLOWED_HOSTS = [
|
ALLOWED_HOSTS = [
|
||||||
@@ -91,7 +93,7 @@ REST_FRAMEWORK = {
|
|||||||
# drf-yasg
|
# drf-yasg
|
||||||
|
|
||||||
SWAGGER_SETTINGS = {
|
SWAGGER_SETTINGS = {
|
||||||
'LOGIN_URL': '/admin/login',
|
'LOGIN_URL': reverse_lazy('admin:login'),
|
||||||
'LOGOUT_URL': '/admin/logout',
|
'LOGOUT_URL': '/admin/logout',
|
||||||
|
|
||||||
'DEFAULT_INFO': 'testproj.urls.swagger_info',
|
'DEFAULT_INFO': 'testproj.urls.swagger_info',
|
||||||
@@ -108,6 +110,10 @@ SWAGGER_SETTINGS = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
REDOC_SETTINGS = {
|
||||||
|
'SPEC_URL': ('schema-json', {'format': '.json'}),
|
||||||
|
}
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/1.11/topics/i18n/
|
# https://docs.djangoproject.com/en/1.11/topics/i18n/
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ urlpatterns = [
|
|||||||
url(r'^swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=0), name='schema-json'),
|
url(r'^swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=0), name='schema-json'),
|
||||||
url(r'^swagger/$', SchemaView.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
url(r'^swagger/$', SchemaView.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
||||||
url(r'^redoc/$', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
url(r'^redoc/$', SchemaView.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
||||||
|
url(r'^redoc-old/$', SchemaView.with_ui('redoc-old', cache_timeout=0), name='schema-redoc-old'),
|
||||||
|
|
||||||
url(r'^cached/swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=None), name='cschema-json'),
|
url(r'^cached/swagger(?P<format>.json|.yaml)$', SchemaView.without_ui(cache_timeout=None), name='cschema-json'),
|
||||||
url(r'^cached/swagger/$', SchemaView.with_ui('swagger', cache_timeout=None), name='cschema-swagger-ui'),
|
url(r'^cached/swagger/$', SchemaView.with_ui('swagger', cache_timeout=None), name='cschema-swagger-ui'),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework_recursive.fields import RecursiveField
|
from rest_framework_recursive.fields import RecursiveField
|
||||||
@@ -26,6 +28,15 @@ class TodoYetAnotherSerializer(serializers.ModelSerializer):
|
|||||||
model = TodoYetAnother
|
model = TodoYetAnother
|
||||||
fields = ('title', 'todo')
|
fields = ('title', 'todo')
|
||||||
depth = 2
|
depth = 2
|
||||||
|
swagger_schema_fields = {
|
||||||
|
'example': OrderedDict([
|
||||||
|
('title', 'parent'),
|
||||||
|
('todo', OrderedDict([
|
||||||
|
('title', 'child'),
|
||||||
|
('todo', None),
|
||||||
|
])),
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class TodoTreeSerializer(serializers.ModelSerializer):
|
class TodoTreeSerializer(serializers.ModelSerializer):
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ router.register(r'recursive', views.TodoRecursiveView)
|
|||||||
urlpatterns = router.urls
|
urlpatterns = router.urls
|
||||||
|
|
||||||
urlpatterns += [
|
urlpatterns += [
|
||||||
url(r'^(?P<todo_id>\d+)/yetanother/(?P<yetanother_id>\d+)/$',
|
url(r'^(?P<todo_id>\d+)/yetanothers/(?P<yetanother_id>\d+)/$',
|
||||||
views.NestedTodoView.as_view(), ),
|
views.NestedTodoView.as_view(), ),
|
||||||
]
|
]
|
||||||
+40
-2
@@ -1,6 +1,8 @@
|
|||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
from rest_framework.generics import RetrieveAPIView
|
from rest_framework.generics import RetrieveAPIView
|
||||||
|
|
||||||
|
from drf_yasg.utils import swagger_auto_schema
|
||||||
|
|
||||||
from .models import Todo, TodoAnother, TodoTree, TodoYetAnother
|
from .models import Todo, TodoAnother, TodoTree, TodoYetAnother
|
||||||
from .serializer import (
|
from .serializer import (
|
||||||
TodoAnotherSerializer, TodoRecursiveSerializer, TodoSerializer, TodoTreeSerializer, TodoYetAnotherSerializer
|
TodoAnotherSerializer, TodoRecursiveSerializer, TodoSerializer, TodoTreeSerializer, TodoYetAnotherSerializer
|
||||||
@@ -31,9 +33,45 @@ class NestedTodoView(RetrieveAPIView):
|
|||||||
|
|
||||||
class TodoTreeView(viewsets.ReadOnlyModelViewSet):
|
class TodoTreeView(viewsets.ReadOnlyModelViewSet):
|
||||||
queryset = TodoTree.objects.all()
|
queryset = TodoTree.objects.all()
|
||||||
serializer_class = TodoTreeSerializer
|
|
||||||
|
def get_serializer_class(self):
|
||||||
|
if getattr(self, 'swagger_fake_view', False):
|
||||||
|
return TodoTreeSerializer
|
||||||
|
|
||||||
|
raise NotImplementedError("must not call this")
|
||||||
|
|
||||||
|
|
||||||
class TodoRecursiveView(viewsets.ModelViewSet):
|
class TodoRecursiveView(viewsets.ModelViewSet):
|
||||||
queryset = TodoTree.objects.all()
|
queryset = TodoTree.objects.all()
|
||||||
serializer_class = TodoRecursiveSerializer
|
|
||||||
|
def get_serializer(self, *args, **kwargs):
|
||||||
|
raise NotImplementedError("must not call this")
|
||||||
|
|
||||||
|
def get_serializer_class(self):
|
||||||
|
raise NotImplementedError("must not call this")
|
||||||
|
|
||||||
|
def get_serializer_context(self):
|
||||||
|
raise NotImplementedError("must not call this")
|
||||||
|
|
||||||
|
@swagger_auto_schema(request_body=TodoRecursiveSerializer)
|
||||||
|
def create(self, request, *args, **kwargs):
|
||||||
|
return super(TodoRecursiveView, self).create(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@swagger_auto_schema(responses={200: None, 302: 'Redirect somewhere'})
|
||||||
|
def retrieve(self, request, *args, **kwargs):
|
||||||
|
return super(TodoRecursiveView, self).retrieve(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@swagger_auto_schema(request_body=TodoRecursiveSerializer)
|
||||||
|
def update(self, request, *args, **kwargs):
|
||||||
|
return super(TodoRecursiveView, self).update(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@swagger_auto_schema(request_body=TodoRecursiveSerializer)
|
||||||
|
def partial_update(self, request, *args, **kwargs):
|
||||||
|
return super(TodoRecursiveView, self).update(request, *args, **kwargs)
|
||||||
|
|
||||||
|
def destroy(self, request, *args, **kwargs):
|
||||||
|
return super(TodoRecursiveView, self).destroy(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@swagger_auto_schema(responses={200: TodoRecursiveSerializer(many=True)})
|
||||||
|
def list(self, request, *args, **kwargs):
|
||||||
|
return super(TodoRecursiveView, self).list(request, *args, **kwargs)
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
import datetime
|
||||||
|
import decimal
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
from rest_framework import serializers
|
||||||
|
|
||||||
|
|
||||||
|
class Unknown(object):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class MethodFieldExampleSerializer(serializers.Serializer):
|
||||||
|
"""
|
||||||
|
Implementation of SerializerMethodField using type hinting for Python >= 3.5
|
||||||
|
"""
|
||||||
|
|
||||||
|
hinted_bool = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a bool")
|
||||||
|
|
||||||
|
def get_hinted_bool(self, obj) -> bool:
|
||||||
|
return True
|
||||||
|
|
||||||
|
hinted_int = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be an integer")
|
||||||
|
|
||||||
|
def get_hinted_int(self, obj) -> int:
|
||||||
|
return 1
|
||||||
|
|
||||||
|
hinted_float = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a number")
|
||||||
|
|
||||||
|
def get_hinted_float(self, obj) -> float:
|
||||||
|
return 1.0
|
||||||
|
|
||||||
|
hinted_decimal = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a decimal")
|
||||||
|
|
||||||
|
def get_hinted_decimal(self, obj) -> decimal.Decimal:
|
||||||
|
return decimal.Decimal(1)
|
||||||
|
|
||||||
|
hinted_datetime = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a datetime")
|
||||||
|
|
||||||
|
def get_hinted_datetime(self, obj) -> datetime.datetime:
|
||||||
|
return datetime.datetime.now()
|
||||||
|
|
||||||
|
hinted_date = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a date")
|
||||||
|
|
||||||
|
def get_hinted_date(self, obj) -> datetime.date:
|
||||||
|
return datetime.date.today()
|
||||||
|
|
||||||
|
hinted_uuid = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a uuid")
|
||||||
|
|
||||||
|
def get_hinted_uuid(self, obj) -> uuid.UUID:
|
||||||
|
return uuid.uuid4()
|
||||||
|
|
||||||
|
hinted_unknown = serializers.SerializerMethodField(
|
||||||
|
help_text="type hint is unknown, so is expected to fallback to string")
|
||||||
|
|
||||||
|
def get_hinted_unknown(self, obj) -> Unknown:
|
||||||
|
return Unknown()
|
||||||
|
|
||||||
|
non_hinted_number = serializers.SerializerMethodField(
|
||||||
|
help_text="No hint on the method, so this is expected to fallback to string")
|
||||||
|
|
||||||
|
def get_non_hinted_number(self, obj):
|
||||||
|
return 1.0
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import datetime
|
||||||
|
import decimal
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
from rest_framework import serializers
|
||||||
|
|
||||||
|
from drf_yasg.utils import swagger_serializer_method
|
||||||
|
|
||||||
|
|
||||||
|
class Unknown(object):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class MethodFieldExampleSerializer(serializers.Serializer):
|
||||||
|
"""
|
||||||
|
Fallback implementation of SerializerMethodField type hinting for Python < 3.5
|
||||||
|
|
||||||
|
`->` syntax isn't supported, instead decorate with a serializer that returns the same type
|
||||||
|
a bit of a hack, but it provides a cross-check between hinting and decorator functionality.
|
||||||
|
"""
|
||||||
|
|
||||||
|
hinted_bool = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a bool")
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.BooleanField)
|
||||||
|
def get_hinted_bool(self, obj):
|
||||||
|
return True
|
||||||
|
|
||||||
|
hinted_int = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be an integer")
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.IntegerField)
|
||||||
|
def get_hinted_int(self, obj):
|
||||||
|
return 1
|
||||||
|
|
||||||
|
hinted_float = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a number")
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.FloatField)
|
||||||
|
def get_hinted_float(self, obj):
|
||||||
|
return 1.0
|
||||||
|
|
||||||
|
hinted_decimal = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a decimal")
|
||||||
|
|
||||||
|
# note that in this case an instance is required since DecimalField has required arguments
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.DecimalField(max_digits=6, decimal_places=4))
|
||||||
|
def get_hinted_decimal(self, obj):
|
||||||
|
return decimal.Decimal(1)
|
||||||
|
|
||||||
|
hinted_datetime = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a datetime")
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.DateTimeField)
|
||||||
|
def get_hinted_datetime(self, obj):
|
||||||
|
return datetime.datetime.now()
|
||||||
|
|
||||||
|
hinted_date = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a date")
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.DateField)
|
||||||
|
def get_hinted_date(self, obj):
|
||||||
|
return datetime.date.today()
|
||||||
|
|
||||||
|
hinted_uuid = serializers.SerializerMethodField(
|
||||||
|
help_text="the type hint on the method should determine this to be a uuid")
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.UUIDField)
|
||||||
|
def get_hinted_uuid(self, obj):
|
||||||
|
return uuid.uuid4()
|
||||||
|
|
||||||
|
hinted_unknown = serializers.SerializerMethodField(
|
||||||
|
help_text="type hint is unknown, so is expected to fallback to string")
|
||||||
|
|
||||||
|
def get_hinted_unknown(self, obj):
|
||||||
|
return Unknown()
|
||||||
|
|
||||||
|
non_hinted_number = serializers.SerializerMethodField(
|
||||||
|
help_text="No hint on the method, so this is expected to fallback to string")
|
||||||
|
|
||||||
|
def get_non_hinted_number(self, obj):
|
||||||
|
return 1.0
|
||||||
@@ -1,8 +1,19 @@
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
|
from drf_yasg.utils import swagger_serializer_method
|
||||||
from snippets.models import Snippet
|
from snippets.models import Snippet
|
||||||
|
|
||||||
|
try:
|
||||||
|
import typing # noqa: F401
|
||||||
|
from .method_serializers_with_typing import MethodFieldExampleSerializer
|
||||||
|
except ImportError:
|
||||||
|
from .method_serializers_without_typing import MethodFieldExampleSerializer
|
||||||
|
|
||||||
|
|
||||||
|
class OtherStuffSerializer(serializers.Serializer):
|
||||||
|
foo = serializers.CharField()
|
||||||
|
|
||||||
|
|
||||||
class UserSerializerrr(serializers.ModelSerializer):
|
class UserSerializerrr(serializers.ModelSerializer):
|
||||||
snippets = serializers.PrimaryKeyRelatedField(many=True, queryset=Snippet.objects.all())
|
snippets = serializers.PrimaryKeyRelatedField(many=True, queryset=Snippet.objects.all())
|
||||||
@@ -10,10 +21,61 @@ class UserSerializerrr(serializers.ModelSerializer):
|
|||||||
last_connected_ip = serializers.IPAddressField(help_text="i'm out of ideas", protocol='ipv4', read_only=True)
|
last_connected_ip = serializers.IPAddressField(help_text="i'm out of ideas", protocol='ipv4', read_only=True)
|
||||||
last_connected_at = serializers.DateField(help_text="really?", read_only=True)
|
last_connected_at = serializers.DateField(help_text="really?", read_only=True)
|
||||||
|
|
||||||
|
other_stuff = serializers.SerializerMethodField(
|
||||||
|
help_text="the decorator should determine the serializer class for this")
|
||||||
|
|
||||||
|
hint_example = MethodFieldExampleSerializer()
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=OtherStuffSerializer)
|
||||||
|
def get_other_stuff(self, obj):
|
||||||
|
"""
|
||||||
|
method_field that uses a serializer internally.
|
||||||
|
|
||||||
|
By using the decorator, we can tell drf-yasg how to represent this in Swagger
|
||||||
|
:param obj:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
return OtherStuffSerializer().data
|
||||||
|
|
||||||
|
help_text_example_1 = serializers.SerializerMethodField(
|
||||||
|
help_text="help text on field is set, so this should appear in swagger"
|
||||||
|
)
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.IntegerField(
|
||||||
|
help_text="decorated instance help_text shouldn't appear in swagger because field has priority"))
|
||||||
|
def get_help_text_example_1(self):
|
||||||
|
"""
|
||||||
|
method docstring shouldn't appear in swagger because field has priority
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
return 1
|
||||||
|
|
||||||
|
help_text_example_2 = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.IntegerField(
|
||||||
|
help_text="instance help_text is set, so should appear in swagger"))
|
||||||
|
def get_help_text_example_2(self):
|
||||||
|
"""
|
||||||
|
method docstring shouldn't appear in swagger because decorator has priority
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
return 1
|
||||||
|
|
||||||
|
help_text_example_3 = serializers.SerializerMethodField()
|
||||||
|
|
||||||
|
@swagger_serializer_method(serializer_or_field=serializers.IntegerField())
|
||||||
|
def get_help_text_example_3(self):
|
||||||
|
"""
|
||||||
|
docstring is set so should appear in swagger as fallback
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
return 1
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
fields = ('id', 'username', 'email', 'articles', 'snippets',
|
fields = ('id', 'username', 'email', 'articles', 'snippets',
|
||||||
'last_connected_ip', 'last_connected_at', 'article_slugs')
|
'last_connected_ip', 'last_connected_at', 'article_slugs', 'other_stuff', 'hint_example',
|
||||||
|
'help_text_example_1', 'help_text_example_2', 'help_text_example_3')
|
||||||
|
|
||||||
|
|
||||||
class UserListQuerySerializer(serializers.Serializer):
|
class UserListQuerySerializer(serializers.Serializer):
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from rest_framework.response import Response
|
|||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
|
||||||
from drf_yasg import openapi
|
from drf_yasg import openapi
|
||||||
from drf_yasg.utils import no_body, swagger_auto_schema
|
from drf_yasg.utils import swagger_auto_schema
|
||||||
from users.serializers import UserListQuerySerializer, UserSerializerrr
|
from users.serializers import UserListQuerySerializer, UserSerializerrr
|
||||||
|
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ class UserList(APIView):
|
|||||||
serializer.save()
|
serializer.save()
|
||||||
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||||
|
|
||||||
@swagger_auto_schema(request_body=no_body, operation_id="users_dummy", operation_description="dummy operation")
|
@swagger_auto_schema(operation_id="users_dummy", operation_description="dummy operation")
|
||||||
def patch(self, request):
|
def patch(self, request):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
from six import StringIO
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
@@ -6,6 +8,7 @@ from collections import OrderedDict
|
|||||||
import pytest
|
import pytest
|
||||||
from datadiff.tools import assert_equal
|
from datadiff.tools import assert_equal
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from django.core.management import call_command
|
||||||
from rest_framework.test import APIRequestFactory
|
from rest_framework.test import APIRequestFactory
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
|
||||||
@@ -64,6 +67,21 @@ def validate_schema(db):
|
|||||||
return validate_schema
|
return validate_schema
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def call_generate_swagger():
|
||||||
|
def call_generate_swagger(output_file='-', overwrite=False, format='', api_url='',
|
||||||
|
mock=False, user=None, private=False, generator_class_name='', **kwargs):
|
||||||
|
out = StringIO()
|
||||||
|
call_command(
|
||||||
|
'generate_swagger', stdout=out,
|
||||||
|
output_file=output_file, overwrite=overwrite, format=format, api_url=api_url, mock=mock, user=user,
|
||||||
|
private=private, generator_class_name=generator_class_name, **kwargs
|
||||||
|
)
|
||||||
|
return out.getvalue()
|
||||||
|
|
||||||
|
return call_generate_swagger
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def compare_schemas():
|
def compare_schemas():
|
||||||
def compare_schemas(schema1, schema2):
|
def compare_schemas(schema1, schema2):
|
||||||
|
|||||||
+163
-18
@@ -134,14 +134,9 @@ paths:
|
|||||||
tags:
|
tags:
|
||||||
- articles
|
- articles
|
||||||
put:
|
put:
|
||||||
operationId: articles_update
|
operationId: no_body_test
|
||||||
description: update method docstring
|
description: update method docstring
|
||||||
parameters:
|
parameters: []
|
||||||
- name: data
|
|
||||||
in: body
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/Article'
|
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: ''
|
description: ''
|
||||||
@@ -151,6 +146,7 @@ paths:
|
|||||||
- articles
|
- articles
|
||||||
patch:
|
patch:
|
||||||
operationId: articles_partial_update
|
operationId: articles_partial_update
|
||||||
|
summary: partial_update summary
|
||||||
description: partial_update description override
|
description: partial_update description override
|
||||||
parameters:
|
parameters:
|
||||||
- name: data
|
- name: data
|
||||||
@@ -167,6 +163,7 @@ paths:
|
|||||||
description: slug not found
|
description: slug not found
|
||||||
tags:
|
tags:
|
||||||
- articles
|
- articles
|
||||||
|
deprecated: true
|
||||||
delete:
|
delete:
|
||||||
operationId: articles_delete
|
operationId: articles_delete
|
||||||
description: destroy method docstring
|
description: destroy method docstring
|
||||||
@@ -192,6 +189,8 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: ''
|
description: ''
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/Article'
|
||||||
consumes:
|
consumes:
|
||||||
- multipart/form-data
|
- multipart/form-data
|
||||||
tags:
|
tags:
|
||||||
@@ -228,6 +227,8 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
'201':
|
'201':
|
||||||
description: ''
|
description: ''
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/ImageUpload'
|
||||||
consumes:
|
consumes:
|
||||||
- multipart/form-data
|
- multipart/form-data
|
||||||
tags:
|
tags:
|
||||||
@@ -388,6 +389,25 @@ paths:
|
|||||||
$ref: '#/definitions/Snippet'
|
$ref: '#/definitions/Snippet'
|
||||||
tags:
|
tags:
|
||||||
- snippets
|
- snippets
|
||||||
|
delete:
|
||||||
|
operationId: snippetsDeleteBulk
|
||||||
|
summary: summary from docstring
|
||||||
|
description: description body is here, summary is not included
|
||||||
|
parameters:
|
||||||
|
- name: data
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
body:
|
||||||
|
description: this should not crash (request body on DELETE method)
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'204':
|
||||||
|
description: ''
|
||||||
|
tags:
|
||||||
|
- snippets
|
||||||
parameters: []
|
parameters: []
|
||||||
/snippets/{id}/:
|
/snippets/{id}/:
|
||||||
get:
|
get:
|
||||||
@@ -442,9 +462,13 @@ paths:
|
|||||||
description: path parameter override
|
description: path parameter override
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
|
- name: delete_form_param
|
||||||
|
in: formData
|
||||||
|
description: this should not crash (form parameter on DELETE method)
|
||||||
|
type: integer
|
||||||
responses:
|
responses:
|
||||||
'204':
|
'204':
|
||||||
description: This should not crash
|
description: this should not crash (response object with no schema)
|
||||||
tags:
|
tags:
|
||||||
- snippets
|
- snippets
|
||||||
parameters:
|
parameters:
|
||||||
@@ -538,10 +562,8 @@ paths:
|
|||||||
description: ''
|
description: ''
|
||||||
parameters: []
|
parameters: []
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'302':
|
||||||
description: ''
|
description: Redirect somewhere
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/TodoRecursive'
|
|
||||||
tags:
|
tags:
|
||||||
- todo
|
- todo
|
||||||
put:
|
put:
|
||||||
@@ -675,9 +697,9 @@ paths:
|
|||||||
description: A unique integer value identifying this todo.
|
description: A unique integer value identifying this todo.
|
||||||
required: true
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
/todo/{todo_id}/yetanother/{yetanother_id}/:
|
/todo/{todo_id}/yetanothers/{yetanother_id}/:
|
||||||
get:
|
get:
|
||||||
operationId: todo_yetanother_read
|
operationId: todo_yetanothers_read
|
||||||
description: ''
|
description: ''
|
||||||
parameters: []
|
parameters: []
|
||||||
responses:
|
responses:
|
||||||
@@ -870,6 +892,32 @@ definitions:
|
|||||||
type: string
|
type: string
|
||||||
format: uuid
|
format: uuid
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
ImageUpload:
|
||||||
|
required:
|
||||||
|
- image_styles
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
what_am_i_doing:
|
||||||
|
description: test
|
||||||
|
type: string
|
||||||
|
pattern: ^69$
|
||||||
|
default: '69'
|
||||||
|
minLength: 1
|
||||||
|
image_styles:
|
||||||
|
description: Parameter with Items
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- wide
|
||||||
|
- tall
|
||||||
|
- thumb
|
||||||
|
- social
|
||||||
|
upload:
|
||||||
|
description: image serializer help_text
|
||||||
|
type: string
|
||||||
|
readOnly: true
|
||||||
|
format: uri
|
||||||
Identity:
|
Identity:
|
||||||
title: Identity
|
title: Identity
|
||||||
type: object
|
type: object
|
||||||
@@ -878,13 +926,14 @@ definitions:
|
|||||||
title: ID
|
title: ID
|
||||||
type: integer
|
type: integer
|
||||||
readOnly: true
|
readOnly: true
|
||||||
firstName:
|
first_name:
|
||||||
title: FirstName
|
title: First name
|
||||||
type: string
|
type: string
|
||||||
maxLength: 30
|
maxLength: 30
|
||||||
minLength: 1
|
minLength: 1
|
||||||
lastName:
|
last_name:
|
||||||
title: LastName
|
title: Last name
|
||||||
|
description: <strong>Here's some HTML!</strong>
|
||||||
type: string
|
type: string
|
||||||
maxLength: 30
|
maxLength: 30
|
||||||
minLength: 1
|
minLength: 1
|
||||||
@@ -926,6 +975,12 @@ definitions:
|
|||||||
description: id serializer help text
|
description: id serializer help text
|
||||||
type: integer
|
type: integer
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
created:
|
||||||
|
title: Client date time suu
|
||||||
|
type: string
|
||||||
|
format: integer
|
||||||
|
readOnly: true
|
||||||
|
description: Date time in unix timestamp format
|
||||||
owner:
|
owner:
|
||||||
title: Owner
|
title: Owner
|
||||||
description: The ID of the user that created this snippet; if none is provided,
|
description: The ID of the user that created this snippet; if none is provided,
|
||||||
@@ -1556,11 +1611,81 @@ definitions:
|
|||||||
minLength: 1
|
minLength: 1
|
||||||
readOnly: true
|
readOnly: true
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
example:
|
||||||
|
title: parent
|
||||||
|
todo:
|
||||||
|
title: child
|
||||||
|
todo: null
|
||||||
|
OtherStuff:
|
||||||
|
title: Other stuff
|
||||||
|
description: the decorator should determine the serializer class for this
|
||||||
|
required:
|
||||||
|
- foo
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
foo:
|
||||||
|
title: Foo
|
||||||
|
type: string
|
||||||
|
minLength: 1
|
||||||
|
MethodFieldExample:
|
||||||
|
title: Hint example
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
hinted_bool:
|
||||||
|
title: Hinted bool
|
||||||
|
description: the type hint on the method should determine this to be a bool
|
||||||
|
type: boolean
|
||||||
|
readOnly: true
|
||||||
|
hinted_int:
|
||||||
|
title: Hinted int
|
||||||
|
description: the type hint on the method should determine this to be an integer
|
||||||
|
type: integer
|
||||||
|
readOnly: true
|
||||||
|
hinted_float:
|
||||||
|
title: Hinted float
|
||||||
|
description: the type hint on the method should determine this to be a number
|
||||||
|
type: number
|
||||||
|
readOnly: true
|
||||||
|
hinted_decimal:
|
||||||
|
title: Hinted decimal
|
||||||
|
description: the type hint on the method should determine this to be a decimal
|
||||||
|
type: string
|
||||||
|
format: decimal
|
||||||
|
readOnly: true
|
||||||
|
hinted_datetime:
|
||||||
|
title: Hinted datetime
|
||||||
|
description: the type hint on the method should determine this to be a datetime
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
readOnly: true
|
||||||
|
hinted_date:
|
||||||
|
title: Hinted date
|
||||||
|
description: the type hint on the method should determine this to be a date
|
||||||
|
type: string
|
||||||
|
format: date
|
||||||
|
readOnly: true
|
||||||
|
hinted_uuid:
|
||||||
|
title: Hinted uuid
|
||||||
|
description: the type hint on the method should determine this to be a uuid
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
readOnly: true
|
||||||
|
hinted_unknown:
|
||||||
|
title: Hinted unknown
|
||||||
|
description: type hint is unknown, so is expected to fallback to string
|
||||||
|
type: string
|
||||||
|
readOnly: true
|
||||||
|
non_hinted_number:
|
||||||
|
title: Non hinted number
|
||||||
|
description: No hint on the method, so this is expected to fallback to string
|
||||||
|
type: string
|
||||||
|
readOnly: true
|
||||||
UserSerializerrr:
|
UserSerializerrr:
|
||||||
required:
|
required:
|
||||||
- username
|
- username
|
||||||
- articles
|
- articles
|
||||||
- snippets
|
- snippets
|
||||||
|
- hint_example
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
@@ -1611,3 +1736,23 @@ definitions:
|
|||||||
pattern: ^[-a-zA-Z0-9_]+$
|
pattern: ^[-a-zA-Z0-9_]+$
|
||||||
readOnly: true
|
readOnly: true
|
||||||
uniqueItems: true
|
uniqueItems: true
|
||||||
|
other_stuff:
|
||||||
|
$ref: '#/definitions/OtherStuff'
|
||||||
|
hint_example:
|
||||||
|
$ref: '#/definitions/MethodFieldExample'
|
||||||
|
help_text_example_1:
|
||||||
|
title: Help text example 1
|
||||||
|
description: help text on field is set, so this should appear in swagger
|
||||||
|
type: integer
|
||||||
|
readOnly: true
|
||||||
|
help_text_example_2:
|
||||||
|
title: Help text example 2
|
||||||
|
description: instance help_text is set, so should appear in swagger
|
||||||
|
type: integer
|
||||||
|
readOnly: true
|
||||||
|
help_text_example_3:
|
||||||
|
title: Help text example 3
|
||||||
|
description: "\n docstring is set so should appear in swagger as fallback\n\
|
||||||
|
\ :return:\n "
|
||||||
|
type: integer
|
||||||
|
readOnly: true
|
||||||
+17
-19
@@ -1,5 +1,3 @@
|
|||||||
from six import StringIO
|
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
@@ -9,24 +7,13 @@ from collections import OrderedDict
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management import call_command
|
|
||||||
|
|
||||||
|
from drf_yasg import openapi
|
||||||
from drf_yasg.codecs import yaml_sane_load
|
from drf_yasg.codecs import yaml_sane_load
|
||||||
|
from drf_yasg.generators import OpenAPISchemaGenerator
|
||||||
|
|
||||||
|
|
||||||
def call_generate_swagger(output_file='-', overwrite=False, format='', api_url='',
|
def test_reference_schema(call_generate_swagger, db, reference_schema):
|
||||||
mock=False, user='', private=False, **kwargs):
|
|
||||||
out = StringIO()
|
|
||||||
call_command(
|
|
||||||
'generate_swagger', stdout=out,
|
|
||||||
output_file=output_file, overwrite=overwrite, format=format,
|
|
||||||
api_url=api_url, mock=mock, user=user, private=private,
|
|
||||||
**kwargs
|
|
||||||
)
|
|
||||||
return out.getvalue()
|
|
||||||
|
|
||||||
|
|
||||||
def test_reference_schema(db, reference_schema):
|
|
||||||
User.objects.create_superuser('admin', 'admin@admin.admin', 'blabla')
|
User.objects.create_superuser('admin', 'admin@admin.admin', 'blabla')
|
||||||
|
|
||||||
output = call_generate_swagger(format='yaml', api_url='http://test.local:8002/', user='admin')
|
output = call_generate_swagger(format='yaml', api_url='http://test.local:8002/', user='admin')
|
||||||
@@ -34,18 +21,29 @@ def test_reference_schema(db, reference_schema):
|
|||||||
assert output_schema == reference_schema
|
assert output_schema == reference_schema
|
||||||
|
|
||||||
|
|
||||||
def test_non_public(db):
|
def test_non_public(call_generate_swagger, db):
|
||||||
output = call_generate_swagger(format='yaml', api_url='http://test.local:8002/', private=True)
|
output = call_generate_swagger(format='yaml', api_url='http://test.local:8002/', private=True)
|
||||||
output_schema = yaml_sane_load(output)
|
output_schema = yaml_sane_load(output)
|
||||||
assert len(output_schema['paths']) == 0
|
assert len(output_schema['paths']) == 0
|
||||||
|
|
||||||
|
|
||||||
def test_no_mock(db):
|
def test_no_mock(call_generate_swagger, db):
|
||||||
output = call_generate_swagger()
|
output = call_generate_swagger()
|
||||||
output_schema = json.loads(output, object_pairs_hook=OrderedDict)
|
output_schema = json.loads(output, object_pairs_hook=OrderedDict)
|
||||||
assert len(output_schema['paths']) > 0
|
assert len(output_schema['paths']) > 0
|
||||||
|
|
||||||
|
|
||||||
|
class EmptySchemaGenerator(OpenAPISchemaGenerator):
|
||||||
|
def get_paths(self, endpoints, components, request, public):
|
||||||
|
return openapi.Paths(paths={}), ''
|
||||||
|
|
||||||
|
|
||||||
|
def test_generator_class(call_generate_swagger, db):
|
||||||
|
output = call_generate_swagger(generator_class_name='test_management.EmptySchemaGenerator')
|
||||||
|
output_schema = json.loads(output, object_pairs_hook=OrderedDict)
|
||||||
|
assert len(output_schema['paths']) == 0
|
||||||
|
|
||||||
|
|
||||||
def silentremove(filename):
|
def silentremove(filename):
|
||||||
try:
|
try:
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
@@ -53,7 +51,7 @@ def silentremove(filename):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def test_file_output(db):
|
def test_file_output(call_generate_swagger, db):
|
||||||
prefix = os.path.join(tempfile.gettempdir(), tempfile.gettempprefix())
|
prefix = os.path.join(tempfile.gettempdir(), tempfile.gettempprefix())
|
||||||
name = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8))
|
name = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8))
|
||||||
yaml_file = prefix + name + '.yaml'
|
yaml_file = prefix + name + '.yaml'
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ def test_validator_url(swagger_settings, swagger):
|
|||||||
swagger_settings['VALIDATOR_URL'] = None
|
swagger_settings['VALIDATOR_URL'] = None
|
||||||
_check_swagger_setting(swagger, 'validatorUrl', None)
|
_check_swagger_setting(swagger, 'validatorUrl', None)
|
||||||
|
|
||||||
swagger_settings['VALIDATOR_URL'] = 'not none'
|
swagger_settings['VALIDATOR_URL'] = 'http://not.none/'
|
||||||
_check_swagger_setting(swagger, 'validatorUrl', 'not none')
|
_check_swagger_setting(swagger, 'validatorUrl', 'http://not.none/')
|
||||||
|
|
||||||
with pytest.raises(KeyError):
|
with pytest.raises(KeyError):
|
||||||
swagger_settings['VALIDATOR_URL'] = ''
|
swagger_settings['VALIDATOR_URL'] = ''
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import json
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from django.conf.urls import url
|
||||||
from rest_framework import routers, serializers, viewsets
|
from rest_framework import routers, serializers, viewsets
|
||||||
|
from rest_framework.decorators import api_view
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
|
||||||
from drf_yasg import codecs, openapi
|
from drf_yasg import codecs, openapi
|
||||||
@@ -113,3 +115,78 @@ def test_replaced_serializer():
|
|||||||
responses = swagger['paths']['/details/{id}/']['get']['responses']
|
responses = swagger['paths']['/details/{id}/']['get']['responses']
|
||||||
assert '404' in responses
|
assert '404' in responses
|
||||||
assert responses['404']['schema']['$ref'] == "#/definitions/Detail"
|
assert responses['404']['schema']['$ref'] == "#/definitions/Detail"
|
||||||
|
|
||||||
|
|
||||||
|
def test_url_order():
|
||||||
|
# this view with description override should show up in the schema ...
|
||||||
|
@swagger_auto_schema(method='get', operation_description="description override")
|
||||||
|
@api_view()
|
||||||
|
def test_override(request, pk=None):
|
||||||
|
return Response({"message": "Hello, world!"})
|
||||||
|
|
||||||
|
# ... instead of this view which appears later in the url patterns
|
||||||
|
@api_view()
|
||||||
|
def test_view(request, pk=None):
|
||||||
|
return Response({"message": "Hello, world!"})
|
||||||
|
|
||||||
|
patterns = [
|
||||||
|
url(r'^/test/$', test_override),
|
||||||
|
url(r'^/test/$', test_view),
|
||||||
|
]
|
||||||
|
|
||||||
|
generator = OpenAPISchemaGenerator(
|
||||||
|
info=openapi.Info(title="Test generator", default_version="v1"),
|
||||||
|
version="v2",
|
||||||
|
url='',
|
||||||
|
patterns=patterns
|
||||||
|
)
|
||||||
|
|
||||||
|
# description override is successful
|
||||||
|
swagger = generator.get_schema(None, True)
|
||||||
|
assert swagger['paths']['/test/']['get']['description'] == 'description override'
|
||||||
|
|
||||||
|
# get_endpoints only includes one endpoint
|
||||||
|
assert len(generator.get_endpoints(None)['/test/'][1]) == 1
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from rest_framework.decorators import action, MethodMapper
|
||||||
|
except ImportError:
|
||||||
|
action = MethodMapper = None
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(not MethodMapper or not action, reason="action.mapping test (djangorestframework>=3.9 required)")
|
||||||
|
def test_action_mapping():
|
||||||
|
class ActionViewSet(viewsets.ViewSet):
|
||||||
|
@swagger_auto_schema(method='get', operation_id='mapping_get')
|
||||||
|
@swagger_auto_schema(method='delete', operation_id='mapping_delete')
|
||||||
|
@action(detail=False, methods=['get', 'delete'], url_path='test')
|
||||||
|
def action_main(self, request):
|
||||||
|
"""mapping docstring get/delete"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
@swagger_auto_schema(operation_id='mapping_post')
|
||||||
|
@action_main.mapping.post
|
||||||
|
def action_post(self, request):
|
||||||
|
"""mapping docstring post"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
router = routers.DefaultRouter()
|
||||||
|
router.register(r'action', ActionViewSet, base_name='action')
|
||||||
|
|
||||||
|
generator = OpenAPISchemaGenerator(
|
||||||
|
info=openapi.Info(title="Test generator", default_version="v1"),
|
||||||
|
version="v2",
|
||||||
|
url='',
|
||||||
|
patterns=router.urls
|
||||||
|
)
|
||||||
|
|
||||||
|
for _ in range(3):
|
||||||
|
swagger = generator.get_schema(None, True)
|
||||||
|
action_ops = swagger['paths']['/test/']
|
||||||
|
methods = ['get', 'post', 'delete']
|
||||||
|
assert all(mth in action_ops for mth in methods)
|
||||||
|
assert all(action_ops[mth]['operationId'] == 'mapping_' + mth for mth in methods)
|
||||||
|
assert action_ops['post']['description'] == 'mapping docstring post'
|
||||||
|
assert action_ops['get']['description'] == 'mapping docstring get/delete'
|
||||||
|
assert action_ops['delete']['description'] == 'mapping docstring get/delete'
|
||||||
@@ -7,6 +7,18 @@ def _get_versioned_schema(prefix, client, validate_schema):
|
|||||||
response = client.get(prefix + '/swagger.yaml')
|
response = client.get(prefix + '/swagger.yaml')
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
swagger = yaml_sane_load(response.content.decode('utf-8'))
|
swagger = yaml_sane_load(response.content.decode('utf-8'))
|
||||||
|
_check_base(swagger, prefix, validate_schema)
|
||||||
|
return swagger
|
||||||
|
|
||||||
|
|
||||||
|
def _get_versioned_schema_management(prefix, call_generate_swagger, validate_schema, kwargs):
|
||||||
|
output = call_generate_swagger(format='yaml', api_url='http://localhost' + prefix + '/swagger.yaml', **kwargs)
|
||||||
|
swagger = yaml_sane_load(output)
|
||||||
|
_check_base(swagger, prefix, validate_schema)
|
||||||
|
return swagger
|
||||||
|
|
||||||
|
|
||||||
|
def _check_base(swagger, prefix, validate_schema):
|
||||||
assert swagger['basePath'] == prefix
|
assert swagger['basePath'] == prefix
|
||||||
validate_schema(swagger)
|
validate_schema(swagger)
|
||||||
assert '/snippets/' in swagger['paths']
|
assert '/snippets/' in swagger['paths']
|
||||||
@@ -51,3 +63,17 @@ def test_ns_v1(client, validate_schema):
|
|||||||
def test_ns_v2(client, validate_schema):
|
def test_ns_v2(client, validate_schema):
|
||||||
swagger = _get_versioned_schema('/versioned/ns/v2.0', client, validate_schema)
|
swagger = _get_versioned_schema('/versioned/ns/v2.0', client, validate_schema)
|
||||||
_check_v2(swagger)
|
_check_v2(swagger)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.urls('urlconfs.url_versioning')
|
||||||
|
def test_url_v2_management(call_generate_swagger, validate_schema):
|
||||||
|
kwargs = {'api_version': '2.0'}
|
||||||
|
swagger = _get_versioned_schema_management('/versioned/url/v2.0', call_generate_swagger, validate_schema, kwargs)
|
||||||
|
_check_v2(swagger)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.urls('urlconfs.ns_versioning')
|
||||||
|
def test_ns_v2_management(call_generate_swagger, validate_schema):
|
||||||
|
kwargs = {'api_version': '2.0'}
|
||||||
|
swagger = _get_versioned_schema_management('/versioned/ns/v2.0', call_generate_swagger, validate_schema, kwargs)
|
||||||
|
_check_v2(swagger)
|
||||||
@@ -1,28 +1,26 @@
|
|||||||
[tox]
|
[tox]
|
||||||
|
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
|
||||||
envlist =
|
envlist =
|
||||||
py27-django111-drf37,
|
py{27,34,35,36}-django111-drf{37,38},
|
||||||
py{34,35,36}-django{111,20}-drf{37,38},
|
py{34,35,36,37}-django20-drf{37,38},
|
||||||
py36-django20-drfmaster,
|
py{35,36,37}-django21-drf{37,38},
|
||||||
lint, docs
|
djmaster, lint, docs
|
||||||
|
|
||||||
[travis:env]
|
|
||||||
DRF =
|
|
||||||
3.7: drf37
|
|
||||||
3.8: drf38
|
|
||||||
master: drfmaster
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps =
|
deps =
|
||||||
django111: Django>=1.11,<2.0
|
django111: Django>=1.11,<2.0
|
||||||
django20: Django>=2.0,<2.1
|
django20: Django>=2.0,<2.1
|
||||||
|
django21: Django>=2.1,<2.2
|
||||||
|
|
||||||
drf37: djangorestframework>=3.7.7,<3.8
|
drf37: djangorestframework>=3.7.7,<3.8
|
||||||
drf38: djangorestframework>=3.8.0,<3.9
|
drf38: djangorestframework>=3.8.0,<3.9
|
||||||
|
|
||||||
# test with the latest build of django-rest-framework to get early warning of compatibility issues
|
# test with the latest build of django-rest-framework to get early warning of compatibility issues
|
||||||
drfmaster: https://github.com/encode/django-rest-framework/archive/master.tar.gz
|
djmaster: https://github.com/encode/django-rest-framework/archive/master.tar.gz
|
||||||
|
djmaster: https://github.com/django/django/archive/master.tar.gz
|
||||||
|
|
||||||
# other dependencies
|
# other dependencies
|
||||||
|
-rrequirements/setup.txt
|
||||||
-rrequirements/validation.txt
|
-rrequirements/validation.txt
|
||||||
-rrequirements/test.txt
|
-rrequirements/test.txt
|
||||||
|
|
||||||
@@ -32,12 +30,14 @@ commands =
|
|||||||
[testenv:lint]
|
[testenv:lint]
|
||||||
skip_install = true
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
|
-rrequirements/setup.txt
|
||||||
-rrequirements/lint.txt
|
-rrequirements/lint.txt
|
||||||
commands =
|
commands =
|
||||||
flake8 src/drf_yasg testproj tests setup.py
|
flake8 src/drf_yasg testproj tests setup.py
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
deps =
|
deps =
|
||||||
|
-rrequirements/setup.txt
|
||||||
-rrequirements/docs.txt
|
-rrequirements/docs.txt
|
||||||
commands =
|
commands =
|
||||||
python setup.py check --restructuredtext --metadata --strict
|
python setup.py check --restructuredtext --metadata --strict
|
||||||
@@ -46,7 +46,7 @@ commands =
|
|||||||
[pytest]
|
[pytest]
|
||||||
DJANGO_SETTINGS_MODULE = testproj.settings.local
|
DJANGO_SETTINGS_MODULE = testproj.settings.local
|
||||||
python_paths = testproj
|
python_paths = testproj
|
||||||
addopts = -n 3
|
addopts = -n 2 --ignore=node_modules
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
@@ -54,13 +54,13 @@ exclude = **/migrations/*
|
|||||||
ignore = F405
|
ignore = F405
|
||||||
|
|
||||||
[isort]
|
[isort]
|
||||||
skip = .eggs,.tox,docs,env,venv
|
skip = .eggs,.tox,docs,env,venv,node_modules
|
||||||
skip_glob = **/migrations/*
|
skip_glob = **/migrations/*
|
||||||
not_skip = __init__.py
|
not_skip = __init__.py
|
||||||
atomic = true
|
atomic = true
|
||||||
multi_line_output = 5
|
multi_line_output = 5
|
||||||
line_length = 120
|
line_length = 120
|
||||||
known_future_library = future,six
|
known_future_library = six
|
||||||
known_standard_library =
|
known_standard_library =
|
||||||
collections,copy,distutils,functools,inspect,io,json,logging,operator,os,pkg_resources,re,setuptools,sys,
|
collections,copy,distutils,functools,inspect,io,json,logging,operator,os,pkg_resources,re,setuptools,sys,
|
||||||
types,warnings
|
types,warnings
|
||||||
|
|||||||
Regular → Executable
+2
@@ -3,6 +3,8 @@ set -ev
|
|||||||
npm update
|
npm update
|
||||||
|
|
||||||
cp node_modules/redoc/bundles/redoc.standalone.js src/drf_yasg/static/drf-yasg/redoc/redoc.min.js
|
cp node_modules/redoc/bundles/redoc.standalone.js src/drf_yasg/static/drf-yasg/redoc/redoc.min.js
|
||||||
|
wget https://rebilly.github.io/ReDoc/releases/v1.x.x/redoc.min.js -O src/drf_yasg/static/drf-yasg/redoc-old/redoc.min.js
|
||||||
|
|
||||||
cp -r node_modules/swagger-ui-dist src/drf_yasg/static/drf-yasg/
|
cp -r node_modules/swagger-ui-dist src/drf_yasg/static/drf-yasg/
|
||||||
pushd src/drf_yasg/static/drf-yasg/swagger-ui-dist/ >/dev/null
|
pushd src/drf_yasg/static/drf-yasg/swagger-ui-dist/ >/dev/null
|
||||||
rm -f package.json .npmignore README.md
|
rm -f package.json .npmignore README.md
|
||||||
|
|||||||
Reference in new issue
Block a user