diff --git a/.gitignore b/.gitignore index 3788056..78c6275 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ .pytest_cache .coverage -### vscode ### -.vscode +.env playground/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4d8361..a81de92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-json + exclude: .vscode/ - id: check-toml - id: check-added-large-files args: ['--maxkb=500'] @@ -47,11 +48,19 @@ repos: rev: v3.1.0 hooks: - id: pylint - additional_dependencies: [pydantic, pylint-pydantic] + additional_dependencies: + [ + pydantic, + pydantic-settings, + pylint-pydantic, + fastapi, + uvicorn, + motor, + redis, + types-redis, + ] exclude: django_project/ language_version: python3.11 - args: - - '--load-plugins=pylint_pydantic' - repo: https://github.com/asottile/pyupgrade rev: v3.15.1 hooks: diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..1e97655 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,50 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python Debugger: FastAPI", + "type": "debugpy", + "request": "launch", + "module": "uvicorn", + "args": [ + "--host", + "0.0.0.0", + "examples.web.fastapi.main:app", + "--reload" + ], + "jinja": true, + "cwd": "${workspaceFolder}", + }, + { + "name": "FastAPI: OpenAPI with Custom Static Files", + "type": "debugpy", + "request": "launch", + "module": "uvicorn", + "args": [ + "--host", + "0.0.0.0", + "examples.web.fastapi.main_openapi_static:app", + "--reload" + ], + "jinja": true, + "cwd": "${workspaceFolder}", + }, + { + "name": "FastAPI: MongoDB", + "type": "debugpy", + "request": "launch", + "module": "uvicorn", + "args": [ + "--host", + "0.0.0.0", + "examples.web.fastapi.main_mongodb:app", + "--reload" + ], + "jinja": true, + "cwd": "${workspaceFolder}", + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..89ba0fa --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,32 @@ +{ + "files.exclude": { + "**/__pycache__": true, + "**/.mypy_cache": true + }, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit", + "source.fixAll": "explicit" + } + }, + "python.analysis.importFormat": "absolute", + "python.analysis.typeCheckingMode": "basic", + "black-formatter.args": [ + "--line-length=88", + "--skip-string-normalization" + ], + "isort.args": [ + "--profile=black" + ], + "isort.severity": { + "E": "Error" + }, + "pylint.args": [ + "--load-plugins=pylint.extensions.bad_builtin,pylint_pydantic", + "--ignore=CVS,.git,__pycache__,.mypy_cache,tests", + "--disable=no-self-argument", + ], + "python.testing.pytestEnabled": false +} diff --git a/Pipfile b/Pipfile index dd613ab..0af6e8b 100644 --- a/Pipfile +++ b/Pipfile @@ -5,6 +5,8 @@ name = "pypi" [packages] pydantic = "*" +fastapi = {version = "*", extras = ["all"]} +uvicorn = {version = "*", extras = ["standard"]} redis = {version = "*", extras = ["hiredis"]} types-redis = "*" #uvloop = {version = "*", markers = "sys_platform != 'win32'"} @@ -13,6 +15,7 @@ celery = {version = "*", extras = ["librabbitmq", "mongodb", "redis"]} #types-requests = "*" #django = "~=4.2" #psycopg = {version = ">=3.2", extras = ["binary", "pool"]} +motor = "*" [dev-packages] black = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 769f358..f6fc17a 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "29a7c1184b68dbbd20a1355d849b5edfb8d077ae7a0c4deb374da90c18758589" + "sha256": "b4a09e56daf0c935fb3ccb92c35b5a3dc7acd28ade3b4d4334347e72802a4fe9" }, "pipfile-spec": 6, "requires": { @@ -32,13 +32,13 @@ "markers": "python_version >= '3.8'", "version": "==0.6.0" }, - "async-timeout": { + "anyio": { "hashes": [ - "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f", - "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028" + "sha256:048e05d0f6caeed70d731f3db756d35dcc1f35747c8c403364a8332c630441b8", + "sha256:f75253795a87df48568485fd18cdd2a3fa5c4f7c5be8e5e36637733fce06fed6" ], - "markers": "python_version >= '3.7'", - "version": "==4.0.3" + "markers": "python_version >= '3.8'", + "version": "==4.3.0" }, "billiard": { "hashes": [ @@ -61,6 +61,14 @@ "index": "pypi", "version": "==5.3.6" }, + "certifi": { + "hashes": [ + "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f", + "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1" + ], + "markers": "python_version >= '3.6'", + "version": "==2024.2.2" + }, "cffi": { "hashes": [ "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc", @@ -196,6 +204,32 @@ "markers": "python_version >= '3.8'", "version": "==2.6.1" }, + "email-validator": { + "hashes": [ + "sha256:200a70680ba08904be6d1eef729205cc0d687634399a5924d842533efb824b84", + "sha256:97d882d174e2a65732fb43bfce81a3a834cbc1bde8bf419e30ef5ea976370a05" + ], + "version": "==2.1.1" + }, + "fastapi": { + "extras": [ + "all" + ], + "hashes": [ + "sha256:266775f0dcc95af9d3ef39bad55cff525329a931d5fd51930aadd4f428bf7ff3", + "sha256:87a1f6fb632a218222c5984be540055346a8f5d8a68e8f6fb647b1dc9934de4b" + ], + "index": "pypi", + "version": "==0.110.0" + }, + "h11": { + "hashes": [ + "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", + "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761" + ], + "markers": "python_version >= '3.7'", + "version": "==0.14.0" + }, "hiredis": { "hashes": [ "sha256:01b6c24c0840ac7afafbc4db236fd55f56a9a0919a215c25a238f051781f4772", @@ -310,6 +344,84 @@ ], "version": "==2.3.2" }, + "httpcore": { + "hashes": [ + "sha256:ac418c1db41bade2ad53ae2f3834a3a0f5ae76b56cf5aa497d2d033384fc7d73", + "sha256:cb2839ccfcba0d2d3c1131d3c3e26dfc327326fbe7a5dc0dbfe9f6c9151bb022" + ], + "markers": "python_version >= '3.8'", + "version": "==1.0.4" + }, + "httptools": { + "hashes": [ + "sha256:00d5d4b68a717765b1fabfd9ca755bd12bf44105eeb806c03d1962acd9b8e563", + "sha256:0ac5a0ae3d9f4fe004318d64b8a854edd85ab76cffbf7ef5e32920faef62f142", + "sha256:0cf2372e98406efb42e93bfe10f2948e467edfd792b015f1b4ecd897903d3e8d", + "sha256:1ed99a373e327f0107cb513b61820102ee4f3675656a37a50083eda05dc9541b", + "sha256:3c3b214ce057c54675b00108ac42bacf2ab8f85c58e3f324a4e963bbc46424f4", + "sha256:3e802e0b2378ade99cd666b5bffb8b2a7cc8f3d28988685dc300469ea8dd86cb", + "sha256:3f30d3ce413088a98b9db71c60a6ada2001a08945cb42dd65a9a9fe228627658", + "sha256:405784577ba6540fa7d6ff49e37daf104e04f4b4ff2d1ac0469eaa6a20fde084", + "sha256:48ed8129cd9a0d62cf4d1575fcf90fb37e3ff7d5654d3a5814eb3d55f36478c2", + "sha256:4bd3e488b447046e386a30f07af05f9b38d3d368d1f7b4d8f7e10af85393db97", + "sha256:4f0f8271c0a4db459f9dc807acd0eadd4839934a4b9b892f6f160e94da309837", + "sha256:5cceac09f164bcba55c0500a18fe3c47df29b62353198e4f37bbcc5d591172c3", + "sha256:639dc4f381a870c9ec860ce5c45921db50205a37cc3334e756269736ff0aac58", + "sha256:678fcbae74477a17d103b7cae78b74800d795d702083867ce160fc202104d0da", + "sha256:6a4f5ccead6d18ec072ac0b84420e95d27c1cdf5c9f1bc8fbd8daf86bd94f43d", + "sha256:6f58e335a1402fb5a650e271e8c2d03cfa7cea46ae124649346d17bd30d59c90", + "sha256:75c8022dca7935cba14741a42744eee13ba05db00b27a4b940f0d646bd4d56d0", + "sha256:7a7ea483c1a4485c71cb5f38be9db078f8b0e8b4c4dc0210f531cdd2ddac1ef1", + "sha256:7d9ceb2c957320def533671fc9c715a80c47025139c8d1f3797477decbc6edd2", + "sha256:7ebaec1bf683e4bf5e9fbb49b8cc36da482033596a415b3e4ebab5a4c0d7ec5e", + "sha256:85ed077c995e942b6f1b07583e4eb0a8d324d418954fc6af913d36db7c05a5a0", + "sha256:8ae5b97f690badd2ca27cbf668494ee1b6d34cf1c464271ef7bfa9ca6b83ffaf", + "sha256:8b0bb634338334385351a1600a73e558ce619af390c2b38386206ac6a27fecfc", + "sha256:8e216a038d2d52ea13fdd9b9c9c7459fb80d78302b257828285eca1c773b99b3", + "sha256:93ad80d7176aa5788902f207a4e79885f0576134695dfb0fefc15b7a4648d503", + "sha256:95658c342529bba4e1d3d2b1a874db16c7cca435e8827422154c9da76ac4e13a", + "sha256:95fb92dd3649f9cb139e9c56604cc2d7c7bf0fc2e7c8d7fbd58f96e35eddd2a3", + "sha256:97662ce7fb196c785344d00d638fc9ad69e18ee4bfb4000b35a52efe5adcc949", + "sha256:9bb68d3a085c2174c2477eb3ffe84ae9fb4fde8792edb7bcd09a1d8467e30a84", + "sha256:b512aa728bc02354e5ac086ce76c3ce635b62f5fbc32ab7082b5e582d27867bb", + "sha256:c6e26c30455600b95d94b1b836085138e82f177351454ee841c148f93a9bad5a", + "sha256:d2f6c3c4cb1948d912538217838f6e9960bc4a521d7f9b323b3da579cd14532f", + "sha256:dcbab042cc3ef272adc11220517278519adf8f53fd3056d0e68f0a6f891ba94e", + "sha256:e0b281cf5a125c35f7f6722b65d8542d2e57331be573e9e88bc8b0115c4a7a81", + "sha256:e57997ac7fb7ee43140cc03664de5f268813a481dff6245e0075925adc6aa185", + "sha256:fe467eb086d80217b7584e61313ebadc8d187a4d95bb62031b7bab4b205c3ba3" + ], + "version": "==0.6.1" + }, + "httpx": { + "hashes": [ + "sha256:71d5465162c13681bff01ad59b2cc68dd838ea1f10e51574bac27103f00c91a5", + "sha256:a0cb88a46f32dc874e04ee956e4c2764aba2aa228f650b06788ba6bda2962ab5" + ], + "version": "==0.27.0" + }, + "idna": { + "hashes": [ + "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca", + "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f" + ], + "markers": "python_version >= '3.5'", + "version": "==3.6" + }, + "itsdangerous": { + "hashes": [ + "sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44", + "sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a" + ], + "version": "==2.1.2" + }, + "jinja2": { + "hashes": [ + "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa", + "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90" + ], + "version": "==3.1.3" + }, "kombu": { "hashes": [ "sha256:0eac1bbb464afe6fb0924b21bf79460416d25d8abc52546d4f16cad94f789488", @@ -318,6 +430,135 @@ "markers": "python_version >= '3.8'", "version": "==5.3.5" }, + "markupsafe": { + "hashes": [ + "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf", + "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff", + "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f", + "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3", + "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532", + "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f", + "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617", + "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df", + "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4", + "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906", + "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f", + "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4", + "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8", + "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371", + "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2", + "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465", + "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52", + "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6", + "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169", + "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad", + "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2", + "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0", + "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029", + "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f", + "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a", + "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced", + "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5", + "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c", + "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf", + "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9", + "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb", + "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad", + "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3", + "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1", + "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46", + "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc", + "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a", + "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee", + "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900", + "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5", + "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea", + "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f", + "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5", + "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e", + "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a", + "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f", + "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50", + "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a", + "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b", + "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4", + "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff", + "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2", + "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46", + "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b", + "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf", + "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5", + "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5", + "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab", + "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd", + "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68" + ], + "markers": "python_version >= '3.7'", + "version": "==2.1.5" + }, + "motor": { + "hashes": [ + "sha256:6fe7e6f0c4f430b9e030b9d22549b732f7c2226af3ab71ecc309e4a1b7d19953", + "sha256:d2fc38de15f1c8058f389c1a44a4d4105c0405c48c061cd492a654496f7bc26a" + ], + "index": "pypi", + "version": "==3.3.2" + }, + "orjson": { + "hashes": [ + "sha256:001f4eb0ecd8e9ebd295722d0cbedf0748680fb9998d3993abaed2f40587257a", + "sha256:05a1f57fb601c426635fcae9ddbe90dfc1ed42245eb4c75e4960440cac667262", + "sha256:10c57bc7b946cf2efa67ac55766e41764b66d40cbd9489041e637c1304400494", + "sha256:12365576039b1a5a47df01aadb353b68223da413e2e7f98c02403061aad34bde", + "sha256:2973474811db7b35c30248d1129c64fd2bdf40d57d84beed2a9a379a6f57d0ab", + "sha256:2b5c0f532905e60cf22a511120e3719b85d9c25d0e1c2a8abb20c4dede3b05a5", + "sha256:2c51378d4a8255b2e7c1e5cc430644f0939539deddfa77f6fac7b56a9784160a", + "sha256:2d99e3c4c13a7b0fb3792cc04c2829c9db07838fb6973e578b85c1745e7d0ce7", + "sha256:2f256d03957075fcb5923410058982aea85455d035607486ccb847f095442bda", + "sha256:34cbcd216e7af5270f2ffa63a963346845eb71e174ea530867b7443892d77180", + "sha256:4228aace81781cc9d05a3ec3a6d2673a1ad0d8725b4e915f1089803e9efd2b99", + "sha256:4feeb41882e8aa17634b589533baafdceb387e01e117b1ec65534ec724023d04", + "sha256:57d5d8cf9c27f7ef6bc56a5925c7fbc76b61288ab674eb352c26ac780caa5b10", + "sha256:5bb399e1b49db120653a31463b4a7b27cf2fbfe60469546baf681d1b39f4edf2", + "sha256:62482873e0289cf7313461009bf62ac8b2e54bc6f00c6fabcde785709231a5d7", + "sha256:67384f588f7f8daf040114337d34a5188346e3fae6c38b6a19a2fe8c663a2f9b", + "sha256:6ae4e06be04dc00618247c4ae3f7c3e561d5bc19ab6941427f6d3722a0875ef7", + "sha256:6f7b65bfaf69493c73423ce9db66cfe9138b2f9ef62897486417a8fcb0a92bfe", + "sha256:6fc2fe4647927070df3d93f561d7e588a38865ea0040027662e3e541d592811e", + "sha256:71c6b009d431b3839d7c14c3af86788b3cfac41e969e3e1c22f8a6ea13139404", + "sha256:7413070a3e927e4207d00bd65f42d1b780fb0d32d7b1d951f6dc6ade318e1b5a", + "sha256:76bc6356d07c1d9f4b782813094d0caf1703b729d876ab6a676f3aaa9a47e37c", + "sha256:7f6cbd8e6e446fb7e4ed5bac4661a29e43f38aeecbf60c4b900b825a353276a1", + "sha256:8055ec598605b0077e29652ccfe9372247474375e0e3f5775c91d9434e12d6b1", + "sha256:809d653c155e2cc4fd39ad69c08fdff7f4016c355ae4b88905219d3579e31eb7", + "sha256:82425dd5c7bd3adfe4e94c78e27e2fa02971750c2b7ffba648b0f5d5cc016a73", + "sha256:87f1097acb569dde17f246faa268759a71a2cb8c96dd392cd25c668b104cad2f", + "sha256:920fa5a0c5175ab14b9c78f6f820b75804fb4984423ee4c4f1e6d748f8b22bc1", + "sha256:92255879280ef9c3c0bcb327c5a1b8ed694c290d61a6a532458264f887f052cb", + "sha256:946c3a1ef25338e78107fba746f299f926db408d34553b4754e90a7de1d44068", + "sha256:95cae920959d772f30ab36d3b25f83bb0f3be671e986c72ce22f8fa700dae061", + "sha256:9cf1596680ac1f01839dba32d496136bdd5d8ffb858c280fa82bbfeb173bdd40", + "sha256:9fe41b6f72f52d3da4db524c8653e46243c8c92df826ab5ffaece2dba9cccd58", + "sha256:b17f0f14a9c0ba55ff6279a922d1932e24b13fc218a3e968ecdbf791b3682b25", + "sha256:b3d336ed75d17c7b1af233a6561cf421dee41d9204aa3cfcc6c9c65cd5bb69a8", + "sha256:b66bcc5670e8a6b78f0313bcb74774c8291f6f8aeef10fe70e910b8040f3ab75", + "sha256:b725da33e6e58e4a5d27958568484aa766e825e93aa20c26c91168be58e08cbb", + "sha256:b72758f3ffc36ca566ba98a8e7f4f373b6c17c646ff8ad9b21ad10c29186f00d", + "sha256:bcef128f970bb63ecf9a65f7beafd9b55e3aaf0efc271a4154050fc15cdb386e", + "sha256:c8e8fe01e435005d4421f183038fc70ca85d2c1e490f51fb972db92af6e047c2", + "sha256:d61f7ce4727a9fa7680cd6f3986b0e2c732639f46a5e0156e550e35258aa313a", + "sha256:d6768a327ea1ba44c9114dba5fdda4a214bdb70129065cd0807eb5f010bfcbb5", + "sha256:e18668f1bd39e69b7fed19fa7cd1cd110a121ec25439328b5c89934e6d30d357", + "sha256:e88b97ef13910e5f87bcbc4dd7979a7de9ba8702b54d3204ac587e83639c0c2b", + "sha256:ea0b183a5fe6b2b45f3b854b0d19c4e932d6f5934ae1f723b07cf9560edd4ec7", + "sha256:ede0bde16cc6e9b96633df1631fbcd66491d1063667f260a4f2386a098393790", + "sha256:f541587f5c558abd93cb0de491ce99a9ef8d1ae29dd6ab4dbb5a13281ae04cbd", + "sha256:fbbeb3c9b2edb5fd044b2a070f127a0ac456ffd079cb82746fc84af01ef021a4", + "sha256:fdfa97090e2d6f73dced247a2f2d8004ac6449df6568f30e7fa1a045767c69a6", + "sha256:ff0f9913d82e1d1fadbd976424c316fbc4d9c525c81d047bbdd16bd27dd98cfc" + ], + "version": "==3.9.15" + }, "prompt-toolkit": { "hashes": [ "sha256:3527b7af26106cbc65a040bcc84839a3566ec1b051bb0bfe953631e704b0ff7d", @@ -335,11 +576,11 @@ }, "pydantic": { "hashes": [ - "sha256:72c6034df47f46ccdf81869fddb81aade68056003900a8724a4f160700016a2a", - "sha256:e07805c4c7f5c6826e33a1d4c9d47950d7eaf34868e2690f8594d2e30241f11f" + "sha256:b1704e0847db01817624a6b86766967f552dd9dbf3afba4004409f908dcc84e6", + "sha256:cc46fce86607580867bdc3361ad462bab9c222ef042d3da86f2fb333e1d916c5" ], "index": "pypi", - "version": "==2.6.3" + "version": "==2.6.4" }, "pydantic-core": { "hashes": [ @@ -426,6 +667,20 @@ "markers": "python_version >= '3.8'", "version": "==2.16.3" }, + "pydantic-extra-types": { + "hashes": [ + "sha256:d291d521c2e2bf2e6f11971caf8d639518124ae26a76d2e712599e98c4ef2b2b", + "sha256:e9a93cfb245158462acb76621785219f80ad112303a0a7784d2ada65e6ed6cba" + ], + "version": "==2.6.0" + }, + "pydantic-settings": { + "hashes": [ + "sha256:00b9f6a5e95553590434c0fa01ead0b216c3e10bc54ae02e37f359948643c5ed", + "sha256:0235391d26db4d2190cb9b31051c4b46882d28a51533f97440867f012d4da091" + ], + "version": "==2.2.1" + }, "pymongo": { "extras": [ "srv" @@ -524,16 +779,87 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.9.0.post0" }, + "python-dotenv": { + "hashes": [ + "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca", + "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a" + ], + "markers": "python_version >= '3.8'", + "version": "==1.0.1" + }, + "python-multipart": { + "hashes": [ + "sha256:03f54688c663f1b7977105f021043b0793151e4cb1c1a9d4a11fc13d622c4026", + "sha256:97ca7b8ea7b05f977dc3849c3ba99d51689822fab725c3703af7c866a0c2b215" + ], + "version": "==0.0.9" + }, + "pyyaml": { + "hashes": [ + "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5", + "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc", + "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df", + "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741", + "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206", + "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27", + "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595", + "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62", + "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98", + "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696", + "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290", + "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9", + "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d", + "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6", + "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867", + "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47", + "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486", + "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6", + "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3", + "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007", + "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938", + "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0", + "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c", + "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735", + "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d", + "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28", + "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4", + "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba", + "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8", + "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef", + "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5", + "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd", + "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3", + "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0", + "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515", + "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c", + "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c", + "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924", + "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34", + "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43", + "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859", + "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673", + "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54", + "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a", + "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b", + "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab", + "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa", + "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c", + "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585", + "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d", + "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f" + ], + "version": "==6.0.1" + }, "redis": { "extras": [ "hiredis" ], "hashes": [ - "sha256:3f82cc80d350e93042c8e6e7a5d0596e4dd68715babffba79492733e1f367037", - "sha256:4caa8e1fcb6f3c0ef28dba99535101d80934b7d4cd541bbb47f4a3826ee472d1" + "sha256:4973bae7444c0fbed64a06b87446f79361cb7e4ec1538c022d696ed7a5015580", + "sha256:5da9b8fe9e1254293756c16c008e8620b3d15fcc6dde6babde9541850e72a32d" ], "index": "pypi", - "version": "==5.0.2" + "version": "==5.0.3" }, "six": { "hashes": [ @@ -543,21 +869,37 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.16.0" }, + "sniffio": { + "hashes": [ + "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", + "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc" + ], + "markers": "python_version >= '3.7'", + "version": "==1.3.1" + }, + "starlette": { + "hashes": [ + "sha256:13d429aa93a61dc40bf503e8c801db1f1bca3dc706b10ef2434a36123568f044", + "sha256:90a671733cfb35771d8cc605e0b679d23b992f8dcfad48cc60b38cb29aeb7080" + ], + "markers": "python_version >= '3.8'", + "version": "==0.36.3" + }, "types-pyopenssl": { "hashes": [ - "sha256:a472cf877a873549175e81972f153f44e975302a3cf17381eb5f3d41ccfb75a4", - "sha256:cd990717d8aa3743ef0e73e0f462e64b54d90c304249232d48fece4f0f7c3c6a" + "sha256:6e8e8bfad34924067333232c93f7fc4b369856d8bea0d5c9d1808cb290ab1972", + "sha256:7bca00cfc4e7ef9c5d2663c6a1c068c35798e59670595439f6296e7ba3d58083" ], "markers": "python_version >= '3.8'", - "version": "==24.0.0.20240228" + "version": "==24.0.0.20240311" }, "types-redis": { "hashes": [ - "sha256:5103d7e690e5c74c974a161317b2d59ac2303cf8bef24175b04c2a4c3486cb39", - "sha256:dc9c45a068240e33a04302aec5655cf41e80f91eecffccbb2df215b2f6fc375d" + "sha256:6b9d68a29aba1ee400c823d8e5fe88675282eb69d7211e72fe65dbe54b33daca", + "sha256:e049bbdff0e0a1f8e701b64636811291d21bff79bf1e7850850a44055224a85f" ], "index": "pypi", - "version": "==4.6.0.20240218" + "version": "==4.6.0.20240311" }, "typing-extensions": { "hashes": [ @@ -575,6 +917,123 @@ "markers": "python_version >= '2'", "version": "==2024.1" }, + "ujson": { + "hashes": [ + "sha256:07e0cfdde5fd91f54cd2d7ffb3482c8ff1bf558abf32a8b953a5d169575ae1cd", + "sha256:0b159efece9ab5c01f70b9d10bbb77241ce111a45bc8d21a44c219a2aec8ddfd", + "sha256:0c4d6adb2c7bb9eb7c71ad6f6f612e13b264942e841f8cc3314a21a289a76c4e", + "sha256:10ca3c41e80509fd9805f7c149068fa8dbee18872bbdc03d7cca928926a358d5", + "sha256:20509a8c9f775b3a511e308bbe0b72897ba6b800767a7c90c5cca59d20d7c42c", + "sha256:25fa46e4ff0a2deecbcf7100af3a5d70090b461906f2299506485ff31d9ec437", + "sha256:2a8ea0f55a1396708e564595aaa6696c0d8af532340f477162ff6927ecc46e21", + "sha256:2fbb90aa5c23cb3d4b803c12aa220d26778c31b6e4b7a13a1f49971f6c7d088e", + "sha256:323279e68c195110ef85cbe5edce885219e3d4a48705448720ad925d88c9f851", + "sha256:32bba5870c8fa2a97f4a68f6401038d3f1922e66c34280d710af00b14a3ca562", + "sha256:3382a3ce0ccc0558b1c1668950008cece9bf463ebb17463ebf6a8bfc060dae34", + "sha256:37ef92e42535a81bf72179d0e252c9af42a4ed966dc6be6967ebfb929a87bc60", + "sha256:3b23bbb46334ce51ddb5dded60c662fbf7bb74a37b8f87221c5b0fec1ec6454b", + "sha256:473fb8dff1d58f49912323d7cb0859df5585cfc932e4b9c053bf8cf7f2d7c5c4", + "sha256:4a566e465cb2fcfdf040c2447b7dd9718799d0d90134b37a20dff1e27c0e9096", + "sha256:4e35d7885ed612feb6b3dd1b7de28e89baaba4011ecdf995e88be9ac614765e9", + "sha256:506a45e5fcbb2d46f1a51fead991c39529fc3737c0f5d47c9b4a1d762578fc30", + "sha256:5635b78b636a54a86fdbf6f027e461aa6c6b948363bdf8d4fbb56a42b7388320", + "sha256:5ca35f484622fd208f55041b042d9d94f3b2c9c5add4e9af5ee9946d2d30db01", + "sha256:60718f1720a61560618eff3b56fd517d107518d3c0160ca7a5a66ac949c6cf1c", + "sha256:63fb2e6599d96fdffdb553af0ed3f76b85fda63281063f1cb5b1141a6fcd0617", + "sha256:6974b3a7c17bbf829e6c3bfdc5823c67922e44ff169851a755eab79a3dd31ec0", + "sha256:6adef377ed583477cf005b58c3025051b5faa6b8cc25876e594afbb772578f21", + "sha256:6bbd91a151a8f3358c29355a491e915eb203f607267a25e6ab10531b3b157c5e", + "sha256:6eecbd09b316cea1fd929b1e25f70382917542ab11b692cb46ec9b0a26c7427f", + "sha256:70e06849dfeb2548be48fdd3ceb53300640bc8100c379d6e19d78045e9c26120", + "sha256:7309d063cd392811acc49b5016728a5e1b46ab9907d321ebbe1c2156bc3c0b99", + "sha256:779a2a88c53039bebfbccca934430dabb5c62cc179e09a9c27a322023f363e0d", + "sha256:7a365eac66f5aa7a7fdf57e5066ada6226700884fc7dce2ba5483538bc16c8c5", + "sha256:7b1c0991c4fe256f5fdb19758f7eac7f47caac29a6c57d0de16a19048eb86bad", + "sha256:7cc7e605d2aa6ae6b7321c3ae250d2e050f06082e71ab1a4200b4ae64d25863c", + "sha256:829a69d451a49c0de14a9fecb2a2d544a9b2c884c2b542adb243b683a6f15908", + "sha256:829b824953ebad76d46e4ae709e940bb229e8999e40881338b3cc94c771b876c", + "sha256:82b5a56609f1235d72835ee109163c7041b30920d70fe7dac9176c64df87c164", + "sha256:89cc92e73d5501b8a7f48575eeb14ad27156ad092c2e9fc7e3cf949f07e75532", + "sha256:8ba7cac47dd65ff88571eceeff48bf30ed5eb9c67b34b88cb22869b7aa19600d", + "sha256:8fc2aa18b13d97b3c8ccecdf1a3c405f411a6e96adeee94233058c44ff92617d", + "sha256:9ac92d86ff34296f881e12aa955f7014d276895e0e4e868ba7fddebbde38e378", + "sha256:9d302bd17989b6bd90d49bade66943c78f9e3670407dbc53ebcf61271cadc399", + "sha256:9f21315f51e0db8ee245e33a649dd2d9dce0594522de6f278d62f15f998e050e", + "sha256:a6d3f10eb8ccba4316a6b5465b705ed70a06011c6f82418b59278fbc919bef6f", + "sha256:a807ae73c46ad5db161a7e883eec0fbe1bebc6a54890152ccc63072c4884823b", + "sha256:ab71bf27b002eaf7d047c54a68e60230fbd5cd9da60de7ca0aa87d0bccead8fa", + "sha256:b048aa93eace8571eedbd67b3766623e7f0acbf08ee291bef7d8106210432427", + "sha256:b28407cfe315bd1b34f1ebe65d3bd735d6b36d409b334100be8cdffae2177b2f", + "sha256:b5964ea916edfe24af1f4cc68488448fbb1ec27a3ddcddc2b236da575c12c8ae", + "sha256:b68a0caab33f359b4cbbc10065c88e3758c9f73a11a65a91f024b2e7a1257106", + "sha256:ba0823cb70866f0d6a4ad48d998dd338dce7314598721bc1b7986d054d782dfd", + "sha256:bd4ea86c2afd41429751d22a3ccd03311c067bd6aeee2d054f83f97e41e11d8f", + "sha256:bdf7fc21a03bafe4ba208dafa84ae38e04e5d36c0e1c746726edf5392e9f9f36", + "sha256:c4eec2ddc046360d087cf35659c7ba0cbd101f32035e19047013162274e71fcf", + "sha256:cdcb02cabcb1e44381221840a7af04433c1dc3297af76fde924a50c3054c708c", + "sha256:d0fd2eba664a22447102062814bd13e63c6130540222c0aa620701dd01f4be81", + "sha256:d581db9db9e41d8ea0b2705c90518ba623cbdc74f8d644d7eb0d107be0d85d9c", + "sha256:dc80f0f5abf33bd7099f7ac94ab1206730a3c0a2d17549911ed2cb6b7aa36d2d", + "sha256:e015122b337858dba5a3dc3533af2a8fc0410ee9e2374092f6a5b88b182e9fcc", + "sha256:e208d3bf02c6963e6ef7324dadf1d73239fb7008491fdf523208f60be6437402", + "sha256:e2f909bc08ce01f122fd9c24bc6f9876aa087188dfaf3c4116fe6e4daf7e194f", + "sha256:f0cb4a7814940ddd6619bdce6be637a4b37a8c4760de9373bac54bb7b229698b", + "sha256:f4b3917296630a075e04d3d07601ce2a176479c23af838b6cf90a2d6b39b0d95", + "sha256:f69f16b8f1c69da00e38dc5f2d08a86b0e781d0ad3e4cc6a13ea033a439c4844", + "sha256:f833c529e922577226a05bc25b6a8b3eb6c4fb155b72dd88d33de99d53113124", + "sha256:f91719c6abafe429c1a144cfe27883eace9fb1c09a9c5ef1bcb3ae80a3076a4e", + "sha256:ff741a5b4be2d08fceaab681c9d4bc89abf3c9db600ab435e20b9b6d4dfef12e", + "sha256:ffdfebd819f492e48e4f31c97cb593b9c1a8251933d8f8972e81697f00326ff1" + ], + "version": "==5.9.0" + }, + "uvicorn": { + "extras": [ + "standard" + ], + "hashes": [ + "sha256:2c2aac7ff4f4365c206fd773a39bf4ebd1047c238f8b8268ad996829323473de", + "sha256:6a69214c0b6a087462412670b3ef21224fa48cae0e452b5883e8e8bdfdd11dd0" + ], + "index": "pypi", + "version": "==0.29.0" + }, + "uvloop": { + "hashes": [ + "sha256:0246f4fd1bf2bf702e06b0d45ee91677ee5c31242f39aab4ea6fe0c51aedd0fd", + "sha256:02506dc23a5d90e04d4f65c7791e65cf44bd91b37f24cfc3ef6cf2aff05dc7ec", + "sha256:13dfdf492af0aa0a0edf66807d2b465607d11c4fa48f4a1fd41cbea5b18e8e8b", + "sha256:2693049be9d36fef81741fddb3f441673ba12a34a704e7b4361efb75cf30befc", + "sha256:271718e26b3e17906b28b67314c45d19106112067205119dddbd834c2b7ce797", + "sha256:2df95fca285a9f5bfe730e51945ffe2fa71ccbfdde3b0da5772b4ee4f2e770d5", + "sha256:31e672bb38b45abc4f26e273be83b72a0d28d074d5b370fc4dcf4c4eb15417d2", + "sha256:34175c9fd2a4bc3adc1380e1261f60306344e3407c20a4d684fd5f3be010fa3d", + "sha256:45bf4c24c19fb8a50902ae37c5de50da81de4922af65baf760f7c0c42e1088be", + "sha256:472d61143059c84947aa8bb74eabbace30d577a03a1805b77933d6bd13ddebbd", + "sha256:47bf3e9312f63684efe283f7342afb414eea4d3011542155c7e625cd799c3b12", + "sha256:492e2c32c2af3f971473bc22f086513cedfc66a130756145a931a90c3958cb17", + "sha256:4ce6b0af8f2729a02a5d1575feacb2a94fc7b2e983868b009d51c9a9d2149bef", + "sha256:5138821e40b0c3e6c9478643b4660bd44372ae1e16a322b8fc07478f92684e24", + "sha256:5588bd21cf1fcf06bded085f37e43ce0e00424197e7c10e77afd4bbefffef428", + "sha256:570fc0ed613883d8d30ee40397b79207eedd2624891692471808a95069a007c1", + "sha256:5a05128d315e2912791de6088c34136bfcdd0c7cbc1cf85fd6fd1bb321b7c849", + "sha256:5daa304d2161d2918fa9a17d5635099a2f78ae5b5960e742b2fcfbb7aefaa593", + "sha256:5f17766fb6da94135526273080f3455a112f82570b2ee5daa64d682387fe0dcd", + "sha256:6e3d4e85ac060e2342ff85e90d0c04157acb210b9ce508e784a944f852a40e67", + "sha256:7010271303961c6f0fe37731004335401eb9075a12680738731e9c92ddd96ad6", + "sha256:7207272c9520203fea9b93843bb775d03e1cf88a80a936ce760f60bb5add92f3", + "sha256:78ab247f0b5671cc887c31d33f9b3abfb88d2614b84e4303f1a63b46c046c8bd", + "sha256:7b1fd71c3843327f3bbc3237bedcdb6504fd50368ab3e04d0410e52ec293f5b8", + "sha256:8ca4956c9ab567d87d59d49fa3704cf29e37109ad348f2d5223c9bf761a332e7", + "sha256:91ab01c6cd00e39cde50173ba4ec68a1e578fee9279ba64f5221810a9e786533", + "sha256:cd81bdc2b8219cb4b2556eea39d2e36bfa375a2dd021404f90a62e44efaaf957", + "sha256:da8435a3bd498419ee8c13c34b89b5005130a476bda1d6ca8cfdde3de35cd650", + "sha256:de4313d7f575474c8f5a12e163f6d89c0a878bc49219641d49e6f1444369a90e", + "sha256:e27f100e1ff17f6feeb1f33968bc185bf8ce41ca557deee9d9bbbffeb72030b7", + "sha256:f467a5fd23b4fc43ed86342641f3936a68ded707f4627622fa3f82a120e18256" + ], + "version": "==0.19.0" + }, "vine": { "hashes": [ "sha256:40fdf3c48b2cfe1c38a49e9ae2da6fda88e4794c810050a728bd7413811fb1dc", @@ -583,12 +1042,169 @@ "markers": "python_version >= '3.6'", "version": "==5.1.0" }, + "watchfiles": { + "hashes": [ + "sha256:02b73130687bc3f6bb79d8a170959042eb56eb3a42df3671c79b428cd73f17cc", + "sha256:02d91cbac553a3ad141db016e3350b03184deaafeba09b9d6439826ee594b365", + "sha256:06247538e8253975bdb328e7683f8515ff5ff041f43be6c40bff62d989b7d0b0", + "sha256:08dca260e85ffae975448e344834d765983237ad6dc308231aa16e7933db763e", + "sha256:0d9ac347653ebd95839a7c607608703b20bc07e577e870d824fa4801bc1cb124", + "sha256:0dd5fad9b9c0dd89904bbdea978ce89a2b692a7ee8a0ce19b940e538c88a809c", + "sha256:11cd0c3100e2233e9c53106265da31d574355c288e15259c0d40a4405cbae317", + "sha256:18722b50783b5e30a18a8a5db3006bab146d2b705c92eb9a94f78c72beb94094", + "sha256:18d5b4da8cf3e41895b34e8c37d13c9ed294954907929aacd95153508d5d89d7", + "sha256:1ad7247d79f9f55bb25ab1778fd47f32d70cf36053941f07de0b7c4e96b5d235", + "sha256:1b8d1eae0f65441963d805f766c7e9cd092f91e0c600c820c764a4ff71a0764c", + "sha256:1bd467213195e76f838caf2c28cd65e58302d0254e636e7c0fca81efa4a2e62c", + "sha256:1c9198c989f47898b2c22201756f73249de3748e0fc9de44adaf54a8b259cc0c", + "sha256:1fd9a5205139f3c6bb60d11f6072e0552f0a20b712c85f43d42342d162be1235", + "sha256:214cee7f9e09150d4fb42e24919a1e74d8c9b8a9306ed1474ecaddcd5479c293", + "sha256:27b4035013f1ea49c6c0b42d983133b136637a527e48c132d368eb19bf1ac6aa", + "sha256:3a23092a992e61c3a6a70f350a56db7197242f3490da9c87b500f389b2d01eef", + "sha256:3ad692bc7792be8c32918c699638b660c0de078a6cbe464c46e1340dadb94c19", + "sha256:3ccceb50c611c433145502735e0370877cced72a6c70fd2410238bcbc7fe51d8", + "sha256:3d0f32ebfaa9c6011f8454994f86108c2eb9c79b8b7de00b36d558cadcedaa3d", + "sha256:3f92944efc564867bbf841c823c8b71bb0be75e06b8ce45c084b46411475a915", + "sha256:40bca549fdc929b470dd1dbfcb47b3295cb46a6d2c90e50588b0a1b3bd98f429", + "sha256:43babacef21c519bc6631c5fce2a61eccdfc011b4bcb9047255e9620732c8097", + "sha256:4566006aa44cb0d21b8ab53baf4b9c667a0ed23efe4aaad8c227bfba0bf15cbe", + "sha256:49f56e6ecc2503e7dbe233fa328b2be1a7797d31548e7a193237dcdf1ad0eee0", + "sha256:4c48a10d17571d1275701e14a601e36959ffada3add8cdbc9e5061a6e3579a5d", + "sha256:4ea10a29aa5de67de02256a28d1bf53d21322295cb00bd2d57fcd19b850ebd99", + "sha256:511f0b034120cd1989932bf1e9081aa9fb00f1f949fbd2d9cab6264916ae89b1", + "sha256:51ddac60b96a42c15d24fbdc7a4bfcd02b5a29c047b7f8bf63d3f6f5a860949a", + "sha256:57d430f5fb63fea141ab71ca9c064e80de3a20b427ca2febcbfcef70ff0ce895", + "sha256:59137c0c6826bd56c710d1d2bda81553b5e6b7c84d5a676747d80caf0409ad94", + "sha256:5a03651352fc20975ee2a707cd2d74a386cd303cc688f407296064ad1e6d1562", + "sha256:5eb86c6acb498208e7663ca22dbe68ca2cf42ab5bf1c776670a50919a56e64ab", + "sha256:642d66b75eda909fd1112d35c53816d59789a4b38c141a96d62f50a3ef9b3360", + "sha256:6674b00b9756b0af620aa2a3346b01f8e2a3dc729d25617e1b89cf6af4a54eb1", + "sha256:668c265d90de8ae914f860d3eeb164534ba2e836811f91fecc7050416ee70aa7", + "sha256:66fac0c238ab9a2e72d026b5fb91cb902c146202bbd29a9a1a44e8db7b710b6f", + "sha256:6c107ea3cf2bd07199d66f156e3ea756d1b84dfd43b542b2d870b77868c98c03", + "sha256:6c889025f59884423428c261f212e04d438de865beda0b1e1babab85ef4c0f01", + "sha256:6cb8fdc044909e2078c248986f2fc76f911f72b51ea4a4fbbf472e01d14faa58", + "sha256:6e9be3ef84e2bb9710f3f777accce25556f4a71e15d2b73223788d528fcc2052", + "sha256:7f762a1a85a12cc3484f77eee7be87b10f8c50b0b787bb02f4e357403cad0c0e", + "sha256:83a696da8922314ff2aec02987eefb03784f473281d740bf9170181829133765", + "sha256:853853cbf7bf9408b404754b92512ebe3e3a83587503d766d23e6bf83d092ee6", + "sha256:8ad3fe0a3567c2f0f629d800409cd528cb6251da12e81a1f765e5c5345fd0137", + "sha256:8c6ed10c2497e5fedadf61e465b3ca12a19f96004c15dcffe4bd442ebadc2d85", + "sha256:8d5f400326840934e3507701f9f7269247f7c026d1b6cfd49477d2be0933cfca", + "sha256:927c589500f9f41e370b0125c12ac9e7d3a2fd166b89e9ee2828b3dda20bfe6f", + "sha256:9a0aa47f94ea9a0b39dd30850b0adf2e1cd32a8b4f9c7aa443d852aacf9ca214", + "sha256:9b37a7ba223b2f26122c148bb8d09a9ff312afca998c48c725ff5a0a632145f7", + "sha256:9c873345680c1b87f1e09e0eaf8cf6c891b9851d8b4d3645e7efe2ec20a20cc7", + "sha256:9d09869f2c5a6f2d9df50ce3064b3391d3ecb6dced708ad64467b9e4f2c9bef3", + "sha256:9d353c4cfda586db2a176ce42c88f2fc31ec25e50212650c89fdd0f560ee507b", + "sha256:a1e3014a625bcf107fbf38eece0e47fa0190e52e45dc6eee5a8265ddc6dc5ea7", + "sha256:a3b9bec9579a15fb3ca2d9878deae789df72f2b0fdaf90ad49ee389cad5edab6", + "sha256:ab03a90b305d2588e8352168e8c5a1520b721d2d367f31e9332c4235b30b8994", + "sha256:aff06b2cac3ef4616e26ba17a9c250c1fe9dd8a5d907d0193f84c499b1b6e6a9", + "sha256:b3cab0e06143768499384a8a5efb9c4dc53e19382952859e4802f294214f36ec", + "sha256:b4a21f71885aa2744719459951819e7bf5a906a6448a6b2bbce8e9cc9f2c8128", + "sha256:b6d45d9b699ecbac6c7bd8e0a2609767491540403610962968d258fd6405c17c", + "sha256:be6dd5d52b73018b21adc1c5d28ac0c68184a64769052dfeb0c5d9998e7f56a2", + "sha256:c550a56bf209a3d987d5a975cdf2063b3389a5d16caf29db4bdddeae49f22078", + "sha256:c76c635fabf542bb78524905718c39f736a98e5ab25b23ec6d4abede1a85a6a3", + "sha256:c81818595eff6e92535ff32825f31c116f867f64ff8cdf6562cd1d6b2e1e8f3e", + "sha256:cfb92d49dbb95ec7a07511bc9efb0faff8fe24ef3805662b8d6808ba8409a71a", + "sha256:d23bcd6c8eaa6324fe109d8cac01b41fe9a54b8c498af9ce464c1aeeb99903d6", + "sha256:d5b1dc0e708fad9f92c296ab2f948af403bf201db8fb2eb4c8179db143732e49", + "sha256:d78f30cbe8b2ce770160d3c08cff01b2ae9306fe66ce899b73f0409dc1846c1b", + "sha256:d8f57c4461cd24fda22493109c45b3980863c58a25b8bec885ca8bea6b8d4b28", + "sha256:d9792dff410f266051025ecfaa927078b94cc7478954b06796a9756ccc7e14a9", + "sha256:e7941bbcfdded9c26b0bf720cb7e6fd803d95a55d2c14b4bd1f6a2772230c586", + "sha256:ebe684d7d26239e23d102a2bad2a358dedf18e462e8808778703427d1f584400", + "sha256:ec8c8900dc5c83650a63dd48c4d1d245343f904c4b64b48798c67a3767d7e165", + "sha256:f564bf68404144ea6b87a78a3f910cc8de216c6b12a4cf0b27718bf4ec38d303", + "sha256:fd7ac678b92b29ba630d8c842d8ad6c555abda1b9ef044d6cc092dacbfc9719d" + ], + "version": "==0.21.0" + }, "wcwidth": { "hashes": [ "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859", "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5" ], "version": "==0.2.13" + }, + "websockets": { + "hashes": [ + "sha256:00700340c6c7ab788f176d118775202aadea7602c5cc6be6ae127761c16d6b0b", + "sha256:0bee75f400895aef54157b36ed6d3b308fcab62e5260703add87f44cee9c82a6", + "sha256:0e6e2711d5a8e6e482cacb927a49a3d432345dfe7dea8ace7b5790df5932e4df", + "sha256:12743ab88ab2af1d17dd4acb4645677cb7063ef4db93abffbf164218a5d54c6b", + "sha256:1a9d160fd080c6285e202327aba140fc9a0d910b09e423afff4ae5cbbf1c7205", + "sha256:1bf386089178ea69d720f8db6199a0504a406209a0fc23e603b27b300fdd6892", + "sha256:1df2fbd2c8a98d38a66f5238484405b8d1d16f929bb7a33ed73e4801222a6f53", + "sha256:1e4b3f8ea6a9cfa8be8484c9221ec0257508e3a1ec43c36acdefb2a9c3b00aa2", + "sha256:1f38a7b376117ef7aff996e737583172bdf535932c9ca021746573bce40165ed", + "sha256:23509452b3bc38e3a057382c2e941d5ac2e01e251acce7adc74011d7d8de434c", + "sha256:248d8e2446e13c1d4326e0a6a4e9629cb13a11195051a73acf414812700badbd", + "sha256:25eb766c8ad27da0f79420b2af4b85d29914ba0edf69f547cc4f06ca6f1d403b", + "sha256:27a5e9964ef509016759f2ef3f2c1e13f403725a5e6a1775555994966a66e931", + "sha256:2c71bd45a777433dd9113847af751aae36e448bc6b8c361a566cb043eda6ec30", + "sha256:2cb388a5bfb56df4d9a406783b7f9dbefb888c09b71629351cc6b036e9259370", + "sha256:2d225bb6886591b1746b17c0573e29804619c8f755b5598d875bb4235ea639be", + "sha256:2e5fc14ec6ea568200ea4ef46545073da81900a2b67b3e666f04adf53ad452ec", + "sha256:363f57ca8bc8576195d0540c648aa58ac18cf85b76ad5202b9f976918f4219cf", + "sha256:3c6cc1360c10c17463aadd29dd3af332d4a1adaa8796f6b0e9f9df1fdb0bad62", + "sha256:3d829f975fc2e527a3ef2f9c8f25e553eb7bc779c6665e8e1d52aa22800bb38b", + "sha256:3e3aa8c468af01d70332a382350ee95f6986db479ce7af14d5e81ec52aa2b402", + "sha256:3f61726cae9f65b872502ff3c1496abc93ffbe31b278455c418492016e2afc8f", + "sha256:423fc1ed29f7512fceb727e2d2aecb952c46aa34895e9ed96071821309951123", + "sha256:46e71dbbd12850224243f5d2aeec90f0aaa0f2dde5aeeb8fc8df21e04d99eff9", + "sha256:4d87be612cbef86f994178d5186add3d94e9f31cc3cb499a0482b866ec477603", + "sha256:5693ef74233122f8ebab026817b1b37fe25c411ecfca084b29bc7d6efc548f45", + "sha256:5aa9348186d79a5f232115ed3fa9020eab66d6c3437d72f9d2c8ac0c6858c558", + "sha256:5d873c7de42dea355d73f170be0f23788cf3fa9f7bed718fd2830eefedce01b4", + "sha256:5f6ffe2c6598f7f7207eef9a1228b6f5c818f9f4d53ee920aacd35cec8110438", + "sha256:604428d1b87edbf02b233e2c207d7d528460fa978f9e391bd8aaf9c8311de137", + "sha256:6350b14a40c95ddd53e775dbdbbbc59b124a5c8ecd6fbb09c2e52029f7a9f480", + "sha256:6e2df67b8014767d0f785baa98393725739287684b9f8d8a1001eb2839031447", + "sha256:6e96f5ed1b83a8ddb07909b45bd94833b0710f738115751cdaa9da1fb0cb66e8", + "sha256:6e9e7db18b4539a29cc5ad8c8b252738a30e2b13f033c2d6e9d0549b45841c04", + "sha256:70ec754cc2a769bcd218ed8d7209055667b30860ffecb8633a834dde27d6307c", + "sha256:7b645f491f3c48d3f8a00d1fce07445fab7347fec54a3e65f0725d730d5b99cb", + "sha256:7fa3d25e81bfe6a89718e9791128398a50dec6d57faf23770787ff441d851967", + "sha256:81df9cbcbb6c260de1e007e58c011bfebe2dafc8435107b0537f393dd38c8b1b", + "sha256:8572132c7be52632201a35f5e08348137f658e5ffd21f51f94572ca6c05ea81d", + "sha256:87b4aafed34653e465eb77b7c93ef058516cb5acf3eb21e42f33928616172def", + "sha256:8e332c210b14b57904869ca9f9bf4ca32f5427a03eeb625da9b616c85a3a506c", + "sha256:9893d1aa45a7f8b3bc4510f6ccf8db8c3b62120917af15e3de247f0780294b92", + "sha256:9edf3fc590cc2ec20dc9d7a45108b5bbaf21c0d89f9fd3fd1685e223771dc0b2", + "sha256:9fdf06fd06c32205a07e47328ab49c40fc1407cdec801d698a7c41167ea45113", + "sha256:a02413bc474feda2849c59ed2dfb2cddb4cd3d2f03a2fedec51d6e959d9b608b", + "sha256:a1d9697f3337a89691e3bd8dc56dea45a6f6d975f92e7d5f773bc715c15dde28", + "sha256:a571f035a47212288e3b3519944f6bf4ac7bc7553243e41eac50dd48552b6df7", + "sha256:ab3d732ad50a4fbd04a4490ef08acd0517b6ae6b77eb967251f4c263011a990d", + "sha256:ae0a5da8f35a5be197f328d4727dbcfafa53d1824fac3d96cdd3a642fe09394f", + "sha256:b067cb952ce8bf40115f6c19f478dc71c5e719b7fbaa511359795dfd9d1a6468", + "sha256:b2ee7288b85959797970114deae81ab41b731f19ebcd3bd499ae9ca0e3f1d2c8", + "sha256:b81f90dcc6c85a9b7f29873beb56c94c85d6f0dac2ea8b60d995bd18bf3e2aae", + "sha256:ba0cab91b3956dfa9f512147860783a1829a8d905ee218a9837c18f683239611", + "sha256:baa386875b70cbd81798fa9f71be689c1bf484f65fd6fb08d051a0ee4e79924d", + "sha256:bbe6013f9f791944ed31ca08b077e26249309639313fff132bfbf3ba105673b9", + "sha256:bea88d71630c5900690fcb03161ab18f8f244805c59e2e0dc4ffadae0a7ee0ca", + "sha256:befe90632d66caaf72e8b2ed4d7f02b348913813c8b0a32fae1cc5fe3730902f", + "sha256:c3181df4583c4d3994d31fb235dc681d2aaad744fbdbf94c4802485ececdecf2", + "sha256:c4e37d36f0d19f0a4413d3e18c0d03d0c268ada2061868c1e6f5ab1a6d575077", + "sha256:c588f6abc13f78a67044c6b1273a99e1cf31038ad51815b3b016ce699f0d75c2", + "sha256:cbe83a6bbdf207ff0541de01e11904827540aa069293696dd528a6640bd6a5f6", + "sha256:d554236b2a2006e0ce16315c16eaa0d628dab009c33b63ea03f41c6107958374", + "sha256:dbcf72a37f0b3316e993e13ecf32f10c0e1259c28ffd0a85cee26e8549595fbc", + "sha256:dc284bbc8d7c78a6c69e0c7325ab46ee5e40bb4d50e494d8131a07ef47500e9e", + "sha256:dff6cdf35e31d1315790149fee351f9e52978130cef6c87c4b6c9b3baf78bc53", + "sha256:e469d01137942849cff40517c97a30a93ae79917752b34029f0ec72df6b46399", + "sha256:eb809e816916a3b210bed3c82fb88eaf16e8afcf9c115ebb2bacede1797d2547", + "sha256:ed2fcf7a07334c77fc8a230755c2209223a7cc44fc27597729b8ef5425aa61a3", + "sha256:f44069528d45a933997a6fef143030d8ca8042f0dfaad753e2906398290e2870", + "sha256:f764ba54e33daf20e167915edc443b6f88956f37fb606449b4a5b10ba42235a5", + "sha256:fc4e7fa5414512b481a2483775a8e8be7803a35b30ca805afa4998a84f9fd9e8", + "sha256:ffefa1374cd508d633646d51a8e9277763a9b78ae71324183693959cf94635a7" + ], + "version": "==12.0" } }, "develop": { @@ -610,31 +1226,31 @@ }, "black": { "hashes": [ - "sha256:057c3dc602eaa6fdc451069bd027a1b2635028b575a6c3acfd63193ced20d9c8", - "sha256:08654d0797e65f2423f850fc8e16a0ce50925f9337fb4a4a176a7aa4026e63f8", - "sha256:163baf4ef40e6897a2a9b83890e59141cc8c2a98f2dda5080dc15c00ee1e62cd", - "sha256:1e08fb9a15c914b81dd734ddd7fb10513016e5ce7e6704bdd5e1251ceee51ac9", - "sha256:4dd76e9468d5536abd40ffbc7a247f83b2324f0c050556d9c371c2b9a9a95e31", - "sha256:4f9de21bafcba9683853f6c96c2d515e364aee631b178eaa5145fc1c61a3cc92", - "sha256:61a0391772490ddfb8a693c067df1ef5227257e72b0e4108482b8d41b5aee13f", - "sha256:6981eae48b3b33399c8757036c7f5d48a535b962a7c2310d19361edeef64ce29", - "sha256:7e53a8c630f71db01b28cd9602a1ada68c937cbf2c333e6ed041390d6968faf4", - "sha256:810d445ae6069ce64030c78ff6127cd9cd178a9ac3361435708b907d8a04c693", - "sha256:93601c2deb321b4bad8f95df408e3fb3943d85012dddb6121336b8e24a0d1218", - "sha256:992e451b04667116680cb88f63449267c13e1ad134f30087dec8527242e9862a", - "sha256:9db528bccb9e8e20c08e716b3b09c6bdd64da0dd129b11e160bf082d4642ac23", - "sha256:a0057f800de6acc4407fe75bb147b0c2b5cbb7c3ed110d3e5999cd01184d53b0", - "sha256:ba15742a13de85e9b8f3239c8f807723991fbfae24bad92d34a2b12e81904982", - "sha256:bce4f25c27c3435e4dace4815bcb2008b87e167e3bf4ee47ccdc5ce906eb4894", - "sha256:ca610d29415ee1a30a3f30fab7a8f4144e9d34c89a235d81292a1edb2b55f540", - "sha256:d533d5e3259720fdbc1b37444491b024003e012c5173f7d06825a77508085430", - "sha256:d84f29eb3ee44859052073b7636533ec995bd0f64e2fb43aeceefc70090e752b", - "sha256:e37c99f89929af50ffaf912454b3e3b47fd64109659026b678c091a4cd450fb2", - "sha256:e8a6ae970537e67830776488bca52000eaa37fa63b9988e8c487458d9cd5ace6", - "sha256:faf2ee02e6612577ba0181f4347bcbcf591eb122f7841ae5ba233d12c39dcb4d" + "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f", + "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93", + "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11", + "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0", + "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9", + "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5", + "sha256:65b76c275e4c1c5ce6e9870911384bff5ca31ab63d19c76811cb1fb162678213", + "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d", + "sha256:6905238a754ceb7788a73f02b45637d820b2f5478b20fec82ea865e4f5d4d9f7", + "sha256:79dcf34b33e38ed1b17434693763301d7ccbd1c5860674a8f871bd15139e7837", + "sha256:7bb041dca0d784697af4646d3b62ba4a6b028276ae878e53f6b4f74ddd6db99f", + "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395", + "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995", + "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f", + "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597", + "sha256:b5991d523eee14756f3c8d5df5231550ae8993e2286b8014e2fdea7156ed0959", + "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5", + "sha256:c45f8dff244b3c431b36e3224b6be4a127c6aca780853574c00faf99258041eb", + "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4", + "sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7", + "sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd", + "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7" ], "index": "pypi", - "version": "==24.2.0" + "version": "==24.3.0" }, "click": { "hashes": [ @@ -670,36 +1286,36 @@ }, "mypy": { "hashes": [ - "sha256:028cf9f2cae89e202d7b6593cd98db6759379f17a319b5faf4f9978d7084cdc6", - "sha256:2afecd6354bbfb6e0160f4e4ad9ba6e4e003b767dd80d85516e71f2e955ab50d", - "sha256:2b5b6c721bd4aabaadead3a5e6fa85c11c6c795e0c81a7215776ef8afc66de02", - "sha256:42419861b43e6962a649068a61f4a4839205a3ef525b858377a960b9e2de6e0d", - "sha256:42c6680d256ab35637ef88891c6bd02514ccb7e1122133ac96055ff458f93fc3", - "sha256:485a8942f671120f76afffff70f259e1cd0f0cfe08f81c05d8816d958d4577d3", - "sha256:4c886c6cce2d070bd7df4ec4a05a13ee20c0aa60cb587e8d1265b6c03cf91da3", - "sha256:4e6d97288757e1ddba10dd9549ac27982e3e74a49d8d0179fc14d4365c7add66", - "sha256:4ef4be7baf08a203170f29e89d79064463b7fc7a0908b9d0d5114e8009c3a259", - "sha256:51720c776d148bad2372ca21ca29256ed483aa9a4cdefefcef49006dff2a6835", - "sha256:52825b01f5c4c1c4eb0db253ec09c7aa17e1a7304d247c48b6f3599ef40db8bd", - "sha256:538fd81bb5e430cc1381a443971c0475582ff9f434c16cd46d2c66763ce85d9d", - "sha256:5c1538c38584029352878a0466f03a8ee7547d7bd9f641f57a0f3017a7c905b8", - "sha256:6ff8b244d7085a0b425b56d327b480c3b29cafbd2eff27316a004f9a7391ae07", - "sha256:7178def594014aa6c35a8ff411cf37d682f428b3b5617ca79029d8ae72f5402b", - "sha256:720a5ca70e136b675af3af63db533c1c8c9181314d207568bbe79051f122669e", - "sha256:7f1478736fcebb90f97e40aff11a5f253af890c845ee0c850fe80aa060a267c6", - "sha256:855fe27b80375e5c5878492f0729540db47b186509c98dae341254c8f45f42ae", - "sha256:8963b83d53ee733a6e4196954502b33567ad07dfd74851f32be18eb932fb1cb9", - "sha256:9261ed810972061388918c83c3f5cd46079d875026ba97380f3e3978a72f503d", - "sha256:99b00bc72855812a60d253420d8a2eae839b0afa4938f09f4d2aa9bb4654263a", - "sha256:ab3c84fa13c04aeeeabb2a7f67a25ef5d77ac9d6486ff33ded762ef353aa5592", - "sha256:afe3fe972c645b4632c563d3f3eff1cdca2fa058f730df2b93a35e3b0c538218", - "sha256:d19c413b3c07cbecf1f991e2221746b0d2a9410b59cb3f4fb9557f0365a1a817", - "sha256:df9824ac11deaf007443e7ed2a4a26bebff98d2bc43c6da21b2b64185da011c4", - "sha256:e46f44b54ebddbeedbd3d5b289a893219065ef805d95094d16a0af6630f5d410", - "sha256:f5ac9a4eeb1ec0f1ccdc6f326bcdb464de5f80eb07fb38b5ddd7b0de6bc61e55" + "sha256:0235391f1c6f6ce487b23b9dbd1327b4ec33bb93934aa986efe8a9563d9349e6", + "sha256:190da1ee69b427d7efa8aa0d5e5ccd67a4fb04038c380237a0d96829cb157913", + "sha256:2418488264eb41f69cc64a69a745fad4a8f86649af4b1041a4c64ee61fc61129", + "sha256:3a3c007ff3ee90f69cf0a15cbcdf0995749569b86b6d2f327af01fd1b8aee9dc", + "sha256:3cc5da0127e6a478cddd906068496a97a7618a21ce9b54bde5bf7e539c7af974", + "sha256:48533cdd345c3c2e5ef48ba3b0d3880b257b423e7995dada04248725c6f77374", + "sha256:49c87c15aed320de9b438ae7b00c1ac91cd393c1b854c2ce538e2a72d55df150", + "sha256:4d3dbd346cfec7cb98e6cbb6e0f3c23618af826316188d587d1c1bc34f0ede03", + "sha256:571741dc4194b4f82d344b15e8837e8c5fcc462d66d076748142327626a1b6e9", + "sha256:587ce887f75dd9700252a3abbc9c97bbe165a4a630597845c61279cf32dfbf02", + "sha256:5d741d3fc7c4da608764073089e5f58ef6352bedc223ff58f2f038c2c4698a89", + "sha256:5e6061f44f2313b94f920e91b204ec600982961e07a17e0f6cd83371cb23f5c2", + "sha256:61758fabd58ce4b0720ae1e2fea5cfd4431591d6d590b197775329264f86311d", + "sha256:653265f9a2784db65bfca694d1edd23093ce49740b2244cde583aeb134c008f3", + "sha256:68edad3dc7d70f2f17ae4c6c1b9471a56138ca22722487eebacfd1eb5321d612", + "sha256:81a10926e5473c5fc3da8abb04119a1f5811a236dc3a38d92015cb1e6ba4cb9e", + "sha256:85ca5fcc24f0b4aeedc1d02f93707bccc04733f21d41c88334c5482219b1ccb3", + "sha256:a260627a570559181a9ea5de61ac6297aa5af202f06fd7ab093ce74e7181e43e", + "sha256:aceb1db093b04db5cd390821464504111b8ec3e351eb85afd1433490163d60cd", + "sha256:b685154e22e4e9199fc95f298661deea28aaede5ae16ccc8cbb1045e716b3e04", + "sha256:d357423fa57a489e8c47b7c85dfb96698caba13d66e086b412298a1a0ea3b0ed", + "sha256:d4d5ddc13421ba3e2e082a6c2d74c2ddb3979c39b582dacd53dd5d9431237185", + "sha256:e49499be624dead83927e70c756970a0bc8240e9f769389cdf5714b0784ca6bf", + "sha256:e54396d70be04b34f31d2edf3362c1edd023246c82f1730bbf8768c28db5361b", + "sha256:f88566144752999351725ac623471661c9d1cd8caa0134ff98cceeea181789f4", + "sha256:f8a67616990062232ee4c3952f41c779afac41405806042a8126fe96e098419f", + "sha256:fe28657de3bfec596bbeef01cb219833ad9d38dd5393fc649f4b366840baefe6" ], "index": "pypi", - "version": "==1.8.0" + "version": "==1.9.0" }, "mypy-extensions": { "hashes": [ @@ -711,11 +1327,11 @@ }, "packaging": { "hashes": [ - "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", - "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7" + "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", + "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9" ], "markers": "python_version >= '3.7'", - "version": "==23.2" + "version": "==24.0" }, "pathspec": { "hashes": [ @@ -735,11 +1351,11 @@ }, "pydantic": { "hashes": [ - "sha256:72c6034df47f46ccdf81869fddb81aade68056003900a8724a4f160700016a2a", - "sha256:e07805c4c7f5c6826e33a1d4c9d47950d7eaf34868e2690f8594d2e30241f11f" + "sha256:b1704e0847db01817624a6b86766967f552dd9dbf3afba4004409f908dcc84e6", + "sha256:cc46fce86607580867bdc3361ad462bab9c222ef042d3da86f2fb333e1d916c5" ], "index": "pypi", - "version": "==2.6.3" + "version": "==2.6.4" }, "pydantic-core": { "hashes": [ diff --git a/README.md b/README.md index fd0d476..e7ef2b7 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,6 @@ ### Project - [Project: `pyproject.toml`](https://lucas-six.github.io/python-cookbook/cookbook/build/project) -- [FastAPI Project](https://lucas-six.github.io/python-cookbook/cookbook/build/project_fastapi) - `black` - `isort` - `mypy` @@ -193,11 +192,10 @@ - [Cache - Redis](https://lucas-six.github.io/python-cookbook/cookbook/web/django_cache_redis) - [Logging](https://lucas-six.github.io/python-cookbook/cookbook/web/django_logging) - [`Flask`](https://flask.palletsprojects.com/): tiny -- [**`FastAPI`**](https://fastapi.tiangolo.com/) - - [**`Starlette`**](https://www.starlette.io/): *ASGI* - - [**`Pydantic`**](https://pydantic-docs.helpmanual.io/): data validation - - [*`Swagger`*](https://swagger.io/): *OpenAPI* - - type annotation +- **`FastAPI`**: *ASGI* + type annotations + data model + *OpenAPI*(*Swagger UI*) + - [Quick Start](https://lucas-six.github.io/python-cookbook/cookbook/web/fastapi/fastapi_quickstart) + - [Data Model: **`Pydantic`**](https://lucas-six.github.io/python-cookbook/cookbook/web/pydantic) + - [with MongoDB: **`motor`**](https://lucas-six.github.io/python-cookbook/cookbook/web/fastapi/fastapi_mongodb) ### Web Server @@ -217,8 +215,10 @@ - [Official Driver](https://www.mongodb.com/docs/drivers/python/) - [`pymongo`: Sync](https://www.mongodb.com/docs/drivers/pymongo/) - - [**`motor`**: Async](https://www.mongodb.com/docs/drivers/motor/) -- [`Beanie`: Async ODM (based on `Pydantic`)](https://beanie-odm.dev/) + - [**`motor`**: Async](https://lucas-six.github.io/python-cookbook/cookbook/system_services/mongodb_motor) +- ODM + - [`Beanie`: Async ODM (based on `Pydantic`)](https://beanie-odm.dev/) + - [`PyODMongo`: Async ODM (based on `Pydantic V2`)](https://pyodmongo.dev/) ### Redis diff --git a/cookbook/build/deploy/docker.md b/cookbook/build/deploy/docker.md index 8dc6d8d..38d034e 100644 --- a/cookbook/build/deploy/docker.md +++ b/cookbook/build/deploy/docker.md @@ -9,7 +9,7 @@ sed -i "1d" requirements.txt ```Dockerfile # syntax=docker/dockerfile:1 -FROM python:3.10 +FROM python:3.11 ARG PYPI_INDEX_URL=https://pypi.org/simple ARG PYPI_TRUST_HOST=pypi.org @@ -34,6 +34,23 @@ RUN python -m black . \ && python -m pylint . ``` +OR + +```Dockerfile +# syntax=docker/dockerfile:1 +FROM python:3.11-alpine + +ARG PYPI_INDEX_URL=https://pypi.org/simple +ARG PYPI_TRUST_HOST=pypi.org +ARG PYPI_TIMEOUT=300 + +# ENV PYTHONUNBUFFERD 1 + +# Aliyun mirrors +#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories +#RUN apk update && apk add git curl +``` + ```bash docker build --network=host -t . --build-arg PYPI_INDEX_URL= --build-arg PYPI_TRUST_HOST= docker run --rm /bin/sh -c echo lint finished diff --git a/cookbook/build/project.md b/cookbook/build/project.md index 977bafd..4861edc 100644 --- a/cookbook/build/project.md +++ b/cookbook/build/project.md @@ -40,6 +40,7 @@ classifiers = [ dependencies = [ "psycopg2 >= 2.8", "redis >= 4.0", + "types-redis", "requests >=2.6", "configparser; python_version == '2.7'", @@ -97,6 +98,7 @@ profile = "black" skip_gitignore = true extend_skip = [".gitignore", ".env", ".dockerignore"] # skip_glob = [] +extend_skip_glob = [] [tool.mypy] python_version = "3.11" @@ -107,16 +109,11 @@ follow_imports = "silent" warn_redundant_casts = true warn_unused_ignores = true warn_unused_configs = true -disallow_any_generics = true +disallow_any_generics = false check_untyped_defs = true no_implicit_reexport = true disallow_untyped_defs = true -# mypy for MongoDB motor -[[tool.mypy.overrides]] -module = "motor.*" -ignore_missing_imports = true - [tool.pylint.main] recursive = true py-version = 3.11 @@ -124,6 +121,9 @@ jobs = 0 ignore = "CVS,.git,__pycache__,.mypy_cache,tests" ignore-paths = "tests" ignore-patterns = "test_.*.py" +load-plugins = [ + "pylint.extensions.bad_builtin", +] [tool.pylint.'FORMAT'] max-line-length = 88 @@ -141,16 +141,22 @@ disable = [ "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", - "logging-fstring-interpolation" + "logging-fstring-interpolation", + #"missing-class-docstring", + #"missing-function-docstring", + #"duplicate-code", ] enable = [ "c-extension-no-member", ] [tool.pylint.design] -max-args = 12 -min-public-methods = 1 -max-locals = 22 +max-args = 15 +min-public-methods = 0 +max-locals = 25 + +[tool.pylint.deprecated_builtins] +bad-functions = ["map", "filter"] [tool.pyright] include = [ @@ -209,7 +215,6 @@ ignore = [ ## More - [`pipenv` - Python Cookbook](pkg/pipenv) -- [FastAPI Project](project_fastapi) ## References diff --git a/cookbook/build/project_fastapi.md b/cookbook/build/project_fastapi.md deleted file mode 100644 index ea37bff..0000000 --- a/cookbook/build/project_fastapi.md +++ /dev/null @@ -1,198 +0,0 @@ -# FastAPI Project - -First, set up [Base Project](project). - -## Setup Environment - -```bash -pipenv install pydantic -pipenv install --dev pylint-pydantic - -pipenv install fastapi[all] -pipenv install uvicorn[standard] - -pipenv install motor # MongoDB asyncio driver -``` - -## `pyproject.toml` - -```ini -[project] -name = "" -description = "" -authors = [ - {name = "", email = ""}, - {name = "Lucas", email = "lucassix.lee@gmail.com"}, -] -readme = "README.md" -requires-python = "~=3.11" -license = {file = "LICENSE"} -maintainers = [ - {name = "", email = ""}, -] -keywords = ["xxx"] -classifiers = [ - "Development Status :: 1 - Planning", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Utilities", - "Operating System :: OS Independent", - "License :: OSI Approved :: MIT License", - "License :: OSI Approved :: Apache Software License", - "Typing :: Typed", -] -dependencies = [ - "pydantic", - "fastapi[all]", - "uvicorn[standard]", - "motor", -] -dynamic = ["version"] - -[project.optional-dependencies] -test = [ - "black", - "isort", - "mymy", - "pylint", - "pylint-pydantic", -] -doc = [] - -[project.urls] -Home = "" -Documentation = "" -Source = "" - -[tool.black] -line-length = 88 -target-version = ['py310', 'py311'] -skip-string-normalization = true -include = '\.pyi?$' -extend-exclude = ''' -tests/.*\.py$ -migrations/.*\.py$ -''' - -[tool.isort] -src_paths = ["src", "app"] -atomic = true -profile = "black" -# skip = [ -# '.bzr', -# '.direnv', -# '.eggs', -# '.git', -# '.hg', -# '.mypy_cache', -# '.nox', -# '.pants.d', -# '.svn', -# '.tox', -# '.venv', -# '__pypackages__', -# '_build', -# 'buck-out', -# 'build', -# 'dist', -# 'node_modules', -# 'venv' -# ] -skip_gitignore = true -extend_skip = [".gitignore", ".env", ".dockerignore"] -# skip_glob = [] - -[tool.mypy] -python_version = "3.11" -plugins = [ - "pydantic.mypy" -] -exclude = [ - "test_main.py", -] -follow_imports = "silent" -warn_redundant_casts = true -warn_unused_ignores = true -warn_unused_configs = true -disallow_any_generics = true -check_untyped_defs = true -no_implicit_reexport = true -disallow_untyped_defs = true - -[tool.pydantic-mypy] -init_forbid_extra = true -init_typed = true -warn_required_dynamic_aliases = true -warn_untyped_fields = true - -# mypy for MongoDB motor -[[tool.mypy.overrides]] -module = "motor.*" -ignore_missing_imports = true - -[tool.pylint.main] -recursive = true -py-version = 3.11 -jobs = 0 -ignore = "CVS,.git,__pycache__,.mypy_cache,tests" -ignore-paths = "tests" -ignore-patterns = "test_.*.py" -ignored-classes = "Body" -extension-pkg-whitelist = "pydantic" -load-plugins = [ - "pylint.extensions.bad_builtin", - "pylint_pydantic", -] - -[tool.pylint.'FORMAT'] -max-line-length = 88 - -[tool.pylint.'LOGGING'] -logging-format-style = "new" - -[tool.pylint.'MESSAGES CONTROL'] -disable = [ - "raw-checker-failed", - "bad-inline-option", - "locally-disabled", - "file-ignored", - "suppressed-message", - "useless-suppression", - "deprecated-pragma", - "use-symbolic-message-instead", - "logging-fstring-interpolation" -] -enable = [ - "c-extension-no-member", -] - -[tool.pylint.design] -max-args = 12 -min-public-methods = 1 -max-locals = 22 - -[tool.pylint.deprecated_builtins] -bad-functions = ["map", "filter", "print"] - -[tool.pyright] -include = [ - "src", - "app", -] -exclude = [ - ".git", - "**/__pycache__", - "**/.mypy_cache", -] -reportGeneralTypeIssues = "none" -reportUnboundVariable = "none" -stubPath = "" -pythonVersion = "3.11" -``` - -## References - -- [Python Project - Python Cookbook](project) -- [`Pydantic`](https://pydantic-docs.helpmanual.io/): data validation diff --git a/cookbook/system_services/mongodb_motor.md b/cookbook/system_services/mongodb_motor.md new file mode 100644 index 0000000..68ea0ef --- /dev/null +++ b/cookbook/system_services/mongodb_motor.md @@ -0,0 +1,96 @@ +# `motor` - Asyncio Driver for MongoDB + +## Start + +See [MongoDB Overview - Linux Cookbook](https://lucas-six.github.io/linux-cookbook/cookbook/admin/mongodb/mongodb_overview) +and [MongoDB on Ubuntu - Linux Cookbook](https://lucas-six.github.io/linux-cookbook/cookbook/admin/mongodb/mongodb_ubuntu). + +```toml +# pyproject.toml + +dependencies = [ + "motor", +] + +# mypy for MongoDB motor +[[tool.mypy.overrides]] +module = "motor.*" +ignore_missing_imports = true +``` + +```bash +pipenv install motor +``` + +## Usage + +```python +import logging + +import pymongo +from motor.core import AgnosticClient, AgnosticCollection, AgnosticDatabase +from motor.motor_asyncio import AsyncIOMotorClient +from pymongo.errors import DuplicateKeyError +from pymongo.results import InsertOneResult, UpdateResult + + +MONGO_URL = 'mongo://xxx' + +MONGO_CLIENT: AgnosticClient = AsyncIOMotorClient(MONGO_URL) +MONGO_DB: AgnosticDatabase = MONGO_CLIENT['database-name'] + +tb_users: AgnosticCollection = MONGO_DB['table-name'] + +# create index +await tb_users.create_index( + [('login_name', pymongo.ASCENDING)], unique=True, name='unique_login_name' +) + +# find one +user_doc = await tb_users.find_one({'login_name': 'xxx'}) +if user_doc is None: + logging.error('not exists') + +# insert one +try: + rsp1: InsertOneResult = await tb_users.insert_one({'login_name': 'xxx'}) +except DuplicateKeyError: + logging.error('duplicated key') +logging.info(f'id={rsp1.inserted_id}') + +# update one +try: + rsp2: UpdateResult = await tb_users.update_one( + {'login_name': 'xxx', '$set': {'login_name': 'yyy'}}) +except DuplicateKeyError: + logging.error('duplicated key') +if rsp2.modified_count != 1: + logging.error('update failed') + + +# transaction +try: + async with await MONGO_CLIENT.start_session() as session: + async with session.start_transaction(): + await tb_users.insert_one( + {'login_name': 'a'}, session=session + ) + await tb_users.insert_one( + {'login_name': 'b'}, session=session + ) +except DuplicateKeyError: + logging.error('transaction failed') +``` + +## More + +- [MongoDB Overview - Linux Cookbook](https://lucas-six.github.io/linux-cookbook/cookbook/admin/mongodb/mongodb_overview) +- [MongoDB on Ubuntu - Linux Cookbook](https://lucas-six.github.io/linux-cookbook/cookbook/admin/mongodb/mongodb_ubuntu) +- [MongoDB TLS - Linux Cookbook](https://lucas-six.github.io/linux-cookbook/cookbook/admin/mongodb/mongodb_tls) +- [CLI: **`mongosh`** Usage - Linux Cookbook](https://lucas-six.github.io/linux-cookbook/cookbook/admin/mongodb/mongodb_usage) + +## References + +- [MongoDB Python Driver](https://www.mongodb.com/docs/drivers/python/) +- [**`motor`** Documentation](https://www.mongodb.com/docs/drivers/motor/) +- [**`Beanie`** - Async Python ODM for MongoDB, based on `Pydantic`](https://beanie-odm.dev/) diff --git a/cookbook/system_services/redis.md b/cookbook/system_services/redis.md index d9a9897..ed43468 100644 --- a/cookbook/system_services/redis.md +++ b/cookbook/system_services/redis.md @@ -11,6 +11,7 @@ and [Redis CLI: Basic Usage - Linux Cookbook](https://lucas-six.github.io/linux- dependencies = [ "redis", #"redis[hiredis]", + "types-redis", ] ``` @@ -19,7 +20,7 @@ pip install types-redis pipenv install redis # pipenv install redis[hiredis] -pipenv install --dev types-redis +pipenv install types-redis ``` ## Usage diff --git a/cookbook/web/fastapi.md b/cookbook/web/fastapi.md index 5da5df7..1a45abb 100644 --- a/cookbook/web/fastapi.md +++ b/cookbook/web/fastapi.md @@ -3,14 +3,6 @@ ## Installation ```bash -pipenv install pydantic -pipenv install fastapi[all] -pipenv install uvicorn[standard] - -# NoSQL Database: MongoDB -#pipenv install motor -pipenv install beanie - # HTTP Request pipenv install aiohttp @@ -29,50 +21,6 @@ pipenv install celery[librabbitmq, mongodb, redis] pipenv install asyncio-mqtt ``` -## Data Model and Validation - -- [`Pydantic` Documentation](https://pydantic-docs.helpmanual.io/) - -```python -from datetime import datetime - -from pydantic import BaseModel - - -class User(BaseModel): - id: int - name = 'John Doe' - signup_ts: datetime | None = None - friends: list[int] = [] - - -user_data = { - 'id': '123', - 'signup_ts': '2019-06-01 12:22', - 'friends': [1, 2, '3'], -} -user = User(**user_data) - ->>> print(user.id) -123 - ->>> print(repr(user.signup_ts)) -datetime.datetime(2019, 6, 1, 12, 22) - ->>> print(user.friends) -[1, 2, 3] - ->>> print(user.dict()) -""" -{ - 'id': 123, - 'signup_ts': datetime.datetime(2019, 6, 1, 12, 22), - 'friends': [1, 2, 3], - 'name': 'John Doe', -} -""" -``` - ## MongoDB ```python @@ -187,23 +135,4 @@ async def delete_student(request: Request, student_id: str): return JSONResponse(status_code=status.HTTP_204_NO_CONTENT) raise HTTPException(status_code=404, detail=f'Student {student_id} not found') - - -@app.on_event('startup') -async def startup_db_client(): - app.mongodb_client = AsyncIOMotorClient(os.environ['MONGODB_URL']) - app.mongodb_db = app.mongodb_client[os.environ['MONGODB_DBNAME']] - - -@app.on_event('shutdown') -async def shutdown_db_client(): - app.mongodb_client.close() ``` - -## References - -- [Getting Started with MongoDB and FastAPI](https://www.mongodb.com/developer/languages/python/python-quickstart-fastapi/) -- [`uvicorn`: ASGI, WebSockets](uvicorn) -- [`Pydantic`](https://pydantic-docs.helpmanual.io/): data validation -- [`Beanie` - Async Python ODM for MongoDB, based on `Pydantic`](https://beanie-odm.dev/) -- [Awesome List for FastAPI](https://github.com/mjhea0/awesome-fastapi) diff --git a/cookbook/web/fastapi/fastapi_mongodb.md b/cookbook/web/fastapi/fastapi_mongodb.md new file mode 100644 index 0000000..90b4855 --- /dev/null +++ b/cookbook/web/fastapi/fastapi_mongodb.md @@ -0,0 +1,178 @@ +# `FastAPI` with MongoDB + +## Installation + +### `motor` + +See [MongoDB **`motor`** - Python Cookbook](../../system_services/mongodb_motor) + +### ODM (Object-Document Model): `beanie`, `pyodmongo` + +```bash +pipenv install beanie +pipenv install pyodmongo +``` + +```toml +# pyproject.toml + +dependencies = [ + "beanie", + "pyodmongo", +] +``` + +## App + +### `.env` + +```ini +# .env + +APP_NAME="FastAPI App" +APP_VERSION="v1.0.0" +APP_DESCRIPTION="FastAPI app description." +DEBUG=true +MONGODB_URL="mongodb://localhost:27017/?replicaSet=xxx&maxPoolSize=4096&connectTimeoutMS=3000&socketTimeoutMS=3500&serverSelectionTimeoutMS=2000" +MONGODB_DB_NAME="xxx" +``` + +### `settings` + +```python +"""Settings with MongoDB.""" + +from functools import lru_cache + +from pydantic import MongoDsn +from pydantic_settings import BaseSettings, SettingsConfigDict + + +class Settings(BaseSettings): + model_config = SettingsConfigDict( + env_file='.env', env_file_encoding='utf-8', extra='allow' + ) + + app_name: str + app_version: str = '0.1.0' + app_doc_url: str = '/docs' + app_description: str = '' + debug: bool = False + mongodb_url: MongoDsn + mongodb_db_name: str + + +@lru_cache() +def get_settings() -> Settings: + return Settings() # pyright: ignore[reportCallIssue] +``` + +### App + +```python +"""FastAPI with MongoDB.""" + +from collections.abc import AsyncGenerator +from contextlib import asynccontextmanager + +import uvicorn +from fastapi import FastAPI +from fastapi.openapi.docs import ( + get_redoc_html, + get_swagger_ui_html, + get_swagger_ui_oauth2_redirect_html, +) +from fastapi.responses import HTMLResponse +from fastapi.staticfiles import StaticFiles +from motor.core import AgnosticClient +from motor.motor_asyncio import AsyncIOMotorClient + +from examples.web.fastapi.routers import router +from examples.web.fastapi.settings_mongodb import get_settings + +settings = get_settings() +API_DOC_STATIC_DIR = 'examples/web/fastapi/static' +API_DOC_STATIC_PATH = f'{settings.app_doc_url}/{API_DOC_STATIC_DIR}' + +MONGODB_CLIENT: AgnosticClient = AsyncIOMotorClient(str(settings.mongodb_url)) +DB_XXX = MONGODB_CLIENT[settings.mongodb_db_name] + + +@asynccontextmanager +async def lifespan(_: FastAPI) -> AsyncGenerator: + yield + MONGODB_CLIENT.close() + + +app: FastAPI = FastAPI( + title=settings.app_name, + docs_url=settings.app_doc_url, + debug=settings.debug, + openapi_url=f'{settings.app_doc_url}/openapi.json', + description=settings.app_description, + version=settings.app_version, + lifespan=lifespan, +) + +app.mount(API_DOC_STATIC_PATH, StaticFiles(directory=API_DOC_STATIC_DIR), name='static') +assert isinstance(app.swagger_ui_oauth2_redirect_url, str) + + +@app.head(settings.app_doc_url, include_in_schema=False) +@app.get(settings.app_doc_url, include_in_schema=False) +async def custom_swagger_ui_html() -> HTMLResponse: + """Custom Swagger UI""" + assert isinstance(app.openapi_url, str) + return get_swagger_ui_html( + openapi_url=app.openapi_url, + title=app.title + ' - Swagger UI', + oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url, + swagger_js_url=f'{API_DOC_STATIC_PATH}/swagger-ui-bundle.js', + swagger_css_url=f'{API_DOC_STATIC_PATH}/swagger-ui.css', + ) + + +@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False) +async def swagger_ui_redirect() -> HTMLResponse: + """Swagger UI redirect""" + return get_swagger_ui_oauth2_redirect_html() + + +@app.get(f'{settings.app_doc_url}/redoc', include_in_schema=False) +async def redoc_html() -> HTMLResponse: + """Custom redoc html.""" + assert isinstance(app.openapi_url, str) + return get_redoc_html( + openapi_url=app.openapi_url, + title=app.title + ' - ReDoc', + redoc_js_url=f'{API_DOC_STATIC_PATH}/redoc.standalone.js', + ) + + +@app.get('/api') +async def root() -> dict[str, str]: + await app.state.mongodb_db['x'].find_one({''}) + return {'Hello': 'World'} + + +app.include_router(router, prefix='/api/router', tags=['router']) + + +# Only for develop environment +if __name__ == '__main__': + uvicorn.run(app='main:app', host='', reload=True) +``` + +## More + +- [Quick Start with **`FastAPI`**](fastapi_quickstart) +- [MongoDB **`motor`** - Python Cookbook](../../system_services/mongodb_motor) +- [Data Model: **`Pydantic`**](../pydantic) + +## References + +- [**`FastAPI`**](https://fastapi.tiangolo.com/) +- [Getting Started with MongoDB and FastAPI](https://www.mongodb.com/developer/languages/python/python-quickstart-fastapi/) +- [**`Beanie`** - Async Python ODM for MongoDB, based on `Pydantic`](https://beanie-odm.dev/) +- [`PyODMongo`: Async ODM (based on `Pydantic V2`)](https://pyodmongo.dev/) +- [*`Pydantic`*: data part](https://pydantic-docs.helpmanual.io/) diff --git a/cookbook/web/fastapi/fastapi_quickstart.md b/cookbook/web/fastapi/fastapi_quickstart.md new file mode 100644 index 0000000..530e0b6 --- /dev/null +++ b/cookbook/web/fastapi/fastapi_quickstart.md @@ -0,0 +1,389 @@ +# Quick Start with `FastAPI` + +## Installation + +```bash +pipenv --python 3.11 + +pipenv install pydantic +pipenv install fastapi[all] +pipenv install uvicorn[standard] + +pipenv install --dev black isort mypy pylint +pipenv install --dev pylint-pydantic + +# JWT +pipenv install python-jose[cryptography] +pipenv install types-python-jose +``` + +## `pyproject.toml` + +```ini +[project] +name = "" +description = "" +authors = [ + {name = "", email = ""}, + {name = "Lucas", email = "lucassix.lee@gmail.com"}, +] +readme = "README.md" +requires-python = "~=3.11" +license = {file = "LICENSE"} +maintainers = [ + {name = "", email = ""}, +] +keywords = ["xxx"] +classifiers = [ + "Development Status :: 1 - Planning", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Utilities", + "Operating System :: OS Independent", + "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: Apache Software License", + "Typing :: Typed", +] +dependencies = [ + "pydantic", + "fastapi[all]", + "uvicorn[standard]", + + "python-jose[cryptography]", + "types-python-jose", +] +dynamic = ["version"] + +[project.optional-dependencies] +test = [ + "black", + "isort", + "mymy", + "pylint", + "pylint-pydantic", +] +doc = [] + +[project.urls] +Home = "" +Documentation = "" +Source = "" + +[tool.black] +line-length = 88 +target-version = ['py310', 'py311'] +skip-string-normalization = true +include = '\.pyi?$' +extend-exclude = ''' +tests/.*\.py$ +migrations/.*\.py$ +''' + +[tool.isort] +src_paths = ["src", "app"] +atomic = true +profile = "black" +# skip = [ +# '.bzr', +# '.direnv', +# '.eggs', +# '.git', +# '.hg', +# '.mypy_cache', +# '.nox', +# '.pants.d', +# '.svn', +# '.tox', +# '.venv', +# '__pypackages__', +# '_build', +# 'buck-out', +# 'build', +# 'dist', +# 'node_modules', +# 'venv' +# ] +skip_gitignore = true +extend_skip = [".gitignore", ".env", ".dockerignore"] +# skip_glob = [] +extend_skip_glob = [] + +[tool.mypy] +python_version = "3.11" +plugins = [ + "pydantic.mypy" +] +exclude = [ +] +follow_imports = "silent" +warn_redundant_casts = true +warn_unused_ignores = true +warn_unused_configs = true +disallow_any_generics = true +check_untyped_defs = true +no_implicit_reexport = true +disallow_untyped_defs = true + +[tool.pydantic-mypy] +init_forbid_extra = true +init_typed = true +warn_required_dynamic_aliases = true +warn_untyped_fields = true + +[tool.pylint.main] +recursive = true +py-version = 3.11 +jobs = 0 +ignore = "CVS,.git,__pycache__,.mypy_cache,tests" +ignore-paths = "tests" +ignore-patterns = "test_.*.py" +ignored-classes = "Body" +extension-pkg-whitelist = "pydantic" +load-plugins = [ + "pylint.extensions.bad_builtin", + "pylint_pydantic", +] + +[tool.pylint.'FORMAT'] +max-line-length = 88 + +[tool.pylint.'LOGGING'] +logging-format-style = "new" + +[tool.pylint.'MESSAGES CONTROL'] +disable = [ + "raw-checker-failed", + "bad-inline-option", + "locally-disabled", + "file-ignored", + "deprecated-pragma", + "use-symbolic-message-instead", + "logging-fstring-interpolation", + "missing-function-docstring", +] +enable = [ + "c-extension-no-member", + "suppressed-message", + "useless-suppression", +] + +[tool.pylint.design] +max-args = 15 +min-public-methods = 0 +max-locals = 25 + +[tool.pylint.deprecated_builtins] +bad-functions = ["map", "filter", "print"] + +[tool.pyright] +include = [ + "src", + "app", +] +exclude = [ + ".git", + "**/__pycache__", + "**/.mypy_cache", +] +reportGeneralTypeIssues = "none" +reportUnboundVariable = "none" +stubPath = "" +pythonVersion = "3.11" +``` + +## App + +### `.env` + +```ini +# .env + +APP_NAME="FastAPI App" +APP_VERSION="v1.0.0" +APP_DESCRIPTION="FastAPI app description." +DEBUG=true +``` + +### `settings` + +```python +"""Settings.""" + +from functools import lru_cache + +from pydantic_settings import BaseSettings, SettingsConfigDict + + +class Settings(BaseSettings): + model_config = SettingsConfigDict( + env_file='.env', env_file_encoding='utf-8', extra='allow' + ) + + app_name: str + app_version: str = '0.1.0' + app_doc_url: str = '/docs' + app_description: str = '' + debug: bool = False + + +@lru_cache() +def get_settings() -> Settings: + return Settings() # pyright: ignore[reportCallIssue] +``` + +### App + +```python +"""FastAPI App.""" + +from __future__ import annotations + +from collections.abc import AsyncGenerator +from contextlib import asynccontextmanager +from typing import Any + +import uvicorn +from fastapi import FastAPI + +from examples.web.fastapi.settings import get_settings + +settings = get_settings() + + +@asynccontextmanager +async def lifespan(_: FastAPI) -> AsyncGenerator[Any, Any]: + yield + + +app: FastAPI = FastAPI( + title=settings.app_name, + docs_url=settings.app_doc_url, + debug=settings.debug, + openapi_url=f'{settings.app_doc_url}/openapi.json', + description=settings.app_description, + version=settings.app_version, + lifespan=lifespan, +) + + +@app.get('/api') +async def root() -> dict[str, str]: + return {'Hello': 'World'} + + +# Only for develop environment +if __name__ == '__main__': + uvicorn.run(app='main:app', host='', reload=True) +``` + +### Custom OpenAPI static files + +```python +"""FastAPI OpenAPI (v3.1) with custom static files.""" + +from collections.abc import AsyncGenerator +from contextlib import asynccontextmanager +from typing import Any + +import uvicorn +from fastapi import FastAPI +from fastapi.openapi.docs import ( + get_redoc_html, + get_swagger_ui_html, + get_swagger_ui_oauth2_redirect_html, +) +from fastapi.responses import HTMLResponse +from fastapi.staticfiles import StaticFiles + +from examples.web.fastapi.routers import router +from examples.web.fastapi.settings import get_settings + +settings = get_settings() +API_DOC_STATIC_DIR = 'examples/web/fastapi/static' +API_DOC_STATIC_PATH = f'{settings.app_doc_url}/{API_DOC_STATIC_DIR}' + + +@asynccontextmanager +async def lifespan(_: FastAPI) -> AsyncGenerator[Any, Any]: + yield + + +app: FastAPI = FastAPI( + title=settings.app_name, + docs_url=settings.app_doc_url, + debug=settings.debug, + openapi_url=f'{settings.app_doc_url}/openapi.json', + description=settings.app_description, + version=settings.app_version, + lifespan=lifespan, +) + +app.mount(API_DOC_STATIC_PATH, StaticFiles(directory=API_DOC_STATIC_DIR), name='static') +assert isinstance(app.swagger_ui_oauth2_redirect_url, str) + + +@app.head(settings.app_doc_url, include_in_schema=False) +@app.get(settings.app_doc_url, include_in_schema=False) +async def custom_swagger_ui_html() -> HTMLResponse: + """Custom Swagger UI""" + assert isinstance(app.openapi_url, str) + return get_swagger_ui_html( + openapi_url=app.openapi_url, + title=app.title + " - Swagger UI", + oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url, + swagger_js_url=f'{API_DOC_STATIC_PATH}/swagger-ui-bundle.js', + swagger_css_url=f'{API_DOC_STATIC_PATH}/swagger-ui.css', + ) + + +@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False) +async def swagger_ui_redirect() -> HTMLResponse: + """Swagger UI redirect""" + return get_swagger_ui_oauth2_redirect_html() + + +@app.get(f'{settings.app_doc_url}/redoc', include_in_schema=False) +async def redoc_html() -> HTMLResponse: + """Custom redoc html.""" + assert isinstance(app.openapi_url, str) + return get_redoc_html( + openapi_url=app.openapi_url, + title=app.title + " - ReDoc", + redoc_js_url=f'{API_DOC_STATIC_PATH}/redoc.standalone.js', + ) + + +@app.get('/api') +async def root() -> dict[str, str]: + await app.state.mongodb_db['x'].find_one({''}) + return {'Hello': 'World'} + + +app.include_router(router, prefix='/api/router', tags=['router']) + + +# Only for develop environment +if __name__ == '__main__': + uvicorn.run(app='main:app', host='', reload=True) +``` + +## Run + +See [Uvicorn: ASGI, WebSockets - Python Cookbook](../uvicorn). + +## More + +- [Python Project - Python Cookbook](../../build/project) +- [ASGI Web Server: **`Uvicorn`** - Python Cookbook](../uvicorn) +- [Data Model: **`Pydantic`**](../pydantic) +- [with MongoDB: **`motor`**](fastapi_mongodb) + +## References + +- [**`FastAPI`**](https://fastapi.tiangolo.com/) +- [*`Starlette`*: *ASGI* Web part](https://www.starlette.io/) +- [*`Pydantic`*: data part](https://pydantic-docs.helpmanual.io/) +- [*`Swagger`*: *OpenAPI*](https://swagger.io/) +- [Awesome List for FastAPI](https://github.com/mjhea0/awesome-fastapi) diff --git a/cookbook/web/pydantic.md b/cookbook/web/pydantic.md new file mode 100644 index 0000000..9c7661b --- /dev/null +++ b/cookbook/web/pydantic.md @@ -0,0 +1,48 @@ +# Data Model: `Pydantic` + +## Recipes + +```python +from datetime import datetime + +from pydantic import BaseModel + + +class User(BaseModel): + id: int + name: str = 'Lucas' + signup_time: datetime | None = None + friends: list[str] = [] + + +user_data: dict[str, str | list[str | datetime | None]] = { + 'id': '123', + 'signup_time': '2019-06-01 12:22', + 'friends': [], +} + +user = User(**user_data) + +>>> print(user.id) +123 + +>>> print(repr(user.signup_ts)) +datetime.datetime(2019, 6, 1, 12, 22) + +>>> print(user.friends) +[] + +>>> print(user.dict()) +""" +{ + 'id': 123, + 'signup_time': datetime.datetime(2019, 6, 1, 12, 22), + 'friends': [], + 'name': 'Lucas', +} +""" +``` + +## References + +- [`Pydantic` Documentation](https://pydantic-docs.helpmanual.io/) diff --git a/cookbook/web/uvicorn.md b/cookbook/web/uvicorn.md index bebc8a5..b9f4b48 100644 --- a/cookbook/web/uvicorn.md +++ b/cookbook/web/uvicorn.md @@ -1,11 +1,13 @@ # Uvicorn -## Recipes +## Installation ```bash pip install 'uvicorn[standard]' ``` +## Logging + ```json /* uvicorn_logging.json */ @@ -60,6 +62,8 @@ pip install 'uvicorn[standard]' } ``` +## Run + ```bash uvicorn --host 0.0.0.0 --port 8000 \ --proxy-headers \ diff --git a/examples/__init__.py b/examples/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/core/asyncio_coroutine.py b/examples/core/asyncio_coroutine.py index cd90d7d..44cf85b 100644 --- a/examples/core/asyncio_coroutine.py +++ b/examples/core/asyncio_coroutine.py @@ -14,8 +14,8 @@ async def do_task(name: str, delay: float, sleep_result: str | None = None) -> s logging.debug(f'run task {name}, sleep {delay} seconds') if sleep_result: - result: str = await asyncio.sleep(delay, result=f'sleep {delay} seconds') - return f'task ({name}) result: {result}' + res: str = await asyncio.sleep(delay, result=f'sleep {delay} seconds') + return f'task ({name}) result: {res}' await asyncio.sleep(delay) return f'task ({name}) result' diff --git a/examples/core/asyncio_tcp_client.py b/examples/core/asyncio_tcp_client.py index 7a167dd..1b10437 100644 --- a/examples/core/asyncio_tcp_client.py +++ b/examples/core/asyncio_tcp_client.py @@ -4,7 +4,7 @@ import asyncio import logging -from asyncio_tcp_server import HOST, PORT +from examples.core.asyncio_tcp_server import HOST, PORT logging.basicConfig( level=logging.DEBUG, style='{', format='[{threadName} ({thread})] {message}' diff --git a/examples/core/asyncio_tcp_server_low.py b/examples/core/asyncio_tcp_server_low.py index 673f41a..024a29c 100644 --- a/examples/core/asyncio_tcp_server_low.py +++ b/examples/core/asyncio_tcp_server_low.py @@ -15,7 +15,7 @@ level=logging.DEBUG, style='{', format='[{threadName} ({thread})] {message}' ) -tcp_quickack = True +# TCP_QUICKACK = True recv_bufsize: int | None = None send_bufsize: int | None = None @@ -28,7 +28,7 @@ def connection_made(self, transport: asyncio.BaseTransport) -> None: client_address = transport.get_extra_info('peername') logging.debug(f'connected from {client_address}') - self.transport = transport + self.transport = transport # pylint: disable=attribute-defined-outside-init # `socket.getsockname()` # server_address = transport.get_extra_info('sockname') @@ -55,7 +55,7 @@ def connection_made(self, transport: asyncio.BaseTransport) -> None: sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 5) sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 15) - # handle_tcp_quickack(sock, tcp_quickack) + # handle_tcp_quickack(sock, TCP_QUICKACK) # logging.debug(dir(sock)) def data_received(self, data: bytes) -> None: @@ -77,7 +77,7 @@ async def tcp_echo_server( # The socket option `TCP_NODELAY` is set by default in Python 3.6+ server = await loop.create_server( - lambda: EchoServerProtocol(), + EchoServerProtocol, host, port, reuse_address=True, diff --git a/examples/core/ipc_socketpair.py b/examples/core/ipc_socketpair.py index e0cfcc5..98357f2 100644 --- a/examples/core/ipc_socketpair.py +++ b/examples/core/ipc_socketpair.py @@ -19,7 +19,7 @@ if pid: # parent process child.close() - data = b'data' + data = b'data' # pylint: disable=invalid-name parent.sendall(data) logging.debug(f'parent sent: {data!r}') data = parent.recv(1024) diff --git a/examples/core/ipc_unix_domain_socket_client_ipv4.py b/examples/core/ipc_unix_domain_socket_client_ipv4.py index 732ee16..b374c5d 100644 --- a/examples/core/ipc_unix_domain_socket_client_ipv4.py +++ b/examples/core/ipc_unix_domain_socket_client_ipv4.py @@ -8,13 +8,13 @@ level=logging.DEBUG, style='{', format='[{processName} ({process})] {message}' ) -sockfile = 'xxx.sock' +SOCKFILE = 'xxx.sock' with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as client: try: logging.debug('connecting ...') - client.connect(sockfile) + client.connect(SOCKFILE) logging.debug('connected') data: bytes = b'data' diff --git a/examples/core/ipc_unix_domain_socket_server_ipv4.py b/examples/core/ipc_unix_domain_socket_server_ipv4.py index 7fe17b5..f2d81fa 100644 --- a/examples/core/ipc_unix_domain_socket_server_ipv4.py +++ b/examples/core/ipc_unix_domain_socket_server_ipv4.py @@ -10,16 +10,16 @@ level=logging.DEBUG, style='{', format='[{processName} ({process})] {message}' ) -sockfile = 'xxx.sock' +SOCKFILE = 'xxx.sock' # Make sure the socket does not already exist. with suppress(FileNotFoundError): - os.remove(sockfile) + os.remove(SOCKFILE) sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) # bind -sock.bind(sockfile) +sock.bind(SOCKFILE) sock.listen() try: diff --git a/examples/core/ipv4_multicast_udp_client.py b/examples/core/ipv4_multicast_udp_client.py index cfe3c4f..752aa8a 100644 --- a/examples/core/ipv4_multicast_udp_client.py +++ b/examples/core/ipv4_multicast_udp_client.py @@ -29,6 +29,7 @@ # The `IP_MULTICAST_LOOP` socket option # allows the application to send data to be looped back to your host or not. + # pylint: disable=invalid-name multicast_loopback_val = None if multicast_loopback is not None: multicast_loopback_val = 1 if multicast_loopback else 0 diff --git a/examples/core/ipv4_multicast_udp_server.py b/examples/core/ipv4_multicast_udp_server.py index 6e77f7c..3531785 100644 --- a/examples/core/ipv4_multicast_udp_server.py +++ b/examples/core/ipv4_multicast_udp_server.py @@ -37,7 +37,7 @@ Path('/proc/sys/net/core/wmem_max').read_text(encoding='utf-8').strip() ) else: - max_recv_buf_size = max_send_buf_size = None + max_recv_buf_size = max_send_buf_size = None # pylint: disable=invalid-name def run_server( diff --git a/examples/core/pack_unpack_bin_data.py b/examples/core/pack_unpack_bin_data.py index f2de1ba..958acb3 100644 --- a/examples/core/pack_unpack_bin_data.py +++ b/examples/core/pack_unpack_bin_data.py @@ -25,7 +25,7 @@ # <: little endianness # >: big endianness # !: network (=big-endianness) RFC 1700 -fmt_str = '= I 2s Q 2h f' +fmt_str = '= I 2s Q 2h f' # pylint: disable=invalid-name value = (1, b'ab', 2, 3, 3, 2.5) diff --git a/examples/core/udp_server_asyncio.py b/examples/core/udp_server_asyncio.py index 5d224e1..6caba16 100644 --- a/examples/core/udp_server_asyncio.py +++ b/examples/core/udp_server_asyncio.py @@ -22,7 +22,7 @@ class EchoServerProtocol(asyncio.DatagramProtocol): def connection_made( # type: ignore[override] self, transport: asyncio.DatagramTransport ) -> None: - self.transport = transport + self.transport = transport # pylint: disable=attribute-defined-outside-init sock = transport.get_extra_info('socket') server_address = transport.get_extra_info('sockname') @@ -63,7 +63,7 @@ async def udp_echo_server(host: str, port: int) -> None: # specifically prevents processes with differing UIDs from assigning sockets to the # same socket address. transport, _ = await loop.create_datagram_endpoint( - lambda: EchoServerProtocol(), + EchoServerProtocol, (host, port), reuse_port=True, ) diff --git a/examples/web/fastapi/main.py b/examples/web/fastapi/main.py new file mode 100644 index 0000000..e9454b8 --- /dev/null +++ b/examples/web/fastapi/main.py @@ -0,0 +1,40 @@ +"""FastAPI App.""" + +from __future__ import annotations + +from collections.abc import AsyncGenerator +from contextlib import asynccontextmanager +from typing import Any + +import uvicorn +from fastapi import FastAPI + +from examples.web.fastapi.settings import get_settings + +settings = get_settings() + + +@asynccontextmanager +async def lifespan(_: FastAPI) -> AsyncGenerator[Any, Any]: + yield + + +app: FastAPI = FastAPI( + title=settings.app_name, + docs_url=settings.app_doc_url, + debug=settings.debug, + openapi_url=f'{settings.app_doc_url}/openapi.json', + description=settings.app_description, + version=settings.app_version, + lifespan=lifespan, +) + + +@app.get('/api') +async def root() -> dict[str, str]: + return {'Hello': 'World'} + + +# Only for develop environment +if __name__ == '__main__': + uvicorn.run(app='main:app', host='', reload=True) diff --git a/examples/web/fastapi/main_mongodb.py b/examples/web/fastapi/main_mongodb.py new file mode 100644 index 0000000..a69572d --- /dev/null +++ b/examples/web/fastapi/main_mongodb.py @@ -0,0 +1,91 @@ +"""FastAPI with MongoDB.""" + +from collections.abc import AsyncGenerator +from contextlib import asynccontextmanager + +import uvicorn +from fastapi import FastAPI +from fastapi.openapi.docs import ( + get_redoc_html, + get_swagger_ui_html, + get_swagger_ui_oauth2_redirect_html, +) +from fastapi.responses import HTMLResponse +from fastapi.staticfiles import StaticFiles +from motor.core import AgnosticClient +from motor.motor_asyncio import AsyncIOMotorClient + +from examples.web.fastapi.routers import router +from examples.web.fastapi.settings_mongodb import get_settings + +settings = get_settings() +API_DOC_STATIC_DIR = 'examples/web/fastapi/static' +API_DOC_STATIC_PATH = f'{settings.app_doc_url}/{API_DOC_STATIC_DIR}' + +MONGODB_CLIENT: AgnosticClient = AsyncIOMotorClient(str(settings.mongodb_url)) +DB_XXX = MONGODB_CLIENT[settings.mongodb_db_name] + + +@asynccontextmanager +async def lifespan(_: FastAPI) -> AsyncGenerator: + yield + MONGODB_CLIENT.close() + + +app: FastAPI = FastAPI( + title=settings.app_name, + docs_url=settings.app_doc_url, + debug=settings.debug, + openapi_url=f'{settings.app_doc_url}/openapi.json', + description=settings.app_description, + version=settings.app_version, + lifespan=lifespan, +) + +app.mount(API_DOC_STATIC_PATH, StaticFiles(directory=API_DOC_STATIC_DIR), name='static') +assert isinstance(app.swagger_ui_oauth2_redirect_url, str) + + +@app.head(settings.app_doc_url, include_in_schema=False) +@app.get(settings.app_doc_url, include_in_schema=False) +async def custom_swagger_ui_html() -> HTMLResponse: + """Custom Swagger UI""" + assert isinstance(app.openapi_url, str) + return get_swagger_ui_html( + openapi_url=app.openapi_url, + title=app.title + ' - Swagger UI', + oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url, + swagger_js_url=f'{API_DOC_STATIC_PATH}/swagger-ui-bundle.js', + swagger_css_url=f'{API_DOC_STATIC_PATH}/swagger-ui.css', + ) + + +@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False) +async def swagger_ui_redirect() -> HTMLResponse: + """Swagger UI redirect""" + return get_swagger_ui_oauth2_redirect_html() + + +@app.get(f'{settings.app_doc_url}/redoc', include_in_schema=False) +async def redoc_html() -> HTMLResponse: + """Custom redoc html.""" + assert isinstance(app.openapi_url, str) + return get_redoc_html( + openapi_url=app.openapi_url, + title=app.title + ' - ReDoc', + redoc_js_url=f'{API_DOC_STATIC_PATH}/redoc.standalone.js', + ) + + +@app.get('/api') +async def root() -> dict[str, str]: + await app.state.mongodb_db['x'].find_one({''}) + return {'Hello': 'World'} + + +app.include_router(router, prefix='/api/router', tags=['router']) + + +# Only for develop environment +if __name__ == '__main__': + uvicorn.run(app='main:app', host='', reload=True) diff --git a/examples/web/fastapi/main_openapi_static.py b/examples/web/fastapi/main_openapi_static.py new file mode 100644 index 0000000..479749b --- /dev/null +++ b/examples/web/fastapi/main_openapi_static.py @@ -0,0 +1,86 @@ +"""FastAPI OpenAPI (v3.1) with custom static files.""" + +from collections.abc import AsyncGenerator +from contextlib import asynccontextmanager +from typing import Any + +import uvicorn +from fastapi import FastAPI +from fastapi.openapi.docs import ( + get_redoc_html, + get_swagger_ui_html, + get_swagger_ui_oauth2_redirect_html, +) +from fastapi.responses import HTMLResponse +from fastapi.staticfiles import StaticFiles + +from examples.web.fastapi.routers import router +from examples.web.fastapi.settings import get_settings + +settings = get_settings() +API_DOC_STATIC_DIR = 'examples/web/fastapi/static' +API_DOC_STATIC_PATH = f'{settings.app_doc_url}/{API_DOC_STATIC_DIR}' + + +@asynccontextmanager +async def lifespan(_: FastAPI) -> AsyncGenerator[Any, Any]: + yield + + +app: FastAPI = FastAPI( + title=settings.app_name, + docs_url=settings.app_doc_url, + debug=settings.debug, + openapi_url=f'{settings.app_doc_url}/openapi.json', + description=settings.app_description, + version=settings.app_version, + lifespan=lifespan, +) + +app.mount(API_DOC_STATIC_PATH, StaticFiles(directory=API_DOC_STATIC_DIR), name='static') +assert isinstance(app.swagger_ui_oauth2_redirect_url, str) + + +@app.head(settings.app_doc_url, include_in_schema=False) +@app.get(settings.app_doc_url, include_in_schema=False) +async def custom_swagger_ui_html() -> HTMLResponse: + """Custom Swagger UI""" + assert isinstance(app.openapi_url, str) + return get_swagger_ui_html( + openapi_url=app.openapi_url, + title=app.title + ' - Swagger UI', + oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url, + swagger_js_url=f'{API_DOC_STATIC_PATH}/swagger-ui-bundle.js', + swagger_css_url=f'{API_DOC_STATIC_PATH}/swagger-ui.css', + ) + + +@app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False) +async def swagger_ui_redirect() -> HTMLResponse: + """Swagger UI redirect""" + return get_swagger_ui_oauth2_redirect_html() + + +@app.get(f'{settings.app_doc_url}/redoc', include_in_schema=False) +async def redoc_html() -> HTMLResponse: + """Custom redoc html.""" + assert isinstance(app.openapi_url, str) + return get_redoc_html( + openapi_url=app.openapi_url, + title=app.title + ' - ReDoc', + redoc_js_url=f'{API_DOC_STATIC_PATH}/redoc.standalone.js', + ) + + +@app.get('/api') +async def root() -> dict[str, str]: + await app.state.mongodb_db['x'].find_one({''}) + return {'Hello': 'World'} + + +app.include_router(router, prefix='/api/router', tags=['router']) + + +# Only for develop environment +if __name__ == '__main__': + uvicorn.run(app='main:app', host='', reload=True) diff --git a/examples/web/fastapi/routers.py b/examples/web/fastapi/routers.py new file mode 100644 index 0000000..24d2b60 --- /dev/null +++ b/examples/web/fastapi/routers.py @@ -0,0 +1,41 @@ +"""FastAPI routers.""" + +from datetime import datetime + +from fastapi import APIRouter +from pydantic import BaseModel + +router = APIRouter() + + +class BasicResponse(BaseModel): + code: int = 0 + message: str = 'ok' + item_id: str | None = None + + +@router.get( + '/hello/', + response_model=BasicResponse, + summary='API Summary', +) +async def hello() -> BasicResponse: + return BasicResponse() + + +class User(BaseModel): + id: int + name: str = 'Lucas' + signup_time: datetime | None = None + friends: list[str] = [] + + +@router.get('/model') +async def model() -> dict[str, str | list[str | datetime | None]]: + user_data: dict[str, str | list[str | datetime | None]] = { + 'id': '123', + 'signup_time': '2019-06-01 12:22', + 'friends': [], + } + + return user_data diff --git a/examples/web/fastapi/settings.py b/examples/web/fastapi/settings.py new file mode 100644 index 0000000..bc2dfaf --- /dev/null +++ b/examples/web/fastapi/settings.py @@ -0,0 +1,22 @@ +"""Settings.""" + +from functools import lru_cache + +from pydantic_settings import BaseSettings, SettingsConfigDict + + +class Settings(BaseSettings): + model_config = SettingsConfigDict( + env_file='.env', env_file_encoding='utf-8', extra='allow' + ) + + app_name: str + app_version: str = '0.1.0' + app_doc_url: str = '/docs' + app_description: str = '' + debug: bool = False + + +@lru_cache() +def get_settings() -> Settings: + return Settings() # pyright: ignore[reportCallIssue] diff --git a/examples/web/fastapi/settings_mongodb.py b/examples/web/fastapi/settings_mongodb.py new file mode 100644 index 0000000..1ca791b --- /dev/null +++ b/examples/web/fastapi/settings_mongodb.py @@ -0,0 +1,25 @@ +"""Settings with MongoDB.""" + +from functools import lru_cache + +from pydantic import MongoDsn +from pydantic_settings import BaseSettings, SettingsConfigDict + + +class Settings(BaseSettings): + model_config = SettingsConfigDict( + env_file='.env', env_file_encoding='utf-8', extra='allow' + ) + + app_name: str + app_version: str = '0.1.0' + app_doc_url: str = '/docs' + app_description: str = '' + debug: bool = False + mongodb_url: MongoDsn + mongodb_db_name: str + + +@lru_cache() +def get_settings() -> Settings: + return Settings() # pyright: ignore[reportCallIssue] diff --git a/examples/web/fastapi/static/redoc.standalone.js b/examples/web/fastapi/static/redoc.standalone.js new file mode 100644 index 0000000..8ce5ccb --- /dev/null +++ b/examples/web/fastapi/static/redoc.standalone.js @@ -0,0 +1,1809 @@ +/*! For license information please see redoc.standalone.js.LICENSE.txt */ +!function (e, t) { "object" == typeof exports && "object" == typeof module ? module.exports = t(require("null")) : "function" == typeof define && define.amd ? define(["null"], t) : "object" == typeof exports ? exports.Redoc = t(require("null")) : e.Redoc = t(e.null) }(this, (function (e) { + return function () { + var t = { + 5499: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = void 0; const r = n(3325), o = n(6479), i = n(5522), a = n(1603), s = ["/properties"], l = "http://json-schema.org/draft-07/schema"; class c extends r.default { _addVocabularies() { super._addVocabularies(), o.default.forEach((e => this.addVocabulary(e))), this.opts.discriminator && this.addKeyword(i.default) } _addDefaultMetaSchema() { if (super._addDefaultMetaSchema(), !this.opts.meta) return; const e = this.opts.$data ? this.$dataMetaSchema(a, s) : a; this.addMetaSchema(e, l, !1), this.refs["http://json-schema.org/schema"] = l } defaultMeta() { return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(l) ? l : void 0) } } e.exports = t = c, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = c; var u = n(1321); Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function () { return u.KeywordCxt } }); var p = n(4475); Object.defineProperty(t, "_", { enumerable: !0, get: function () { return p._ } }), Object.defineProperty(t, "str", { enumerable: !0, get: function () { return p.str } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function () { return p.stringify } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function () { return p.nil } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function () { return p.Name } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function () { return p.CodeGen } }) }, 4667: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.regexpCode = t.getProperty = t.safeStringify = t.stringify = t.strConcat = t.addCodeArg = t.str = t._ = t.nil = t._Code = t.Name = t.IDENTIFIER = t._CodeOrName = void 0; class n { } t._CodeOrName = n, t.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; class r extends n { constructor(e) { if (super(), !t.IDENTIFIER.test(e)) throw new Error("CodeGen: name must be a valid identifier"); this.str = e } toString() { return this.str } emptyStr() { return !1 } get names() { return { [this.str]: 1 } } } t.Name = r; class o extends n { constructor(e) { super(), this._items = "string" == typeof e ? [e] : e } toString() { return this.str } emptyStr() { if (this._items.length > 1) return !1; const e = this._items[0]; return "" === e || '""' === e } get str() { var e; return null !== (e = this._str) && void 0 !== e ? e : this._str = this._items.reduce(((e, t) => `${e}${t}`), "") } get names() { var e; return null !== (e = this._names) && void 0 !== e ? e : this._names = this._items.reduce(((e, t) => (t instanceof r && (e[t.str] = (e[t.str] || 0) + 1), e)), {}) } } function i(e, ...t) { const n = [e[0]]; let r = 0; for (; r < t.length;)l(n, t[r]), n.push(e[++r]); return new o(n) } t._Code = o, t.nil = new o(""), t._ = i; const a = new o("+"); function s(e, ...t) { const n = [u(e[0])]; let r = 0; for (; r < t.length;)n.push(a), l(n, t[r]), n.push(a, u(e[++r])); return function (e) { let t = 1; for (; t < e.length - 1;) { if (e[t] === a) { const n = c(e[t - 1], e[t + 1]); if (void 0 !== n) { e.splice(t - 1, 3, n); continue } e[t++] = "+" } t++ } }(n), new o(n) } function l(e, t) { var n; t instanceof o ? e.push(...t._items) : t instanceof r ? e.push(t) : e.push("number" == typeof (n = t) || "boolean" == typeof n || null === n ? n : u(Array.isArray(n) ? n.join(",") : n)) } function c(e, t) { if ('""' === t) return e; if ('""' === e) return t; if ("string" == typeof e) { if (t instanceof r || '"' !== e[e.length - 1]) return; return "string" != typeof t ? `${e.slice(0, -1)}${t}"` : '"' === t[0] ? e.slice(0, -1) + t.slice(1) : void 0 } return "string" != typeof t || '"' !== t[0] || e instanceof r ? void 0 : `"${e}${t.slice(1)}` } function u(e) { return JSON.stringify(e).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") } t.str = s, t.addCodeArg = l, t.strConcat = function (e, t) { return t.emptyStr() ? e : e.emptyStr() ? t : s`${e}${t}` }, t.stringify = function (e) { return new o(u(e)) }, t.safeStringify = u, t.getProperty = function (e) { return "string" == typeof e && t.IDENTIFIER.test(e) ? new o(`.${e}`) : i`[${e}]` }, t.regexpCode = function (e) { return new o(e.toString()) } }, 4475: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.or = t.and = t.not = t.CodeGen = t.operators = t.varKinds = t.ValueScopeName = t.ValueScope = t.Scope = t.Name = t.regexpCode = t.stringify = t.getProperty = t.nil = t.strConcat = t.str = t._ = void 0; const r = n(4667), o = n(7791); var i = n(4667); Object.defineProperty(t, "_", { enumerable: !0, get: function () { return i._ } }), Object.defineProperty(t, "str", { enumerable: !0, get: function () { return i.str } }), Object.defineProperty(t, "strConcat", { enumerable: !0, get: function () { return i.strConcat } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function () { return i.nil } }), Object.defineProperty(t, "getProperty", { enumerable: !0, get: function () { return i.getProperty } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function () { return i.stringify } }), Object.defineProperty(t, "regexpCode", { enumerable: !0, get: function () { return i.regexpCode } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function () { return i.Name } }); var a = n(7791); Object.defineProperty(t, "Scope", { enumerable: !0, get: function () { return a.Scope } }), Object.defineProperty(t, "ValueScope", { enumerable: !0, get: function () { return a.ValueScope } }), Object.defineProperty(t, "ValueScopeName", { enumerable: !0, get: function () { return a.ValueScopeName } }), Object.defineProperty(t, "varKinds", { enumerable: !0, get: function () { return a.varKinds } }), t.operators = { GT: new r._Code(">"), GTE: new r._Code(">="), LT: new r._Code("<"), LTE: new r._Code("<="), EQ: new r._Code("==="), NEQ: new r._Code("!=="), NOT: new r._Code("!"), OR: new r._Code("||"), AND: new r._Code("&&"), ADD: new r._Code("+") }; class s { optimizeNodes() { return this } optimizeNames(e, t) { return this } } class l extends s { constructor(e, t, n) { super(), this.varKind = e, this.name = t, this.rhs = n } render({ es5: e, _n: t }) { const n = e ? o.varKinds.var : this.varKind, r = void 0 === this.rhs ? "" : ` = ${this.rhs}`; return `${n} ${this.name}${r};` + t } optimizeNames(e, t) { if (e[this.name.str]) return this.rhs && (this.rhs = R(this.rhs, e, t)), this } get names() { return this.rhs instanceof r._CodeOrName ? this.rhs.names : {} } } class c extends s { constructor(e, t, n) { super(), this.lhs = e, this.rhs = t, this.sideEffects = n } render({ _n: e }) { return `${this.lhs} = ${this.rhs};` + e } optimizeNames(e, t) { if (!(this.lhs instanceof r.Name) || e[this.lhs.str] || this.sideEffects) return this.rhs = R(this.rhs, e, t), this } get names() { return C(this.lhs instanceof r.Name ? {} : { ...this.lhs.names }, this.rhs) } } class u extends c { constructor(e, t, n, r) { super(e, n, r), this.op = t } render({ _n: e }) { return `${this.lhs} ${this.op}= ${this.rhs};` + e } } class p extends s { constructor(e) { super(), this.label = e, this.names = {} } render({ _n: e }) { return `${this.label}:` + e } } class d extends s { constructor(e) { super(), this.label = e, this.names = {} } render({ _n: e }) { return `break${this.label ? ` ${this.label}` : ""};` + e } } class f extends s { constructor(e) { super(), this.error = e } render({ _n: e }) { return `throw ${this.error};` + e } get names() { return this.error.names } } class h extends s { constructor(e) { super(), this.code = e } render({ _n: e }) { return `${this.code};` + e } optimizeNodes() { return `${this.code}` ? this : void 0 } optimizeNames(e, t) { return this.code = R(this.code, e, t), this } get names() { return this.code instanceof r._CodeOrName ? this.code.names : {} } } class m extends s { constructor(e = []) { super(), this.nodes = e } render(e) { return this.nodes.reduce(((t, n) => t + n.render(e)), "") } optimizeNodes() { const { nodes: e } = this; let t = e.length; for (; t--;) { const n = e[t].optimizeNodes(); Array.isArray(n) ? e.splice(t, 1, ...n) : n ? e[t] = n : e.splice(t, 1) } return e.length > 0 ? this : void 0 } optimizeNames(e, t) { const { nodes: n } = this; let r = n.length; for (; r--;) { const o = n[r]; o.optimizeNames(e, t) || (j(e, o.names), n.splice(r, 1)) } return n.length > 0 ? this : void 0 } get names() { return this.nodes.reduce(((e, t) => $(e, t.names)), {}) } } class g extends m { render(e) { return "{" + e._n + super.render(e) + "}" + e._n } } class y extends m { } class v extends g { } v.kind = "else"; class b extends g { constructor(e, t) { super(t), this.condition = e } render(e) { let t = `if(${this.condition})` + super.render(e); return this.else && (t += "else " + this.else.render(e)), t } optimizeNodes() { super.optimizeNodes(); const e = this.condition; if (!0 === e) return this.nodes; let t = this.else; if (t) { const e = t.optimizeNodes(); t = this.else = Array.isArray(e) ? new v(e) : e } return t ? !1 === e ? t instanceof b ? t : t.nodes : this.nodes.length ? this : new b(T(e), t instanceof b ? [t] : t.nodes) : !1 !== e && this.nodes.length ? this : void 0 } optimizeNames(e, t) { var n; if (this.else = null === (n = this.else) || void 0 === n ? void 0 : n.optimizeNames(e, t), super.optimizeNames(e, t) || this.else) return this.condition = R(this.condition, e, t), this } get names() { const e = super.names; return C(e, this.condition), this.else && $(e, this.else.names), e } } b.kind = "if"; class w extends g { } w.kind = "for"; class x extends w { constructor(e) { super(), this.iteration = e } render(e) { return `for(${this.iteration})` + super.render(e) } optimizeNames(e, t) { if (super.optimizeNames(e, t)) return this.iteration = R(this.iteration, e, t), this } get names() { return $(super.names, this.iteration.names) } } class k extends w { constructor(e, t, n, r) { super(), this.varKind = e, this.name = t, this.from = n, this.to = r } render(e) { const t = e.es5 ? o.varKinds.var : this.varKind, { name: n, from: r, to: i } = this; return `for(${t} ${n}=${r}; ${n}<${i}; ${n}++)` + super.render(e) } get names() { const e = C(super.names, this.from); return C(e, this.to) } } class _ extends w { constructor(e, t, n, r) { super(), this.loop = e, this.varKind = t, this.name = n, this.iterable = r } render(e) { return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(e) } optimizeNames(e, t) { if (super.optimizeNames(e, t)) return this.iterable = R(this.iterable, e, t), this } get names() { return $(super.names, this.iterable.names) } } class O extends g { constructor(e, t, n) { super(), this.name = e, this.args = t, this.async = n } render(e) { return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(e) } } O.kind = "func"; class S extends m { render(e) { return "return " + super.render(e) } } S.kind = "return"; class E extends g { render(e) { let t = "try" + super.render(e); return this.catch && (t += this.catch.render(e)), this.finally && (t += this.finally.render(e)), t } optimizeNodes() { var e, t; return super.optimizeNodes(), null === (e = this.catch) || void 0 === e || e.optimizeNodes(), null === (t = this.finally) || void 0 === t || t.optimizeNodes(), this } optimizeNames(e, t) { var n, r; return super.optimizeNames(e, t), null === (n = this.catch) || void 0 === n || n.optimizeNames(e, t), null === (r = this.finally) || void 0 === r || r.optimizeNames(e, t), this } get names() { const e = super.names; return this.catch && $(e, this.catch.names), this.finally && $(e, this.finally.names), e } } class P extends g { constructor(e) { super(), this.error = e } render(e) { return `catch(${this.error})` + super.render(e) } } P.kind = "catch"; class A extends g { render(e) { return "finally" + super.render(e) } } function $(e, t) { for (const n in t) e[n] = (e[n] || 0) + (t[n] || 0); return e } function C(e, t) { return t instanceof r._CodeOrName ? $(e, t.names) : e } function R(e, t, n) { return e instanceof r.Name ? i(e) : (o = e) instanceof r._Code && o._items.some((e => e instanceof r.Name && 1 === t[e.str] && void 0 !== n[e.str])) ? new r._Code(e._items.reduce(((e, t) => (t instanceof r.Name && (t = i(t)), t instanceof r._Code ? e.push(...t._items) : e.push(t), e)), [])) : e; var o; function i(e) { const r = n[e.str]; return void 0 === r || 1 !== t[e.str] ? e : (delete t[e.str], r) } } function j(e, t) { for (const n in t) e[n] = (e[n] || 0) - (t[n] || 0) } function T(e) { return "boolean" == typeof e || "number" == typeof e || null === e ? !e : r._`!${L(e)}` } A.kind = "finally", t.CodeGen = class { constructor(e, t = {}) { this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...t, _n: t.lines ? "\n" : "" }, this._extScope = e, this._scope = new o.Scope({ parent: e }), this._nodes = [new y] } toString() { return this._root.render(this.opts) } name(e) { return this._scope.name(e) } scopeName(e) { return this._extScope.name(e) } scopeValue(e, t) { const n = this._extScope.value(e, t); return (this._values[n.prefix] || (this._values[n.prefix] = new Set)).add(n), n } getScopeValue(e, t) { return this._extScope.getValue(e, t) } scopeRefs(e) { return this._extScope.scopeRefs(e, this._values) } scopeCode() { return this._extScope.scopeCode(this._values) } _def(e, t, n, r) { const o = this._scope.toName(t); return void 0 !== n && r && (this._constants[o.str] = n), this._leafNode(new l(e, o, n)), o } const(e, t, n) { return this._def(o.varKinds.const, e, t, n) } let(e, t, n) { return this._def(o.varKinds.let, e, t, n) } var(e, t, n) { return this._def(o.varKinds.var, e, t, n) } assign(e, t, n) { return this._leafNode(new c(e, t, n)) } add(e, n) { return this._leafNode(new u(e, t.operators.ADD, n)) } code(e) { return "function" == typeof e ? e() : e !== r.nil && this._leafNode(new h(e)), this } object(...e) { const t = ["{"]; for (const [n, o] of e) t.length > 1 && t.push(","), t.push(n), (n !== o || this.opts.es5) && (t.push(":"), r.addCodeArg(t, o)); return t.push("}"), new r._Code(t) } if(e, t, n) { if (this._blockNode(new b(e)), t && n) this.code(t).else().code(n).endIf(); else if (t) this.code(t).endIf(); else if (n) throw new Error('CodeGen: "else" body without "then" body'); return this } elseIf(e) { return this._elseNode(new b(e)) } else() { return this._elseNode(new v) } endIf() { return this._endBlockNode(b, v) } _for(e, t) { return this._blockNode(e), t && this.code(t).endFor(), this } for(e, t) { return this._for(new x(e), t) } forRange(e, t, n, r, i = (this.opts.es5 ? o.varKinds.var : o.varKinds.let)) { const a = this._scope.toName(e); return this._for(new k(i, a, t, n), (() => r(a))) } forOf(e, t, n, i = o.varKinds.const) { const a = this._scope.toName(e); if (this.opts.es5) { const e = t instanceof r.Name ? t : this.var("_arr", t); return this.forRange("_i", 0, r._`${e}.length`, (t => { this.var(a, r._`${e}[${t}]`), n(a) })) } return this._for(new _("of", i, a, t), (() => n(a))) } forIn(e, t, n, i = (this.opts.es5 ? o.varKinds.var : o.varKinds.const)) { if (this.opts.ownProperties) return this.forOf(e, r._`Object.keys(${t})`, n); const a = this._scope.toName(e); return this._for(new _("in", i, a, t), (() => n(a))) } endFor() { return this._endBlockNode(w) } label(e) { return this._leafNode(new p(e)) } break(e) { return this._leafNode(new d(e)) } return(e) { const t = new S; if (this._blockNode(t), this.code(e), 1 !== t.nodes.length) throw new Error('CodeGen: "return" should have one node'); return this._endBlockNode(S) } try(e, t, n) { if (!t && !n) throw new Error('CodeGen: "try" without "catch" and "finally"'); const r = new E; if (this._blockNode(r), this.code(e), t) { const e = this.name("e"); this._currNode = r.catch = new P(e), t(e) } return n && (this._currNode = r.finally = new A, this.code(n)), this._endBlockNode(P, A) } throw(e) { return this._leafNode(new f(e)) } block(e, t) { return this._blockStarts.push(this._nodes.length), e && this.code(e).endBlock(t), this } endBlock(e) { const t = this._blockStarts.pop(); if (void 0 === t) throw new Error("CodeGen: not in self-balancing block"); const n = this._nodes.length - t; if (n < 0 || void 0 !== e && n !== e) throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`); return this._nodes.length = t, this } func(e, t = r.nil, n, o) { return this._blockNode(new O(e, t, n)), o && this.code(o).endFunc(), this } endFunc() { return this._endBlockNode(O) } optimize(e = 1) { for (; e-- > 0;)this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants) } _leafNode(e) { return this._currNode.nodes.push(e), this } _blockNode(e) { this._currNode.nodes.push(e), this._nodes.push(e) } _endBlockNode(e, t) { const n = this._currNode; if (n instanceof e || t && n instanceof t) return this._nodes.pop(), this; throw new Error(`CodeGen: not in block "${t ? `${e.kind}/${t.kind}` : e.kind}"`) } _elseNode(e) { const t = this._currNode; if (!(t instanceof b)) throw new Error('CodeGen: "else" without "if"'); return this._currNode = t.else = e, this } get _root() { return this._nodes[0] } get _currNode() { const e = this._nodes; return e[e.length - 1] } set _currNode(e) { const t = this._nodes; t[t.length - 1] = e } }, t.not = T; const I = D(t.operators.AND); t.and = function (...e) { return e.reduce(I) }; const N = D(t.operators.OR); function D(e) { return (t, n) => t === r.nil ? n : n === r.nil ? t : r._`${L(t)} ${e} ${L(n)}` } function L(e) { return e instanceof r.Name ? e : r._`(${e})` } t.or = function (...e) { return e.reduce(N) } }, 7791: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ValueScope = t.ValueScopeName = t.Scope = t.varKinds = t.UsedValueState = void 0; const r = n(4667); class o extends Error { constructor(e) { super(`CodeGen: "code" for ${e} not defined`), this.value = e.value } } var i; !function (e) { e[e.Started = 0] = "Started", e[e.Completed = 1] = "Completed" }(i = t.UsedValueState || (t.UsedValueState = {})), t.varKinds = { const: new r.Name("const"), let: new r.Name("let"), var: new r.Name("var") }; class a { constructor({ prefixes: e, parent: t } = {}) { this._names = {}, this._prefixes = e, this._parent = t } toName(e) { return e instanceof r.Name ? e : this.name(e) } name(e) { return new r.Name(this._newName(e)) } _newName(e) { return `${e}${(this._names[e] || this._nameGroup(e)).index++}` } _nameGroup(e) { var t, n; if ((null === (n = null === (t = this._parent) || void 0 === t ? void 0 : t._prefixes) || void 0 === n ? void 0 : n.has(e)) || this._prefixes && !this._prefixes.has(e)) throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`); return this._names[e] = { prefix: e, index: 0 } } } t.Scope = a; class s extends r.Name { constructor(e, t) { super(t), this.prefix = e } setValue(e, { property: t, itemIndex: n }) { this.value = e, this.scopePath = r._`.${new r.Name(t)}[${n}]` } } t.ValueScopeName = s; const l = r._`\n`; t.ValueScope = class extends a { constructor(e) { super(e), this._values = {}, this._scope = e.scope, this.opts = { ...e, _n: e.lines ? l : r.nil } } get() { return this._scope } name(e) { return new s(e, this._newName(e)) } value(e, t) { var n; if (void 0 === t.ref) throw new Error("CodeGen: ref must be passed in value"); const r = this.toName(e), { prefix: o } = r, i = null !== (n = t.key) && void 0 !== n ? n : t.ref; let a = this._values[o]; if (a) { const e = a.get(i); if (e) return e } else a = this._values[o] = new Map; a.set(i, r); const s = this._scope[o] || (this._scope[o] = []), l = s.length; return s[l] = t.ref, r.setValue(t, { property: o, itemIndex: l }), r } getValue(e, t) { const n = this._values[e]; if (n) return n.get(t) } scopeRefs(e, t = this._values) { return this._reduceValues(t, (t => { if (void 0 === t.scopePath) throw new Error(`CodeGen: name "${t}" has no value`); return r._`${e}${t.scopePath}` })) } scopeCode(e = this._values, t, n) { return this._reduceValues(e, (e => { if (void 0 === e.value) throw new Error(`CodeGen: name "${e}" has no value`); return e.value.code }), t, n) } _reduceValues(e, n, a = {}, s) { let l = r.nil; for (const c in e) { const u = e[c]; if (!u) continue; const p = a[c] = a[c] || new Map; u.forEach((e => { if (p.has(e)) return; p.set(e, i.Started); let a = n(e); if (a) { const n = this.opts.es5 ? t.varKinds.var : t.varKinds.const; l = r._`${l}${n} ${e} = ${a};${this.opts._n}` } else { if (!(a = null == s ? void 0 : s(e))) throw new o(e); l = r._`${l}${a}${this.opts._n}` } p.set(e, i.Completed) })) } return l } } }, 1885: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.extendErrors = t.resetErrorsCount = t.reportExtraError = t.reportError = t.keyword$DataError = t.keywordError = void 0; const r = n(4475), o = n(6124), i = n(5018); function a(e, t) { const n = e.const("err", t); e.if(r._`${i.default.vErrors} === null`, (() => e.assign(i.default.vErrors, r._`[${n}]`)), r._`${i.default.vErrors}.push(${n})`), e.code(r._`${i.default.errors}++`) } function s(e, t) { const { gen: n, validateName: o, schemaEnv: i } = e; i.$async ? n.throw(r._`new ${e.ValidationError}(${t})`) : (n.assign(r._`${o}.errors`, t), n.return(!1)) } t.keywordError = { message: ({ keyword: e }) => r.str`should pass "${e}" keyword validation` }, t.keyword$DataError = { message: ({ keyword: e, schemaType: t }) => t ? r.str`"${e}" keyword must be ${t} ($data)` : r.str`"${e}" keyword is invalid ($data)` }, t.reportError = function (e, n = t.keywordError, o, i) { const { it: l } = e, { gen: u, compositeRule: p, allErrors: d } = l, f = c(e, n, o); (null != i ? i : p || d) ? a(u, f) : s(l, r._`[${f}]`) }, t.reportExtraError = function (e, n = t.keywordError, r) { const { it: o } = e, { gen: l, compositeRule: u, allErrors: p } = o; a(l, c(e, n, r)), u || p || s(o, i.default.vErrors) }, t.resetErrorsCount = function (e, t) { e.assign(i.default.errors, t), e.if(r._`${i.default.vErrors} !== null`, (() => e.if(t, (() => e.assign(r._`${i.default.vErrors}.length`, t)), (() => e.assign(i.default.vErrors, null))))) }, t.extendErrors = function ({ gen: e, keyword: t, schemaValue: n, data: o, errsCount: a, it: s }) { if (void 0 === a) throw new Error("ajv implementation error"); const l = e.name("err"); e.forRange("i", a, i.default.errors, (a => { e.const(l, r._`${i.default.vErrors}[${a}]`), e.if(r._`${l}.instancePath === undefined`, (() => e.assign(r._`${l}.instancePath`, r.strConcat(i.default.instancePath, s.errorPath)))), e.assign(r._`${l}.schemaPath`, r.str`${s.errSchemaPath}/${t}`), s.opts.verbose && (e.assign(r._`${l}.schema`, n), e.assign(r._`${l}.data`, o)) })) }; const l = { keyword: new r.Name("keyword"), schemaPath: new r.Name("schemaPath"), params: new r.Name("params"), propertyName: new r.Name("propertyName"), message: new r.Name("message"), schema: new r.Name("schema"), parentSchema: new r.Name("parentSchema") }; function c(e, t, n) { const { createErrors: o } = e.it; return !1 === o ? r._`{}` : function (e, t, n = {}) { const { gen: o, it: a } = e, s = [u(a, n), p(e, n)]; return function (e, { params: t, message: n }, o) { const { keyword: a, data: s, schemaValue: c, it: u } = e, { opts: p, propertyName: d, topSchemaRef: f, schemaPath: h } = u; o.push([l.keyword, a], [l.params, "function" == typeof t ? t(e) : t || r._`{}`]), p.messages && o.push([l.message, "function" == typeof n ? n(e) : n]), p.verbose && o.push([l.schema, c], [l.parentSchema, r._`${f}${h}`], [i.default.data, s]), d && o.push([l.propertyName, d]) }(e, t, s), o.object(...s) }(e, t, n) } function u({ errorPath: e }, { instancePath: t }) { const n = t ? r.str`${e}${o.getErrorPath(t, o.Type.Str)}` : e; return [i.default.instancePath, r.strConcat(i.default.instancePath, n)] } function p({ keyword: e, it: { errSchemaPath: t } }, { schemaPath: n, parentSchema: i }) { let a = i ? t : r.str`${t}/${e}`; return n && (a = r.str`${a}${o.getErrorPath(n, o.Type.Str)}`), [l.schemaPath, a] } }, 7805: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.resolveSchema = t.getCompilingSchema = t.resolveRef = t.compileSchema = t.SchemaEnv = void 0; const r = n(4475), o = n(8451), i = n(5018), a = n(9826), s = n(6124), l = n(1321), c = n(540); class u { constructor(e) { var t; let n; this.refs = {}, this.dynamicAnchors = {}, "object" == typeof e.schema && (n = e.schema), this.schema = e.schema, this.schemaId = e.schemaId, this.root = e.root || this, this.baseId = null !== (t = e.baseId) && void 0 !== t ? t : a.normalizeId(null == n ? void 0 : n[e.schemaId || "$id"]), this.schemaPath = e.schemaPath, this.localRefs = e.localRefs, this.meta = e.meta, this.$async = null == n ? void 0 : n.$async, this.refs = {} } } function p(e) { const t = f.call(this, e); if (t) return t; const n = a.getFullPath(e.root.baseId), { es5: s, lines: c } = this.opts.code, { ownProperties: u } = this.opts, p = new r.CodeGen(this.scope, { es5: s, lines: c, ownProperties: u }); let d; e.$async && (d = p.scopeValue("Error", { ref: o.default, code: r._`require("ajv/dist/runtime/validation_error").default` })); const h = p.scopeName("validate"); e.validateName = h; const m = { gen: p, allErrors: this.opts.allErrors, data: i.default.data, parentData: i.default.parentData, parentDataProperty: i.default.parentDataProperty, dataNames: [i.default.data], dataPathArr: [r.nil], dataLevel: 0, dataTypes: [], definedProperties: new Set, topSchemaRef: p.scopeValue("schema", !0 === this.opts.code.source ? { ref: e.schema, code: r.stringify(e.schema) } : { ref: e.schema }), validateName: h, ValidationError: d, schema: e.schema, schemaEnv: e, rootId: n, baseId: e.baseId || n, schemaPath: r.nil, errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"), errorPath: r._`""`, opts: this.opts, self: this }; let g; try { this._compilations.add(e), l.validateFunctionCode(m), p.optimize(this.opts.code.optimize); const t = p.toString(); g = `const visitedNodesForRef = new WeakMap(); ${p.scopeRefs(i.default.scope)}return ${t}`, this.opts.code.process && (g = this.opts.code.process(g, e)); const n = new Function(`${i.default.self}`, `${i.default.scope}`, g)(this, this.scope.get()); if (this.scope.value(h, { ref: n }), n.errors = null, n.schema = e.schema, n.schemaEnv = e, e.$async && (n.$async = !0), !0 === this.opts.code.source && (n.source = { validateName: h, validateCode: t, scopeValues: p._values }), this.opts.unevaluated) { const { props: e, items: t } = m; n.evaluated = { props: e instanceof r.Name ? void 0 : e, items: t instanceof r.Name ? void 0 : t, dynamicProps: e instanceof r.Name, dynamicItems: t instanceof r.Name }, n.source && (n.source.evaluated = r.stringify(n.evaluated)) } return e.validate = n, e } catch (t) { throw delete e.validate, delete e.validateName, g && this.logger.error("Error compiling schema, function code:", g), t } finally { this._compilations.delete(e) } } function d(e) { return a.inlineRef(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : p.call(this, e) } function f(e) { for (const r of this._compilations) if (n = e, (t = r).schema === n.schema && t.root === n.root && t.baseId === n.baseId) return r; var t, n } function h(e, t) { let n; for (; "string" == typeof (n = this.refs[t]);)t = n; return n || this.schemas[t] || m.call(this, e, t) } function m(e, t) { const n = c.parse(t), r = a._getFullPath(n); let o = a.getFullPath(e.baseId); if (Object.keys(e.schema).length > 0 && r === o) return y.call(this, n, e); const i = a.normalizeId(r), s = this.refs[i] || this.schemas[i]; if ("string" == typeof s) { const t = m.call(this, e, s); if ("object" != typeof (null == t ? void 0 : t.schema)) return; return y.call(this, n, t) } if ("object" == typeof (null == s ? void 0 : s.schema)) { if (s.validate || p.call(this, s), i === a.normalizeId(t)) { const { schema: t } = s, { schemaId: n } = this.opts, r = t[n]; return r && (o = a.resolveUrl(o, r)), new u({ schema: t, schemaId: n, root: e, baseId: o }) } return y.call(this, n, s) } } t.SchemaEnv = u, t.compileSchema = p, t.resolveRef = function (e, t, n) { var r; const o = a.resolveUrl(t, n), i = e.refs[o]; if (i) return i; let s = h.call(this, e, o); if (void 0 === s) { const n = null === (r = e.localRefs) || void 0 === r ? void 0 : r[o], { schemaId: i } = this.opts; n && (s = new u({ schema: n, schemaId: i, root: e, baseId: t })) } if (void 0 === s && this.opts.loadSchemaSync) { const r = this.opts.loadSchemaSync(t, n, o); !r || this.refs[o] || this.schemas[o] || (this.addSchema(r, o, void 0), s = h.call(this, e, o)) } return void 0 !== s ? e.refs[o] = d.call(this, s) : void 0 }, t.getCompilingSchema = f, t.resolveSchema = m; const g = new Set(["properties", "patternProperties", "enum", "dependencies", "definitions"]); function y(e, { baseId: t, schema: n, root: r }) { var o; if ("/" !== (null === (o = e.fragment) || void 0 === o ? void 0 : o[0])) return; for (const r of e.fragment.slice(1).split("/")) { if ("boolean" == typeof n) return; if (void 0 === (n = n[s.unescapeFragment(r)])) return; const e = "object" == typeof n && n[this.opts.schemaId]; !g.has(r) && e && (t = a.resolveUrl(t, e)) } let i; if ("boolean" != typeof n && n.$ref && !s.schemaHasRulesButRef(n, this.RULES)) { const e = a.resolveUrl(t, n.$ref); i = m.call(this, r, e) } const { schemaId: l } = this.opts; return i = i || new u({ schema: n, schemaId: l, root: r, baseId: t }), i.schema !== i.root.schema ? i : void 0 } }, 5018: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = { data: new r.Name("data"), valCxt: new r.Name("valCxt"), instancePath: new r.Name("instancePath"), parentData: new r.Name("parentData"), parentDataProperty: new r.Name("parentDataProperty"), rootData: new r.Name("rootData"), dynamicAnchors: new r.Name("dynamicAnchors"), vErrors: new r.Name("vErrors"), errors: new r.Name("errors"), this: new r.Name("this"), self: new r.Name("self"), scope: new r.Name("scope"), json: new r.Name("json"), jsonPos: new r.Name("jsonPos"), jsonLen: new r.Name("jsonLen"), jsonPart: new r.Name("jsonPart") }; t.default = o }, 4143: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(9826); class o extends Error { constructor(e, t, n) { super(n || `can't resolve reference ${t} from id ${e}`), this.missingRef = r.resolveUrl(e, t), this.missingSchema = r.normalizeId(r.getFullPath(this.missingRef)) } } t.default = o }, 9826: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.getSchemaRefs = t.resolveUrl = t.normalizeId = t._getFullPath = t.getFullPath = t.inlineRef = void 0; const r = n(6124), o = n(4063), i = n(4029), a = n(540), s = new Set(["type", "format", "pattern", "maxLength", "minLength", "maxProperties", "minProperties", "maxItems", "minItems", "maximum", "minimum", "uniqueItems", "multipleOf", "required", "enum", "const"]); t.inlineRef = function (e, t = !0) { return "boolean" == typeof e || (!0 === t ? !c(e) : !!t && u(e) <= t) }; const l = new Set(["$ref", "$recursiveRef", "$recursiveAnchor", "$dynamicRef", "$dynamicAnchor"]); function c(e) { for (const t in e) { if (l.has(t)) return !0; const n = e[t]; if (Array.isArray(n) && n.some(c)) return !0; if ("object" == typeof n && c(n)) return !0 } return !1 } function u(e) { let t = 0; for (const n in e) { if ("$ref" === n) return 1 / 0; if (t++, !s.has(n) && ("object" == typeof e[n] && r.eachItem(e[n], (e => t += u(e))), t === 1 / 0)) return 1 / 0 } return t } function p(e = "", t) { return !1 !== t && (e = h(e)), d(a.parse(e)) } function d(e) { return a.serialize(e).split("#")[0] + "#" } t.getFullPath = p, t._getFullPath = d; const f = /#\/?$/; function h(e) { return e ? e.replace(f, "") : "" } t.normalizeId = h, t.resolveUrl = function (e, t) { return t = h(t), a.resolve(e, t) }; const m = /^[a-z_][-a-z0-9._]*$/i; t.getSchemaRefs = function (e) { if ("boolean" == typeof e) return {}; const { schemaId: t } = this.opts, n = h(e[t]), r = { "": n }, s = p(n, !1), l = {}, c = new Set; return i(e, { allKeys: !0 }, ((e, n, o, i) => { if (void 0 === i) return; const p = s + n; let f = r[i]; function g(t) { if (t = h(f ? a.resolve(f, t) : t), c.has(t)) throw d(t); c.add(t); let n = this.refs[t]; return "string" == typeof n && (n = this.refs[n]), "object" == typeof n ? u(e, n.schema, t) : t !== h(p) && ("#" === t[0] ? (u(e, l[t], t), l[t] = e) : this.refs[t] = p), t } function y(e) { if ("string" == typeof e) { if (!m.test(e)) throw new Error(`invalid anchor "${e}"`); g.call(this, `#${e}`) } } "string" == typeof e[t] && (f = g.call(this, e[t])), y.call(this, e.$anchor), y.call(this, e.$dynamicAnchor), r[n] = f })), l; function u(e, t, n) { if (void 0 !== t && !o(e, t)) throw d(n) } function d(e) { return new Error(`reference "${e}" resolves to more than one schema`) } } }, 3664: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.getRules = t.isJSONType = void 0; const n = new Set(["string", "number", "integer", "boolean", "null", "object", "array"]); t.isJSONType = function (e) { return "string" == typeof e && n.has(e) }, t.getRules = function () { const e = { number: { type: "number", rules: [] }, string: { type: "string", rules: [] }, array: { type: "array", rules: [] }, object: { type: "object", rules: [] } }; return { types: { ...e, integer: !0, boolean: !0, null: !0 }, rules: [{ rules: [] }, e.number, e.string, e.array, e.object], post: { rules: [] }, all: {}, keywords: {} } } }, 6124: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.checkStrictMode = t.getErrorPath = t.Type = t.useFunc = t.setEvaluated = t.evaluatedPropsToName = t.mergeEvaluated = t.eachItem = t.unescapeJsonPointer = t.escapeJsonPointer = t.escapeFragment = t.unescapeFragment = t.schemaRefOrVal = t.schemaHasRulesButRef = t.schemaHasRules = t.checkUnknownRules = t.alwaysValidSchema = t.toHash = void 0; const r = n(4475), o = n(4667); function i(e, t = e.schema) { const { opts: n, self: r } = e; if (!n.strictSchema) return; if ("boolean" == typeof t) return; const o = r.RULES.keywords; for (const n in t) o[n] || h(e, `unknown keyword: "${n}"`) } function a(e, t) { if ("boolean" == typeof e) return !e; for (const n in e) if (t[n]) return !0; return !1 } function s(e) { return "number" == typeof e ? `${e}` : e.replace(/~/g, "~0").replace(/\//g, "~1") } function l(e) { return e.replace(/~1/g, "/").replace(/~0/g, "~") } function c({ mergeNames: e, mergeToName: t, mergeValues: n, resultToName: o }) { return (i, a, s, l) => { const c = void 0 === s ? a : s instanceof r.Name ? (a instanceof r.Name ? e(i, a, s) : t(i, a, s), s) : a instanceof r.Name ? (t(i, s, a), a) : n(a, s); return l !== r.Name || c instanceof r.Name ? c : o(i, c) } } function u(e, t) { if (!0 === t) return e.var("props", !0); const n = e.var("props", r._`{}`); return void 0 !== t && p(e, n, t), n } function p(e, t, n) { Object.keys(n).forEach((n => e.assign(r._`${t}${r.getProperty(n)}`, !0))) } t.toHash = function (e) { const t = {}; for (const n of e) t[n] = !0; return t }, t.alwaysValidSchema = function (e, t) { return "boolean" == typeof t ? t : 0 === Object.keys(t).length || (i(e, t), !a(t, e.self.RULES.all)) }, t.checkUnknownRules = i, t.schemaHasRules = a, t.schemaHasRulesButRef = function (e, t) { if ("boolean" == typeof e) return !e; for (const n in e) if ("$ref" !== n && t.all[n]) return !0; return !1 }, t.schemaRefOrVal = function ({ topSchemaRef: e, schemaPath: t }, n, o, i) { if (!i) { if ("number" == typeof n || "boolean" == typeof n) return n; if ("string" == typeof n) return r._`${n}` } return r._`${e}${t}${r.getProperty(o)}` }, t.unescapeFragment = function (e) { return l(decodeURIComponent(e)) }, t.escapeFragment = function (e) { return encodeURIComponent(s(e)) }, t.escapeJsonPointer = s, t.unescapeJsonPointer = l, t.eachItem = function (e, t) { if (Array.isArray(e)) for (const n of e) t(n); else t(e) }, t.mergeEvaluated = { props: c({ mergeNames: (e, t, n) => e.if(r._`${n} !== true && ${t} !== undefined`, (() => { e.if(r._`${t} === true`, (() => e.assign(n, !0)), (() => e.assign(n, r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`))) })), mergeToName: (e, t, n) => e.if(r._`${n} !== true`, (() => { !0 === t ? e.assign(n, !0) : (e.assign(n, r._`${n} || {}`), p(e, n, t)) })), mergeValues: (e, t) => !0 === e || { ...e, ...t }, resultToName: u }), items: c({ mergeNames: (e, t, n) => e.if(r._`${n} !== true && ${t} !== undefined`, (() => e.assign(n, r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))), mergeToName: (e, t, n) => e.if(r._`${n} !== true`, (() => e.assign(n, !0 === t || r._`${n} > ${t} ? ${n} : ${t}`))), mergeValues: (e, t) => !0 === e || Math.max(e, t), resultToName: (e, t) => e.var("items", t) }) }, t.evaluatedPropsToName = u, t.setEvaluated = p; const d = {}; var f; function h(e, t, n = e.opts.strictSchema) { if (n) { if (t = `strict mode: ${t}`, !0 === n) throw new Error(t); e.self.logger.warn(t) } } t.useFunc = function (e, t) { return e.scopeValue("func", { ref: t, code: d[t.code] || (d[t.code] = new o._Code(t.code)) }) }, function (e) { e[e.Num = 0] = "Num", e[e.Str = 1] = "Str" }(f = t.Type || (t.Type = {})), t.getErrorPath = function (e, t, n) { if (e instanceof r.Name) { const o = t === f.Num; return n ? o ? r._`"[" + ${e} + "]"` : r._`"['" + ${e} + "']"` : o ? r._`"/" + ${e}` : r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")` } return n ? r.getProperty(e).toString() : "/" + s(e) }, t.checkStrictMode = h }, 4566: function (e, t) { "use strict"; function n(e, t) { return t.rules.some((t => r(e, t))) } function r(e, t) { var n; return void 0 !== e[t.keyword] || (null === (n = t.definition.implements) || void 0 === n ? void 0 : n.some((t => void 0 !== e[t]))) } Object.defineProperty(t, "__esModule", { value: !0 }), t.shouldUseRule = t.shouldUseGroup = t.schemaHasRulesForType = void 0, t.schemaHasRulesForType = function ({ schema: e, self: t }, r) { const o = t.RULES.types[r]; return o && !0 !== o && n(e, o) }, t.shouldUseGroup = n, t.shouldUseRule = r }, 7627: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.boolOrEmptySchema = t.topBoolOrEmptySchema = void 0; const r = n(1885), o = n(4475), i = n(5018), a = { message: "boolean schema is false" }; function s(e, t) { const { gen: n, data: o } = e, i = { gen: n, keyword: "false schema", data: o, schema: !1, schemaCode: !1, schemaValue: !1, params: {}, it: e }; r.reportError(i, a, void 0, t) } t.topBoolOrEmptySchema = function (e) { const { gen: t, schema: n, validateName: r } = e; !1 === n ? s(e, !1) : "object" == typeof n && !0 === n.$async ? t.return(i.default.data) : (t.assign(o._`${r}.errors`, null), t.return(!0)) }, t.boolOrEmptySchema = function (e, t) { const { gen: n, schema: r } = e; !1 === r ? (n.var(t, !1), s(e)) : n.var(t, !0) } }, 7927: function (e, t, n) { + "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.reportTypeError = t.checkDataTypes = t.checkDataType = t.coerceAndCheckDataType = t.getJSONTypes = t.getSchemaTypes = t.DataType = void 0; const r = n(3664), o = n(4566), i = n(1885), a = n(4475), s = n(6124); var l; function c(e) { const t = Array.isArray(e) ? e : e ? [e] : []; if (t.every(r.isJSONType)) return t; throw new Error("type must be JSONType or JSONType[]: " + t.join(",")) } !function (e) { e[e.Correct = 0] = "Correct", e[e.Wrong = 1] = "Wrong" }(l = t.DataType || (t.DataType = {})), t.getSchemaTypes = function (e) { const t = c(e.type); if (t.includes("null")) { if (!1 === e.nullable) throw new Error("type: null contradicts nullable: false") } else { if (!t.length && void 0 !== e.nullable) throw new Error('"nullable" cannot be used without "type"'); !0 === e.nullable && t.push("null") } return t }, t.getJSONTypes = c, t.coerceAndCheckDataType = function (e, t) { + const { gen: n, data: r, opts: i } = e, s = function (e, t) { return t ? e.filter((e => u.has(e) || "array" === t && "array" === e)) : [] }(t, i.coerceTypes), c = t.length > 0 && !(0 === s.length && 1 === t.length && o.schemaHasRulesForType(e, t[0])); if (c) { + const o = d(t, r, i.strictNumbers, l.Wrong); n.if(o, (() => { + s.length ? function (e, t, n) { + const { gen: r, data: o, opts: i } = e, s = r.let("dataType", a._`typeof ${o}`), l = r.let("coerced", a._`undefined`); "array" === i.coerceTypes && r.if(a._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`, (() => r.assign(o, a._`${o}[0]`).assign(s, a._`typeof ${o}`).if(d(t, o, i.strictNumbers), (() => r.assign(l, o))))), r.if(a._`${l} !== undefined`); for (const e of n) (u.has(e) || "array" === e && "array" === i.coerceTypes) && c(e); function c(e) { + switch (e) { + case "string": return void r.elseIf(a._`${s} == "number" || ${s} == "boolean"`).assign(l, a._`"" + ${o}`).elseIf(a._`${o} === null`).assign(l, a._`""`); case "number": return void r.elseIf(a._`${s} == "boolean" || ${o} === null + || (${s} == "string" && ${o} && ${o} == +${o})`).assign(l, a._`+${o}`); case "integer": return void r.elseIf(a._`${s} === "boolean" || ${o} === null + || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l, a._`+${o}`); case "boolean": return void r.elseIf(a._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l, !1).elseIf(a._`${o} === "true" || ${o} === 1`).assign(l, !0); case "null": return r.elseIf(a._`${o} === "" || ${o} === 0 || ${o} === false`), void r.assign(l, null); case "array": r.elseIf(a._`${s} === "string" || ${s} === "number" + || ${s} === "boolean" || ${o} === null`).assign(l, a._`[${o}]`) + } + } r.else(), h(e), r.endIf(), r.if(a._`${l} !== undefined`, (() => { r.assign(o, l), function ({ gen: e, parentData: t, parentDataProperty: n }, r) { e.if(a._`${t} !== undefined`, (() => e.assign(a._`${t}[${n}]`, r))) }(e, l) })) + }(e, t, s) : h(e) + })) + } return c + }; const u = new Set(["string", "number", "integer", "boolean", "null"]); function p(e, t, n, r = l.Correct) { const o = r === l.Correct ? a.operators.EQ : a.operators.NEQ; let i; switch (e) { case "null": return a._`${t} ${o} null`; case "array": i = a._`Array.isArray(${t})`; break; case "object": i = a._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`; break; case "integer": i = s(a._`!(${t} % 1) && !isNaN(${t})`); break; case "number": i = s(); break; default: return a._`typeof ${t} ${o} ${e}` }return r === l.Correct ? i : a.not(i); function s(e = a.nil) { return a.and(a._`typeof ${t} == "number"`, e, n ? a._`isFinite(${t})` : a.nil) } } function d(e, t, n, r) { if (1 === e.length) return p(e[0], t, n, r); let o; const i = s.toHash(e); if (i.array && i.object) { const e = a._`typeof ${t} != "object"`; o = i.null ? e : a._`!${t} || ${e}`, delete i.null, delete i.array, delete i.object } else o = a.nil; i.number && delete i.integer; for (const e in i) o = a.and(o, p(e, t, n, r)); return o } t.checkDataType = p, t.checkDataTypes = d; const f = { message: ({ schema: e }) => `must be ${e}`, params: ({ schema: e, schemaValue: t }) => "string" == typeof e ? a._`{type: ${e}}` : a._`{type: ${t}}` }; function h(e) { const t = function (e) { const { gen: t, data: n, schema: r } = e, o = s.schemaRefOrVal(e, r, "type"); return { gen: t, keyword: "type", data: n, schema: r.type, schemaCode: o, schemaValue: o, parentSchema: r, params: {}, it: e } }(e); i.reportError(t, f) } t.reportTypeError = h + }, 2537: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.assignDefaults = void 0; const r = n(4475), o = n(6124); function i(e, t, n) { const { gen: i, compositeRule: a, data: s, opts: l } = e; if (void 0 === n) return; const c = r._`${s}${r.getProperty(t)}`; if (a) return void o.checkStrictMode(e, `default is ignored for: ${c}`); let u = r._`${c} === undefined`; "empty" === l.useDefaults && (u = r._`${u} || ${c} === null || ${c} === ""`), i.if(u, r._`${c} = ${r.stringify(n)}`) } t.assignDefaults = function (e, t) { const { properties: n, items: r } = e.schema; if ("object" === t && n) for (const t in n) i(e, t, n[t].default); else "array" === t && Array.isArray(r) && r.forEach(((t, n) => i(e, n, t.default))) } }, 1321: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.getData = t.KeywordCxt = t.validateFunctionCode = void 0; const r = n(7627), o = n(7927), i = n(4566), a = n(7927), s = n(2537), l = n(6488), c = n(4688), u = n(4475), p = n(5018), d = n(9826), f = n(6124), h = n(1885); function m({ gen: e, validateName: t, schema: n, schemaEnv: r, opts: o }, i) { o.code.es5 ? e.func(t, u._`${p.default.data}, ${p.default.valCxt}`, r.$async, (() => { e.code(u._`"use strict"; ${g(n, o)}`), function (e, t) { e.if(p.default.valCxt, (() => { e.var(p.default.instancePath, u._`${p.default.valCxt}.${p.default.instancePath}`), e.var(p.default.parentData, u._`${p.default.valCxt}.${p.default.parentData}`), e.var(p.default.parentDataProperty, u._`${p.default.valCxt}.${p.default.parentDataProperty}`), e.var(p.default.rootData, u._`${p.default.valCxt}.${p.default.rootData}`), t.dynamicRef && e.var(p.default.dynamicAnchors, u._`${p.default.valCxt}.${p.default.dynamicAnchors}`) }), (() => { e.var(p.default.instancePath, u._`""`), e.var(p.default.parentData, u._`undefined`), e.var(p.default.parentDataProperty, u._`undefined`), e.var(p.default.rootData, p.default.data), t.dynamicRef && e.var(p.default.dynamicAnchors, u._`{}`) })) }(e, o), e.code(i) })) : e.func(t, u._`${p.default.data}, ${function (e) { return u._`{${p.default.instancePath}="", ${p.default.parentData}, ${p.default.parentDataProperty}, ${p.default.rootData}=${p.default.data}${e.dynamicRef ? u._`, ${p.default.dynamicAnchors}={}` : u.nil}}={}` }(o)}`, r.$async, (() => e.code(g(n, o)).code(i))) } function g(e, t) { const n = "object" == typeof e && e[t.schemaId]; return n && (t.code.source || t.code.process) ? u._`/*# sourceURL=${n} */` : u.nil } function y({ schema: e, self: t }) { if ("boolean" == typeof e) return !e; for (const n in e) if (t.RULES.all[n]) return !0; return !1 } function v(e) { return "boolean" != typeof e.schema } function b(e) { f.checkUnknownRules(e), function (e) { const { schema: t, errSchemaPath: n, opts: r, self: o } = e; t.$ref && r.ignoreKeywordsWithRef && f.schemaHasRulesButRef(t, o.RULES) && o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`) }(e) } function w(e, t) { if (e.opts.jtd) return k(e, [], !1, t); const n = o.getSchemaTypes(e.schema); k(e, n, !o.coerceAndCheckDataType(e, n), t) } function x({ gen: e, schemaEnv: t, schema: n, errSchemaPath: r, opts: o }) { const i = n.$comment; if (!0 === o.$comment) e.code(u._`${p.default.self}.logger.log(${i})`); else if ("function" == typeof o.$comment) { const n = u.str`${r}/$comment`, o = e.scopeValue("root", { ref: t.root }); e.code(u._`${p.default.self}.opts.$comment(${i}, ${n}, ${o}.schema)`) } } function k(e, t, n, r) { const { gen: o, schema: s, data: l, allErrors: c, opts: d, self: h } = e, { RULES: m } = h; function g(f) { i.shouldUseGroup(s, f) && (f.type ? (o.if(a.checkDataType(f.type, l, d.strictNumbers)), _(e, f), 1 === t.length && t[0] === f.type && n && (o.else(), a.reportTypeError(e)), o.endIf()) : _(e, f), c || o.if(u._`${p.default.errors} === ${r || 0}`)) } !s.$ref || !d.ignoreKeywordsWithRef && f.schemaHasRulesButRef(s, m) ? (d.jtd || function (e, t) { !e.schemaEnv.meta && e.opts.strictTypes && (function (e, t) { t.length && (e.dataTypes.length ? (t.forEach((t => { O(e.dataTypes, t) || S(e, `type "${t}" not allowed by context "${e.dataTypes.join(",")}"`) })), e.dataTypes = e.dataTypes.filter((e => O(t, e)))) : e.dataTypes = t) }(e, t), e.opts.allowUnionTypes || function (e, t) { t.length > 1 && (2 !== t.length || !t.includes("null")) && S(e, "use allowUnionTypes to allow union type keyword") }(e, t), function (e, t) { const n = e.self.RULES.all; for (const r in n) { const o = n[r]; if ("object" == typeof o && i.shouldUseRule(e.schema, o)) { const { type: n } = o.definition; n.length && !n.some((e => { return r = e, (n = t).includes(r) || "number" === r && n.includes("integer"); var n, r })) && S(e, `missing type "${n.join(",")}" for keyword "${r}"`) } } }(e, e.dataTypes)) }(e, t), o.block((() => { for (const e of m.rules) g(e); g(m.post) }))) : o.block((() => P(e, "$ref", m.all.$ref.definition))) } function _(e, t) { const { gen: n, schema: r, opts: { useDefaults: o } } = e; o && s.assignDefaults(e, t.type), n.block((() => { for (const n of t.rules) i.shouldUseRule(r, n) && P(e, n.keyword, n.definition, t.type) })) } function O(e, t) { return e.includes(t) || "integer" === t && e.includes("number") } function S(e, t) { t += ` at "${e.schemaEnv.baseId + e.errSchemaPath}" (strictTypes)`, f.checkStrictMode(e, t, e.opts.strictTypes) } t.validateFunctionCode = function (e) { v(e) && (b(e), y(e)) ? function (e) { const { schema: t, opts: n, gen: r } = e; m(e, (() => { n.$comment && t.$comment && x(e), function (e) { const { schema: t, opts: n } = e; void 0 !== t.default && n.useDefaults && n.strictSchema && f.checkStrictMode(e, "default is ignored in the schema root") }(e), r.let(p.default.vErrors, null), r.let(p.default.errors, 0), n.unevaluated && function (e) { const { gen: t, validateName: n } = e; e.evaluated = t.const("evaluated", u._`${n}.evaluated`), t.if(u._`${e.evaluated}.dynamicProps`, (() => t.assign(u._`${e.evaluated}.props`, u._`undefined`))), t.if(u._`${e.evaluated}.dynamicItems`, (() => t.assign(u._`${e.evaluated}.items`, u._`undefined`))) }(e), w(e), function (e) { const { gen: t, schemaEnv: n, validateName: r, ValidationError: o, opts: i } = e; n.$async ? t.if(u._`${p.default.errors} === 0`, (() => t.return(p.default.data)), (() => t.throw(u._`new ${o}(${p.default.vErrors})`))) : (t.assign(u._`${r}.errors`, p.default.vErrors), i.unevaluated && function ({ gen: e, evaluated: t, props: n, items: r }) { n instanceof u.Name && e.assign(u._`${t}.props`, n), r instanceof u.Name && e.assign(u._`${t}.items`, r) }(e), t.return(u._`${p.default.errors} === 0`)) }(e) })) }(e) : m(e, (() => r.topBoolOrEmptySchema(e))) }; class E { constructor(e, t, n) { if (l.validateKeywordUsage(e, t, n), this.gen = e.gen, this.allErrors = e.allErrors, this.keyword = n, this.data = e.data, this.schema = e.schema[n], this.$data = t.$data && e.opts.$data && this.schema && this.schema.$data, this.schemaValue = f.schemaRefOrVal(e, this.schema, n, this.$data), this.schemaType = t.schemaType, this.parentSchema = e.schema, this.params = {}, this.it = e, this.def = t, this.$data) this.schemaCode = e.gen.const("vSchema", C(this.$data, e)); else if (this.schemaCode = this.schemaValue, !l.validSchemaType(this.schema, t.schemaType, t.allowUndefined)) throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`); ("code" in t ? t.trackErrors : !1 !== t.errors) && (this.errsCount = e.gen.const("_errs", p.default.errors)) } result(e, t, n) { this.gen.if(u.not(e)), n ? n() : this.error(), t ? (this.gen.else(), t(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else() } pass(e, t) { this.result(e, void 0, t) } fail(e) { if (void 0 === e) return this.error(), void (this.allErrors || this.gen.if(!1)); this.gen.if(e), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else() } fail$data(e) { if (!this.$data) return this.fail(e); const { schemaCode: t } = this; this.fail(u._`${t} !== undefined && (${u.or(this.invalid$data(), e)})`) } error(e, t, n) { if (t) return this.setParams(t), this._error(e, n), void this.setParams({}); this._error(e, n) } _error(e, t) { (e ? h.reportExtraError : h.reportError)(this, this.def.error, t) } $dataError() { h.reportError(this, this.def.$dataError || h.keyword$DataError) } reset() { if (void 0 === this.errsCount) throw new Error('add "trackErrors" to keyword definition'); h.resetErrorsCount(this.gen, this.errsCount) } ok(e) { this.allErrors || this.gen.if(e) } setParams(e, t) { t ? Object.assign(this.params, e) : this.params = e } block$data(e, t, n = u.nil) { this.gen.block((() => { this.check$data(e, n), t() })) } check$data(e = u.nil, t = u.nil) { if (!this.$data) return; const { gen: n, schemaCode: r, schemaType: o, def: i } = this; n.if(u.or(u._`${r} === undefined`, t)), e !== u.nil && n.assign(e, !0), (o.length || i.validateSchema) && (n.elseIf(this.invalid$data()), this.$dataError(), e !== u.nil && n.assign(e, !1)), n.else() } invalid$data() { const { gen: e, schemaCode: t, schemaType: n, def: r, it: o } = this; return u.or(function () { if (n.length) { if (!(t instanceof u.Name)) throw new Error("ajv implementation error"); const e = Array.isArray(n) ? n : [n]; return u._`${a.checkDataTypes(e, t, o.opts.strictNumbers, a.DataType.Wrong)}` } return u.nil }(), function () { if (r.validateSchema) { const n = e.scopeValue("validate$data", { ref: r.validateSchema }); return u._`!${n}(${t})` } return u.nil }()) } subschema(e, t) { const n = c.getSubschema(this.it, e); c.extendSubschemaData(n, this.it, e), c.extendSubschemaMode(n, e); const o = { ...this.it, ...n, items: void 0, props: void 0 }; return function (e, t) { v(e) && (b(e), y(e)) ? function (e, t) { const { schema: n, gen: r, opts: o } = e; o.$comment && n.$comment && x(e), function (e) { const t = e.schema[e.opts.schemaId]; t && (e.baseId = d.resolveUrl(e.baseId, t)) }(e), function (e) { if (e.schema.$async && !e.schemaEnv.$async) throw new Error("async schema in sync schema") }(e); const i = r.const("_errs", p.default.errors); w(e, i), r.var(t, u._`${i} === ${p.default.errors}`) }(e, t) : r.boolOrEmptySchema(e, t) }(o, t), o } mergeEvaluated(e, t) { const { it: n, gen: r } = this; n.opts.unevaluated && (!0 !== n.props && void 0 !== e.props && (n.props = f.mergeEvaluated.props(r, e.props, n.props, t)), !0 !== n.items && void 0 !== e.items && (n.items = f.mergeEvaluated.items(r, e.items, n.items, t))) } mergeValidEvaluated(e, t) { const { it: n, gen: r } = this; if (n.opts.unevaluated && (!0 !== n.props || !0 !== n.items)) return r.if(t, (() => this.mergeEvaluated(e, u.Name))), !0 } } function P(e, t, n, r) { const o = new E(e, n, t); "code" in n ? n.code(o, r) : o.$data && n.validate ? l.funcKeywordCode(o, n) : "macro" in n ? l.macroKeywordCode(o, n) : (n.compile || n.validate) && l.funcKeywordCode(o, n) } t.KeywordCxt = E; const A = /^\/(?:[^~]|~0|~1)*$/, $ = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; function C(e, { dataLevel: t, dataNames: n, dataPathArr: r }) { let o, i; if ("" === e) return p.default.rootData; if ("/" === e[0]) { if (!A.test(e)) throw new Error(`Invalid JSON-pointer: ${e}`); o = e, i = p.default.rootData } else { const a = $.exec(e); if (!a) throw new Error(`Invalid JSON-pointer: ${e}`); const s = +a[1]; if (o = a[2], "#" === o) { if (s >= t) throw new Error(l("property/index", s)); return r[t - s] } if (s > t) throw new Error(l("data", s)); if (i = n[t - s], !o) return i } let a = i; const s = o.split("/"); for (const e of s) e && (i = u._`${i}${u.getProperty(f.unescapeJsonPointer(e))}`, a = u._`${a} && ${i}`); return a; function l(e, n) { return `Cannot access ${e} ${n} levels up, current level is ${t}` } } t.getData = C }, 6488: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.validateKeywordUsage = t.validSchemaType = t.funcKeywordCode = t.macroKeywordCode = void 0; const r = n(4475), o = n(5018), i = n(8619), a = n(1885); function s(e) { const { gen: t, data: n, it: o } = e; t.if(o.parentData, (() => t.assign(n, r._`${o.parentData}[${o.parentDataProperty}]`))) } function l(e, t, n) { if (void 0 === n) throw new Error(`keyword "${t}" failed to compile`); return e.scopeValue("keyword", "function" == typeof n ? { ref: n } : { ref: n, code: r.stringify(n) }) } t.macroKeywordCode = function (e, t) { const { gen: n, keyword: o, schema: i, parentSchema: a, it: s } = e, c = t.macro.call(s.self, i, a, s), u = l(n, o, c); !1 !== s.opts.validateSchema && s.self.validateSchema(c, !0); const p = n.name("valid"); e.subschema({ schema: c, schemaPath: r.nil, errSchemaPath: `${s.errSchemaPath}/${o}`, topSchemaRef: u, compositeRule: !0 }, p), e.pass(p, (() => e.error(!0))) }, t.funcKeywordCode = function (e, t) { var n; const { gen: c, keyword: u, schema: p, parentSchema: d, $data: f, it: h } = e; !function ({ schemaEnv: e }, t) { if (t.async && !e.$async) throw new Error("async keyword in sync schema") }(h, t); const m = !f && t.compile ? t.compile.call(h.self, p, d, h) : t.validate, g = l(c, u, m), y = c.let("valid"); function v(n = (t.async ? r._`await ` : r.nil)) { const a = h.opts.passContext ? o.default.this : o.default.self, s = !("compile" in t && !f || !1 === t.schema); c.assign(y, r._`${n}${i.callValidateCode(e, g, a, s)}`, t.modifying) } function b(e) { var n; c.if(r.not(null !== (n = t.valid) && void 0 !== n ? n : y), e) } e.block$data(y, (function () { if (!1 === t.errors) v(), t.modifying && s(e), b((() => e.error())); else { const n = t.async ? function () { const e = c.let("ruleErrs", null); return c.try((() => v(r._`await `)), (t => c.assign(y, !1).if(r._`${t} instanceof ${h.ValidationError}`, (() => c.assign(e, r._`${t}.errors`)), (() => c.throw(t))))), e }() : function () { const e = r._`${g}.errors`; return c.assign(e, null), v(r.nil), e }(); t.modifying && s(e), b((() => function (e, t) { const { gen: n } = e; n.if(r._`Array.isArray(${t})`, (() => { n.assign(o.default.vErrors, r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors, r._`${o.default.vErrors}.length`), a.extendErrors(e) }), (() => e.error())) }(e, n))) } })), e.ok(null !== (n = t.valid) && void 0 !== n ? n : y) }, t.validSchemaType = function (e, t, n = !1) { return !t.length || t.some((t => "array" === t ? Array.isArray(e) : "object" === t ? e && "object" == typeof e && !Array.isArray(e) : typeof e == t || n && void 0 === e)) }, t.validateKeywordUsage = function ({ schema: e, opts: t, self: n, errSchemaPath: r }, o, i) { if (Array.isArray(o.keyword) ? !o.keyword.includes(i) : o.keyword !== i) throw new Error("ajv implementation error"); const a = o.dependencies; if (null == a ? void 0 : a.some((t => !Object.prototype.hasOwnProperty.call(e, t)))) throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`); if (o.validateSchema && !o.validateSchema(e[i])) { const e = `keyword "${i}" value is invalid at path "${r}": ` + n.errorsText(o.validateSchema.errors); if ("log" !== t.validateSchema) throw new Error(e); n.logger.error(e) } } }, 4688: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.extendSubschemaMode = t.extendSubschemaData = t.getSubschema = void 0; const r = n(4475), o = n(6124); t.getSubschema = function (e, { keyword: t, schemaProp: n, schema: i, schemaPath: a, errSchemaPath: s, topSchemaRef: l }) { if (void 0 !== t && void 0 !== i) throw new Error('both "keyword" and "schema" passed, only one allowed'); if (void 0 !== t) { const i = e.schema[t]; return void 0 === n ? { schema: i, schemaPath: r._`${e.schemaPath}${r.getProperty(t)}`, errSchemaPath: `${e.errSchemaPath}/${t}` } : { schema: i[n], schemaPath: r._`${e.schemaPath}${r.getProperty(t)}${r.getProperty(n)}`, errSchemaPath: `${e.errSchemaPath}/${t}/${o.escapeFragment(n)}` } } if (void 0 !== i) { if (void 0 === a || void 0 === s || void 0 === l) throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); return { schema: i, schemaPath: a, topSchemaRef: l, errSchemaPath: s } } throw new Error('either "keyword" or "schema" must be passed') }, t.extendSubschemaData = function (e, t, { dataProp: n, dataPropType: i, data: a, dataTypes: s, propertyName: l }) { if (void 0 !== a && void 0 !== n) throw new Error('both "data" and "dataProp" passed, only one allowed'); const { gen: c } = t; if (void 0 !== n) { const { errorPath: a, dataPathArr: s, opts: l } = t; u(c.let("data", r._`${t.data}${r.getProperty(n)}`, !0)), e.errorPath = r.str`${a}${o.getErrorPath(n, i, l.jsPropertySyntax)}`, e.parentDataProperty = r._`${n}`, e.dataPathArr = [...s, e.parentDataProperty] } function u(n) { e.data = n, e.dataLevel = t.dataLevel + 1, e.dataTypes = [], t.definedProperties = new Set, e.parentData = t.data, e.dataNames = [...t.dataNames, n] } void 0 !== a && (u(a instanceof r.Name ? a : c.let("data", a, !0)), void 0 !== l && (e.propertyName = l)), s && (e.dataTypes = s) }, t.extendSubschemaMode = function (e, { jtdDiscriminator: t, jtdMetadata: n, compositeRule: r, createErrors: o, allErrors: i }) { void 0 !== r && (e.compositeRule = r), void 0 !== o && (e.createErrors = o), void 0 !== i && (e.allErrors = i), e.jtdDiscriminator = t, e.jtdMetadata = n } }, 3325: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.CodeGen = t.Name = t.nil = t.stringify = t.str = t._ = t.KeywordCxt = void 0; var r = n(1321); Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function () { return r.KeywordCxt } }); var o = n(4475); Object.defineProperty(t, "_", { enumerable: !0, get: function () { return o._ } }), Object.defineProperty(t, "str", { enumerable: !0, get: function () { return o.str } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function () { return o.stringify } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function () { return o.nil } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function () { return o.Name } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function () { return o.CodeGen } }); const i = n(8451), a = n(4143), s = n(3664), l = n(7805), c = n(4475), u = n(9826), p = n(7927), d = n(6124), f = n(425), h = ["removeAdditional", "useDefaults", "coerceTypes"], m = new Set(["validate", "serialize", "parse", "wrapper", "root", "schema", "keyword", "pattern", "formats", "validate$data", "func", "obj", "Error"]), g = { errorDataPath: "", format: "`validateFormats: false` can be used instead.", nullable: '"nullable" keyword is supported by default.', jsonPointers: "Deprecated jsPropertySyntax can be used instead.", extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", sourceCode: "Use option `code: {source: true}`", strictDefaults: "It is default now, see option `strict`.", strictKeywords: "It is default now, see option `strict`.", uniqueItems: '"uniqueItems" keyword is always validated.', unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", cache: "Map is used as cache, schema object as key.", serialize: "Map is used as cache, schema object as key.", ajvErrors: "It is default now." }, y = { ignoreKeywordsWithRef: "", jsPropertySyntax: "", unicode: '"minLength"/"maxLength" account for unicode characters by default.' }; function v(e) { var t, n, r, o, i, a, s, l, c, u, p, d, f, h, m, g, y, v, b, w, x, k; const _ = e.strict, O = null === (t = e.code) || void 0 === t ? void 0 : t.optimize, S = !0 === O || void 0 === O ? 1 : O || 0; return { strictSchema: null === (r = null !== (n = e.strictSchema) && void 0 !== n ? n : _) || void 0 === r || r, strictNumbers: null === (i = null !== (o = e.strictNumbers) && void 0 !== o ? o : _) || void 0 === i || i, strictTypes: null !== (s = null !== (a = e.strictTypes) && void 0 !== a ? a : _) && void 0 !== s ? s : "log", strictTuples: null !== (c = null !== (l = e.strictTuples) && void 0 !== l ? l : _) && void 0 !== c ? c : "log", strictRequired: null !== (p = null !== (u = e.strictRequired) && void 0 !== u ? u : _) && void 0 !== p && p, code: e.code ? { ...e.code, optimize: S } : { optimize: S }, loopRequired: null !== (d = e.loopRequired) && void 0 !== d ? d : 200, loopEnum: null !== (f = e.loopEnum) && void 0 !== f ? f : 200, meta: null === (h = e.meta) || void 0 === h || h, messages: null === (m = e.messages) || void 0 === m || m, inlineRefs: null === (g = e.inlineRefs) || void 0 === g || g, schemaId: null !== (y = e.schemaId) && void 0 !== y ? y : "$id", addUsedSchema: null === (v = e.addUsedSchema) || void 0 === v || v, validateSchema: null === (b = e.validateSchema) || void 0 === b || b, validateFormats: null === (w = e.validateFormats) || void 0 === w || w, unicodeRegExp: null === (x = e.unicodeRegExp) || void 0 === x || x, int32range: null === (k = e.int32range) || void 0 === k || k } } class b { constructor(e = {}) { this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = new Set, this._loading = {}, this._cache = new Map, e = this.opts = { ...e, ...v(e) }; const { es5: t, lines: n } = this.opts.code; this.scope = new c.ValueScope({ scope: {}, prefixes: m, es5: t, lines: n }), this.logger = function (e) { if (!1 === e) return E; if (void 0 === e) return console; if (e.log && e.warn && e.error) return e; throw new Error("logger must implement log, warn and error methods") }(e.logger); const r = e.validateFormats; e.validateFormats = !1, this.RULES = s.getRules(), w.call(this, g, e, "NOT SUPPORTED"), w.call(this, y, e, "DEPRECATED", "warn"), this._metaOpts = S.call(this), e.formats && _.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), e.keywords && O.call(this, e.keywords), "object" == typeof e.meta && this.addMetaSchema(e.meta), k.call(this), e.validateFormats = r } _addVocabularies() { this.addKeyword("$async") } _addDefaultMetaSchema() { const { $data: e, meta: t, schemaId: n } = this.opts; let r = f; "id" === n && (r = { ...f }, r.id = r.$id, delete r.$id), t && e && this.addMetaSchema(r, r[n], !1) } defaultMeta() { const { meta: e, schemaId: t } = this.opts; return this.opts.defaultMeta = "object" == typeof e ? e[t] || e : void 0 } validate(e, t) { let n; if ("string" == typeof e) { if (n = this.getSchema(e), !n) throw new Error(`no schema with key or ref "${e}"`) } else n = this.compile(e); const r = n(t); return "$async" in n || (this.errors = n.errors), r } compile(e, t) { const n = this._addSchema(e, t); return n.validate || this._compileSchemaEnv(n) } compileAsync(e, t) { if ("function" != typeof this.opts.loadSchema) throw new Error("options.loadSchema should be a function"); const { loadSchema: n } = this.opts; return r.call(this, e, t); async function r(e, t) { await o.call(this, e.$schema); const n = this._addSchema(e, t); return n.validate || i.call(this, n) } async function o(e) { e && !this.getSchema(e) && await r.call(this, { $ref: e }, !0) } async function i(e) { try { return this._compileSchemaEnv(e) } catch (t) { if (!(t instanceof a.default)) throw t; return s.call(this, t), await l.call(this, t.missingSchema), i.call(this, e) } } function s({ missingSchema: e, missingRef: t }) { if (this.refs[e]) throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`) } async function l(e) { const n = await c.call(this, e); this.refs[e] || await o.call(this, n.$schema), this.refs[e] || this.addSchema(n, e, t) } async function c(e) { const t = this._loading[e]; if (t) return t; try { return await (this._loading[e] = n(e)) } finally { delete this._loading[e] } } } addSchema(e, t, n, r = this.opts.validateSchema) { if (Array.isArray(e)) { for (const t of e) this.addSchema(t, void 0, n, r); return this } let o; if ("object" == typeof e) { const { schemaId: t } = this.opts; if (o = e[t], void 0 !== o && "string" != typeof o) throw new Error(`schema ${t} must be string`) } return t = u.normalizeId(t || o), this._checkUnique(t), this.schemas[t] = this._addSchema(e, n, t, r, !0), this } addMetaSchema(e, t, n = this.opts.validateSchema) { return this.addSchema(e, t, !0, n), this } validateSchema(e, t) { if ("boolean" == typeof e) return !0; let n; if (n = e.$schema, void 0 !== n && "string" != typeof n) throw new Error("$schema must be a string"); if (n = n || this.opts.defaultMeta || this.defaultMeta(), !n) return this.logger.warn("meta-schema not available"), this.errors = null, !0; const r = this.validate(n, e); if (!r && t) { const e = "schema is invalid: " + this.errorsText(); if ("log" !== this.opts.validateSchema) throw new Error(e); this.logger.error(e) } return r } getSchema(e) { let t; for (; "string" == typeof (t = x.call(this, e));)e = t; if (void 0 === t) { const { schemaId: n } = this.opts, r = new l.SchemaEnv({ schema: {}, schemaId: n }); if (t = l.resolveSchema.call(this, r, e), !t) return; this.refs[e] = t } return t.validate || this._compileSchemaEnv(t) } removeSchema(e) { if (e instanceof RegExp) return this._removeAllSchemas(this.schemas, e), this._removeAllSchemas(this.refs, e), this; switch (typeof e) { case "undefined": return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this; case "string": { const t = x.call(this, e); return "object" == typeof t && this._cache.delete(t.schema), delete this.schemas[e], delete this.refs[e], this } case "object": { const t = e; this._cache.delete(t); let n = e[this.opts.schemaId]; return n && (n = u.normalizeId(n), delete this.schemas[n], delete this.refs[n]), this } default: throw new Error("ajv.removeSchema: invalid parameter") } } addVocabulary(e) { for (const t of e) this.addKeyword(t); return this } addKeyword(e, t) { let n; if ("string" == typeof e) n = e, "object" == typeof t && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), t.keyword = n); else { if ("object" != typeof e || void 0 !== t) throw new Error("invalid addKeywords parameters"); if (n = (t = e).keyword, Array.isArray(n) && !n.length) throw new Error("addKeywords: keyword must be string or non-empty array") } if (A.call(this, n, t), !t) return d.eachItem(n, (e => $.call(this, e))), this; R.call(this, t); const r = { ...t, type: p.getJSONTypes(t.type), schemaType: p.getJSONTypes(t.schemaType) }; return d.eachItem(n, 0 === r.type.length ? e => $.call(this, e, r) : e => r.type.forEach((t => $.call(this, e, r, t)))), this } getKeyword(e) { const t = this.RULES.all[e]; return "object" == typeof t ? t.definition : !!t } removeKeyword(e) { const { RULES: t } = this; delete t.keywords[e], delete t.all[e]; for (const n of t.rules) { const t = n.rules.findIndex((t => t.keyword === e)); t >= 0 && n.rules.splice(t, 1) } return this } addFormat(e, t) { return "string" == typeof t && (t = new RegExp(t)), this.formats[e] = t, this } errorsText(e = this.errors, { separator: t = ", ", dataVar: n = "data" } = {}) { return e && 0 !== e.length ? e.map((e => `${n}${e.instancePath} ${e.message}`)).reduce(((e, n) => e + t + n)) : "No errors" } $dataMetaSchema(e, t) { const n = this.RULES.all; e = JSON.parse(JSON.stringify(e)); for (const r of t) { const t = r.split("/").slice(1); let o = e; for (const e of t) o = o[e]; for (const e in n) { const t = n[e]; if ("object" != typeof t) continue; const { $data: r } = t.definition, i = o[e]; r && i && (o[e] = T(i)) } } return e } _removeAllSchemas(e, t) { for (const n in e) { const r = e[n]; t && !t.test(n) || ("string" == typeof r ? delete e[n] : r && !r.meta && (this._cache.delete(r.schema), delete e[n])) } } _addSchema(e, t, n, r = this.opts.validateSchema, o = this.opts.addUsedSchema) { let i; const { schemaId: a } = this.opts; if ("object" == typeof e) i = e[a]; else { if (this.opts.jtd) throw new Error("schema must be object"); if ("boolean" != typeof e) throw new Error("schema must be object or boolean") } let s = this._cache.get(e); if (void 0 !== s) return s; const c = u.getSchemaRefs.call(this, e); return n = u.normalizeId(i || n), s = new l.SchemaEnv({ schema: e, schemaId: a, meta: t, baseId: n, localRefs: c }), this._cache.set(s.schema, s), o && !n.startsWith("#") && (n && this._checkUnique(n), this.refs[n] = s), r && this.validateSchema(e, !0), s } _checkUnique(e) { if (this.schemas[e] || this.refs[e]) throw new Error(`schema with key or id "${e}" already exists`) } _compileSchemaEnv(e) { if (e.meta ? this._compileMetaSchema(e) : l.compileSchema.call(this, e), !e.validate) throw new Error("ajv implementation error"); return e.validate } _compileMetaSchema(e) { const t = this.opts; this.opts = this._metaOpts; try { l.compileSchema.call(this, e) } finally { this.opts = t } } } function w(e, t, n, r = "error") { for (const o in e) { const i = o; i in t && this.logger[r](`${n}: option ${o}. ${e[i]}`) } } function x(e) { return e = u.normalizeId(e), this.schemas[e] || this.refs[e] } function k() { const e = this.opts.schemas; if (e) if (Array.isArray(e)) this.addSchema(e); else for (const t in e) this.addSchema(e[t], t) } function _() { for (const e in this.opts.formats) { const t = this.opts.formats[e]; t && this.addFormat(e, t) } } function O(e) { if (Array.isArray(e)) this.addVocabulary(e); else { this.logger.warn("keywords option as map is deprecated, pass array"); for (const t in e) { const n = e[t]; n.keyword || (n.keyword = t), this.addKeyword(n) } } } function S() { const e = { ...this.opts }; for (const t of h) delete e[t]; return e } t.default = b, b.ValidationError = i.default, b.MissingRefError = a.default; const E = { log() { }, warn() { }, error() { } }, P = /^[a-z_$][a-z0-9_$:-]*$/i; function A(e, t) { const { RULES: n } = this; if (d.eachItem(e, (e => { if (n.keywords[e]) throw new Error(`Keyword ${e} is already defined`); if (!P.test(e)) throw new Error(`Keyword ${e} has invalid name`) })), t && t.$data && !("code" in t) && !("validate" in t)) throw new Error('$data keyword must have "code" or "validate" function') } function $(e, t, n) { var r; const o = null == t ? void 0 : t.post; if (n && o) throw new Error('keyword with "post" flag cannot have "type"'); const { RULES: i } = this; let a = o ? i.post : i.rules.find((({ type: e }) => e === n)); if (a || (a = { type: n, rules: [] }, i.rules.push(a)), i.keywords[e] = !0, !t) return; const s = { keyword: e, definition: { ...t, type: p.getJSONTypes(t.type), schemaType: p.getJSONTypes(t.schemaType) } }; t.before ? C.call(this, a, s, t.before) : a.rules.push(s), i.all[e] = s, null === (r = t.implements) || void 0 === r || r.forEach((e => this.addKeyword(e))) } function C(e, t, n) { const r = e.rules.findIndex((e => e.keyword === n)); r >= 0 ? e.rules.splice(r, 0, t) : (e.rules.push(t), this.logger.warn(`rule ${n} is not defined`)) } function R(e) { let { metaSchema: t } = e; void 0 !== t && (e.$data && this.opts.$data && (t = T(t)), e.validateSchema = this.compile(t, !0)) } const j = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }; function T(e) { return { anyOf: [e, j] } } }, 412: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4063); r.code = 'require("ajv/dist/runtime/equal").default', t.default = r }, 5872: function (e, t) { "use strict"; function n(e) { const t = e.length; let n, r = 0, o = 0; for (; o < t;)r++, n = e.charCodeAt(o++), n >= 55296 && n <= 56319 && o < t && (n = e.charCodeAt(o), 56320 == (64512 & n) && o++); return r } Object.defineProperty(t, "__esModule", { value: !0 }), t.default = n, n.code = 'require("ajv/dist/runtime/ucs2length").default' }, 8451: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); class n extends Error { constructor(e) { super("validation failed"), this.errors = e, this.ajv = this.validation = !0 } } t.default = n }, 3074: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.validateAdditionalItems = void 0; const r = n(4475), o = n(6124), i = { keyword: "additionalItems", type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", error: { message: ({ params: { len: e } }) => r.str`must NOT have more than ${e} items`, params: ({ params: { len: e } }) => r._`{limit: ${e}}` }, code(e) { const { parentSchema: t, it: n } = e, { items: r } = t; Array.isArray(r) ? a(e, r) : o.checkStrictMode(n, '"additionalItems" is ignored when "items" is not an array of schemas') } }; function a(e, t) { const { gen: n, schema: i, data: a, keyword: s, it: l } = e; l.items = !0; const c = n.const("len", r._`${a}.length`); if (!1 === i) e.setParams({ len: t.length }), e.pass(r._`${c} <= ${t.length}`); else if ("object" == typeof i && !o.alwaysValidSchema(l, i)) { const i = n.var("valid", r._`${c} <= ${t.length}`); n.if(r.not(i), (() => function (i) { n.forRange("i", t.length, c, (t => { e.subschema({ keyword: s, dataProp: t, dataPropType: o.Type.Num }, i), l.allErrors || n.if(r.not(i), (() => n.break())) })) }(i))), e.ok(i) } } t.validateAdditionalItems = a, t.default = i }, 1422: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(8619), o = n(4475), i = n(5018), a = n(6124), s = { keyword: "additionalProperties", type: ["object"], schemaType: ["boolean", "object"], allowUndefined: !0, trackErrors: !0, error: { message: "must NOT have additional properties", params: ({ params: e }) => o._`{additionalProperty: ${e.additionalProperty}}` }, code(e) { const { gen: t, parentSchema: n, data: s, errsCount: l, it: c } = e, { schema: u = c.opts.defaultAdditionalProperties } = e; if (!l) throw new Error("ajv implementation error"); const { allErrors: p, opts: d } = c; if (c.props = !0, "all" !== d.removeAdditional && a.alwaysValidSchema(c, u)) return; const f = r.allSchemaProperties(n.properties), h = r.allSchemaProperties(n.patternProperties); function m(e) { t.code(o._`delete ${s}[${e}]`) } function g(n) { if ("all" === d.removeAdditional || d.removeAdditional && !1 === u) m(n); else { if (!1 === u) return e.setParams({ additionalProperty: n }), e.error(), void (p || t.break()); if ("object" == typeof u && !a.alwaysValidSchema(c, u)) { const r = t.name("valid"); "failing" === d.removeAdditional ? (y(n, r, !1), t.if(o.not(r), (() => { e.reset(), m(n) }))) : (y(n, r), p || t.if(o.not(r), (() => t.break()))) } } } function y(t, n, r) { const o = { keyword: "additionalProperties", dataProp: t, dataPropType: a.Type.Str }; !1 === r && Object.assign(o, { compositeRule: !0, createErrors: !1, allErrors: !1 }), e.subschema(o, n) } t.forIn("key", s, (i => { f.length || h.length ? t.if(function (i) { let s; if (f.length > 8) { const e = a.schemaRefOrVal(c, n.properties, "properties"); s = r.isOwnProperty(t, e, i) } else s = f.length ? o.or(...f.map((e => o._`${i} === ${e}`))) : o.nil; return h.length && (s = o.or(s, ...h.map((t => o._`${r.usePattern(e, t)}.test(${i})`)))), o.not(s) }(i), (() => g(i))) : g(i) })), e.ok(o._`${l} === ${i.default.errors}`) } }; t.default = s }, 5716: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(6124), o = { keyword: "allOf", schemaType: "array", code(e) { const { gen: t, schema: n, it: o } = e; if (!Array.isArray(n)) throw new Error("ajv implementation error"); const i = t.name("valid"); n.forEach(((t, n) => { if (r.alwaysValidSchema(o, t)) return; const a = e.subschema({ keyword: "allOf", schemaProp: n }, i); e.ok(i), e.mergeEvaluated(a) })) } }; t.default = o }, 1668: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = { keyword: "anyOf", schemaType: "array", trackErrors: !0, code: n(8619).validateUnion, error: { message: "must match a schema in anyOf" } }; t.default = r }, 9564: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6124), i = { keyword: "contains", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: !0, error: { message: ({ params: { min: e, max: t } }) => void 0 === t ? r.str`must contain at least ${e} valid item(s)` : r.str`must contain at least ${e} and no more than ${t} valid item(s)`, params: ({ params: { min: e, max: t } }) => void 0 === t ? r._`{minContains: ${e}}` : r._`{minContains: ${e}, maxContains: ${t}}` }, code(e) { const { gen: t, schema: n, parentSchema: i, data: a, it: s } = e; let l, c; const { minContains: u, maxContains: p } = i; s.opts.next ? (l = void 0 === u ? 1 : u, c = p) : l = 1; const d = t.const("len", r._`${a}.length`); if (e.setParams({ min: l, max: c }), void 0 === c && 0 === l) return void o.checkStrictMode(s, '"minContains" == 0 without "maxContains": "contains" keyword ignored'); if (void 0 !== c && l > c) return o.checkStrictMode(s, '"minContains" > "maxContains" is always invalid'), void e.fail(); if (o.alwaysValidSchema(s, n)) { let t = r._`${d} >= ${l}`; return void 0 !== c && (t = r._`${t} && ${d} <= ${c}`), void e.pass(t) } s.items = !0; const f = t.name("valid"); if (void 0 === c && 1 === l) h(f, (() => t.if(f, (() => t.break())))); else { t.let(f, !1); const e = t.name("_valid"), n = t.let("count", 0); h(e, (() => t.if(e, (() => function (e) { t.code(r._`${e}++`), void 0 === c ? t.if(r._`${e} >= ${l}`, (() => t.assign(f, !0).break())) : (t.if(r._`${e} > ${c}`, (() => t.assign(f, !1).break())), 1 === l ? t.assign(f, !0) : t.if(r._`${e} >= ${l}`, (() => t.assign(f, !0)))) }(n))))) } function h(n, r) { t.forRange("i", 0, d, (t => { e.subschema({ keyword: "contains", dataProp: t, dataPropType: o.Type.Num, compositeRule: !0 }, n), r() })) } e.result(f, (() => e.reset())) } }; t.default = i }, 1117: function (e, t, n) { + "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.validateSchemaDeps = t.validatePropertyDeps = t.error = void 0; const r = n(4475), o = n(6124), i = n(8619); t.error = { + message: ({ params: { property: e, depsCount: t, deps: n } }) => { const o = 1 === t ? "property" : "properties"; return r.str`must have ${o} ${n} when property ${e} is present` }, params: ({ params: { property: e, depsCount: t, deps: n, missingProperty: o } }) => r._`{property: ${e}, + missingProperty: ${o}, + depsCount: ${t}, + deps: ${n}}` + }; const a = { keyword: "dependencies", type: "object", schemaType: "object", error: t.error, code(e) { const [t, n] = function ({ schema: e }) { const t = {}, n = {}; for (const r in e) "__proto__" !== r && ((Array.isArray(e[r]) ? t : n)[r] = e[r]); return [t, n] }(e); s(e, t), l(e, n) } }; function s(e, t = e.schema) { const { gen: n, data: o, it: a } = e; if (0 === Object.keys(t).length) return; const s = n.let("missing"); for (const l in t) { const c = t[l]; if (0 === c.length) continue; const u = i.propertyInData(n, o, l, a.opts.ownProperties); e.setParams({ property: l, depsCount: c.length, deps: c.join(", ") }), a.allErrors ? n.if(u, (() => { for (const t of c) i.checkReportMissingProp(e, t) })) : (n.if(r._`${u} && (${i.checkMissingProp(e, c, s)})`), i.reportMissingProp(e, s), n.else()) } } function l(e, t = e.schema) { const { gen: n, data: r, keyword: a, it: s } = e, l = n.name("valid"); for (const c in t) o.alwaysValidSchema(s, t[c]) || (n.if(i.propertyInData(n, r, c, s.opts.ownProperties), (() => { const t = e.subschema({ keyword: a, schemaProp: c }, l); e.mergeValidEvaluated(t, l) }), (() => n.var(l, !0))), e.ok(l)) } t.validatePropertyDeps = s, t.validateSchemaDeps = l, t.default = a + }, 5184: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6124), i = { keyword: "if", schemaType: ["object", "boolean"], trackErrors: !0, error: { message: ({ params: e }) => r.str`must match "${e.ifClause}" schema`, params: ({ params: e }) => r._`{failingKeyword: ${e.ifClause}}` }, code(e) { const { gen: t, parentSchema: n, it: i } = e; void 0 === n.then && void 0 === n.else && o.checkStrictMode(i, '"if" without "then" and "else" is ignored'); const s = a(i, "then"), l = a(i, "else"); if (!s && !l) return; const c = t.let("valid", !0), u = t.name("_valid"); if (function () { const t = e.subschema({ keyword: "if", compositeRule: !0, createErrors: !1, allErrors: !1 }, u); e.mergeEvaluated(t) }(), e.reset(), s && l) { const n = t.let("ifClause"); e.setParams({ ifClause: n }), t.if(u, p("then", n), p("else", n)) } else s ? t.if(u, p("then")) : t.if(r.not(u), p("else")); function p(n, o) { return () => { const i = e.subschema({ keyword: n }, u); t.assign(c, u), e.mergeValidEvaluated(i, c), o ? t.assign(o, r._`${n}`) : e.setParams({ ifClause: n }) } } e.pass(c, (() => e.error(!0))) } }; function a(e, t) { const n = e.schema[t]; return void 0 !== n && !o.alwaysValidSchema(e, n) } t.default = i }, 9616: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(3074), o = n(6988), i = n(6348), a = n(9822), s = n(9564), l = n(1117), c = n(4002), u = n(1422), p = n(9690), d = n(9883), f = n(8435), h = n(1668), m = n(9684), g = n(5716), y = n(5184), v = n(5642); t.default = function (e = !1) { const t = [f.default, h.default, m.default, g.default, y.default, v.default, c.default, u.default, l.default, p.default, d.default]; return e ? t.push(o.default, a.default) : t.push(r.default, i.default), t.push(s.default), t } }, 6348: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.validateTuple = void 0; const r = n(4475), o = n(6124), i = n(8619), a = { keyword: "items", type: "array", schemaType: ["object", "array", "boolean"], before: "uniqueItems", code(e) { const { schema: t, it: n } = e; if (Array.isArray(t)) return s(e, "additionalItems", t); n.items = !0, o.alwaysValidSchema(n, t) || e.ok(i.validateArray(e)) } }; function s(e, t, n = e.schema) { const { gen: i, parentSchema: a, data: s, keyword: l, it: c } = e; !function (e) { const { opts: r, errSchemaPath: i } = c, a = n.length, s = a === e.minItems && (a === e.maxItems || !1 === e[t]); if (r.strictTuples && !s) { const e = `"${l}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`; o.checkStrictMode(c, e, r.strictTuples) } }(a), c.opts.unevaluated && n.length && !0 !== c.items && (c.items = o.mergeEvaluated.items(i, n.length, c.items)); const u = i.name("valid"), p = i.const("len", r._`${s}.length`); n.forEach(((t, n) => { o.alwaysValidSchema(c, t) || (i.if(r._`${p} > ${n}`, (() => e.subschema({ keyword: l, schemaProp: n, dataProp: n }, u))), e.ok(u)) })) } t.validateTuple = s, t.default = a }, 9822: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6124), i = n(8619), a = n(3074), s = { keyword: "items", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", error: { message: ({ params: { len: e } }) => r.str`must NOT have more than ${e} items`, params: ({ params: { len: e } }) => r._`{limit: ${e}}` }, code(e) { const { schema: t, parentSchema: n, it: r } = e, { prefixItems: s } = n; r.items = !0, o.alwaysValidSchema(r, t) || (s ? a.validateAdditionalItems(e, s) : e.ok(i.validateArray(e))) } }; t.default = s }, 8435: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(6124), o = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: !0, code(e) { const { gen: t, schema: n, it: o } = e; if (r.alwaysValidSchema(o, n)) return void e.fail(); const i = t.name("valid"); e.subschema({ keyword: "not", compositeRule: !0, createErrors: !1, allErrors: !1 }, i), e.result(i, (() => e.error()), (() => e.reset())) }, error: { message: "must NOT be valid" } }; t.default = o }, 9684: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6124), i = { keyword: "oneOf", schemaType: "array", trackErrors: !0, error: { message: "must match exactly one schema in oneOf", params: ({ params: e }) => r._`{passingSchemas: ${e.passing}}` }, code(e) { const { gen: t, schema: n, parentSchema: i, it: a } = e; if (!Array.isArray(n)) throw new Error("ajv implementation error"); if (a.opts.discriminator && i.discriminator) return; const s = n, l = t.let("valid", !1), c = t.let("passing", null), u = t.name("_valid"); e.setParams({ passing: c }), t.block((function () { s.forEach(((n, i) => { let s; o.alwaysValidSchema(a, n) ? t.var(u, !0) : s = e.subschema({ keyword: "oneOf", schemaProp: i, compositeRule: !0 }, u), i > 0 && t.if(r._`${u} && ${l}`).assign(l, !1).assign(c, r._`[${c}, ${i}]`).else(), t.if(u, (() => { t.assign(l, !0), t.assign(c, i), s && e.mergeEvaluated(s, r.Name) })) })) })), e.result(l, (() => e.reset()), (() => e.error(!0))) } }; t.default = i }, 9883: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(8619), o = n(4475), i = n(6124), a = n(6124), s = { keyword: "patternProperties", type: "object", schemaType: "object", code(e) { const { gen: t, schema: n, data: s, parentSchema: l, it: c } = e, { opts: u } = c, p = r.allSchemaProperties(n), d = p.filter((e => i.alwaysValidSchema(c, n[e]))); if (0 === p.length || d.length === p.length && (!c.opts.unevaluated || !0 === c.props)) return; const f = u.strictSchema && !u.allowMatchingProperties && l.properties, h = t.name("valid"); !0 === c.props || c.props instanceof o.Name || (c.props = a.evaluatedPropsToName(t, c.props)); const { props: m } = c; function g(e) { for (const t in f) new RegExp(e).test(t) && i.checkStrictMode(c, `property ${t} matches pattern ${e} (use allowMatchingProperties)`) } function y(n) { t.forIn("key", s, (i => { t.if(o._`${r.usePattern(e, n)}.test(${i})`, (() => { const r = d.includes(n); r || e.subschema({ keyword: "patternProperties", schemaProp: n, dataProp: i, dataPropType: a.Type.Str }, h), c.opts.unevaluated && !0 !== m ? t.assign(o._`${m}[${i}]`, !0) : r || c.allErrors || t.if(o.not(h), (() => t.break())) })) })) } !function () { for (const e of p) f && g(e), c.allErrors ? y(e) : (t.var(h, !0), y(e), t.if(h)) }() } }; t.default = s }, 6988: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(6348), o = { keyword: "prefixItems", type: "array", schemaType: ["array"], before: "uniqueItems", code: e => r.validateTuple(e, "items") }; t.default = o }, 9690: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(1321), o = n(8619), i = n(6124), a = n(1422), s = { keyword: "properties", type: "object", schemaType: "object", code(e) { const { gen: t, schema: n, parentSchema: s, data: l, it: c } = e; ("all" === c.opts.removeAdditional && void 0 === s.additionalProperties || !1 === c.opts.defaultAdditionalProperties) && a.default.code(new r.KeywordCxt(c, a.default, "additionalProperties")); const u = o.allSchemaProperties(n); for (const e of u) c.definedProperties.add(e); c.opts.unevaluated && u.length && !0 !== c.props && (c.props = i.mergeEvaluated.props(t, i.toHash(u), c.props)); const p = u.filter((e => !i.alwaysValidSchema(c, n[e]))); if (0 === p.length) return; const d = t.name("valid"); for (const n of p) f(n) ? h(n) : (t.if(o.propertyInData(t, l, n, c.opts.ownProperties)), h(n), c.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(n), e.ok(d); function f(e) { return c.opts.useDefaults && !c.compositeRule && void 0 !== n[e].default } function h(t) { e.subschema({ keyword: "properties", schemaProp: t, dataProp: t }, d) } } }; t.default = s }, 4002: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6124), i = { keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], error: { message: "property name must be valid", params: ({ params: e }) => r._`{propertyName: ${e.propertyName}}` }, code(e) { const { gen: t, schema: n, data: i, it: a } = e; if (o.alwaysValidSchema(a, n)) return; const s = t.name("valid"); t.forIn("key", i, (n => { e.setParams({ propertyName: n }), e.subschema({ keyword: "propertyNames", data: n, dataTypes: ["string"], propertyName: n, compositeRule: !0 }, s), t.if(r.not(s), (() => { e.error(!0), a.allErrors || t.break() })) })), e.ok(s) } }; t.default = i }, 5642: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(6124), o = { keyword: ["then", "else"], schemaType: ["object", "boolean"], code({ keyword: e, parentSchema: t, it: n }) { void 0 === t.if && r.checkStrictMode(n, `"${e}" without "if" is ignored`) } }; t.default = o }, 8619: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.validateUnion = t.validateArray = t.usePattern = t.callValidateCode = t.schemaProperties = t.allSchemaProperties = t.noPropertyInData = t.propertyInData = t.isOwnProperty = t.hasPropFunc = t.reportMissingProp = t.checkMissingProp = t.checkReportMissingProp = void 0; const r = n(4475), o = n(6124), i = n(5018); function a(e) { return e.scopeValue("func", { ref: Object.prototype.hasOwnProperty, code: r._`Object.prototype.hasOwnProperty` }) } function s(e, t, n) { return r._`${a(e)}.call(${t}, ${n})` } function l(e, t, n, o) { const i = r._`${t}${r.getProperty(n)} === undefined`; return o ? r.or(i, r.not(s(e, t, n))) : i } function c(e) { return e ? Object.keys(e).filter((e => "__proto__" !== e)) : [] } t.checkReportMissingProp = function (e, t) { const { gen: n, data: o, it: i } = e; n.if(l(n, o, t, i.opts.ownProperties), (() => { e.setParams({ missingProperty: r._`${t}` }, !0), e.error() })) }, t.checkMissingProp = function ({ gen: e, data: t, it: { opts: n } }, o, i) { return r.or(...o.map((o => r.and(l(e, t, o, n.ownProperties), r._`${i} = ${o}`)))) }, t.reportMissingProp = function (e, t) { e.setParams({ missingProperty: t }, !0), e.error() }, t.hasPropFunc = a, t.isOwnProperty = s, t.propertyInData = function (e, t, n, o) { const i = r._`${t}${r.getProperty(n)} !== undefined`; return o ? r._`${i} && ${s(e, t, n)}` : i }, t.noPropertyInData = l, t.allSchemaProperties = c, t.schemaProperties = function (e, t) { return c(t).filter((n => !o.alwaysValidSchema(e, t[n]))) }, t.callValidateCode = function ({ schemaCode: e, data: t, it: { gen: n, topSchemaRef: o, schemaPath: a, errorPath: s }, it: l }, c, u, p) { const d = p ? r._`${e}, ${t}, ${o}${a}` : t, f = [[i.default.instancePath, r.strConcat(i.default.instancePath, s)], [i.default.parentData, l.parentData], [i.default.parentDataProperty, l.parentDataProperty], [i.default.rootData, i.default.rootData]]; l.opts.dynamicRef && f.push([i.default.dynamicAnchors, i.default.dynamicAnchors]); const h = r._`${d}, ${n.object(...f)}`; return u !== r.nil ? r._`${c}.call(${u}, ${h})` : r._`${c}(${h})` }, t.usePattern = function ({ gen: e, it: { opts: t } }, n) { const o = t.unicodeRegExp ? "u" : ""; return e.scopeValue("pattern", { key: n, ref: new RegExp(n, o), code: r._`new RegExp(${n}, ${o})` }) }, t.validateArray = function (e) { const { gen: t, data: n, keyword: i, it: a } = e, s = t.name("valid"); if (a.allErrors) { const e = t.let("valid", !0); return l((() => t.assign(e, !1))), e } return t.var(s, !0), l((() => t.break())), s; function l(a) { const l = t.const("len", r._`${n}.length`); t.forRange("i", 0, l, (n => { e.subschema({ keyword: i, dataProp: n, dataPropType: o.Type.Num }, s), t.if(r.not(s), a) })) } }, t.validateUnion = function (e) { const { gen: t, schema: n, keyword: i, it: a } = e; if (!Array.isArray(n)) throw new Error("ajv implementation error"); if (n.some((e => o.alwaysValidSchema(a, e))) && !a.opts.unevaluated) return; const s = t.let("valid", !1), l = t.name("_valid"); t.block((() => n.forEach(((n, o) => { const a = e.subschema({ keyword: i, schemaProp: o, compositeRule: !0 }, l); t.assign(s, r._`${s} || ${l}`), e.mergeValidEvaluated(a, l) || t.if(r.not(s)) })))), e.result(s, (() => e.reset()), (() => e.error(!0))) } }, 5060: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const n = { keyword: "id", code() { throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID') } }; t.default = n }, 8223: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(5060), o = n(4028), i = ["$schema", "$id", "$defs", "$vocabulary", { keyword: "$comment" }, "definitions", r.default, o.default]; t.default = i }, 4028: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.callRef = t.getValidate = void 0; const r = n(4143), o = n(8619), i = n(4475), a = n(5018), s = n(7805), l = n(6124), c = { keyword: "$ref", schemaType: "string", code(e) { const { gen: t, schema: n, it: o } = e, { baseId: a, schemaEnv: l, validateName: c, opts: d, self: f } = o, { root: h } = l; if (("#" === n || "#/" === n) && a === h.baseId) return function () { if (l === h) return p(e, c, l, l.$async); const n = t.scopeValue("root", { ref: h }); return p(e, i._`${n}.validate`, h, h.$async) }(); const m = s.resolveRef.call(f, h, a, n); if (void 0 === m) throw new r.default(a, n); return m instanceof s.SchemaEnv ? function (t) { const n = u(e, t); p(e, n, t, t.$async) }(m) : function (r) { const o = t.scopeValue("schema", !0 === d.code.source ? { ref: r, code: i.stringify(r) } : { ref: r }), a = t.name("valid"), s = e.subschema({ schema: r, dataTypes: [], schemaPath: i.nil, topSchemaRef: o, errSchemaPath: n }, a); e.mergeEvaluated(s), e.ok(a) }(m) } }; function u(e, t) { const { gen: n } = e; return t.validate ? n.scopeValue("validate", { ref: t.validate }) : i._`${n.scopeValue("wrapper", { ref: t })}.validate` } function p(e, t, n, r) { const { gen: s, it: c } = e, { allErrors: u, schemaEnv: p, opts: d } = c, f = d.passContext ? a.default.this : i.nil; function h(e) { const t = i._`${e}.errors`; s.assign(a.default.vErrors, i._`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`), s.assign(a.default.errors, i._`${a.default.vErrors}.length`) } function m(e) { var t; if (!c.opts.unevaluated) return; const r = null === (t = null == n ? void 0 : n.validate) || void 0 === t ? void 0 : t.evaluated; if (!0 !== c.props) if (r && !r.dynamicProps) void 0 !== r.props && (c.props = l.mergeEvaluated.props(s, r.props, c.props)); else { const t = s.var("props", i._`${e}.evaluated.props`); c.props = l.mergeEvaluated.props(s, t, c.props, i.Name) } if (!0 !== c.items) if (r && !r.dynamicItems) void 0 !== r.items && (c.items = l.mergeEvaluated.items(s, r.items, c.items)); else { const t = s.var("items", i._`${e}.evaluated.items`); c.items = l.mergeEvaluated.items(s, t, c.items, i.Name) } } r ? function () { if (!p.$async) throw new Error("async schema referenced by sync schema"); const n = s.let("valid"); s.try((() => { s.code(i._`await ${o.callValidateCode(e, t, f)}`), m(t), u || s.assign(n, !0) }), (e => { s.if(i._`!(${e} instanceof ${c.ValidationError})`, (() => s.throw(e))), h(e), u || s.assign(n, !1) })), e.ok(n) }() : function () { const n = s.name("visitedNodes"); s.code(i._`const ${n} = visitedNodesForRef.get(${t}) || new Set()`), s.if(i._`!${n}.has(${e.data})`, (() => { s.code(i._`visitedNodesForRef.set(${t}, ${n})`), s.code(i._`const dataNode = ${e.data}`), s.code(i._`${n}.add(dataNode)`); const r = e.result(o.callValidateCode(e, t, f), (() => m(t)), (() => h(t))); return s.code(i._`${n}.delete(dataNode)`), r })) }() } t.getValidate = u, t.callRef = p, t.default = c }, 5522: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6545), i = { keyword: "discriminator", type: "object", schemaType: "object", error: { message: ({ params: { discrError: e, tagName: t } }) => e === o.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`, params: ({ params: { discrError: e, tag: t, tagName: n } }) => r._`{error: ${e}, tag: ${n}, tagValue: ${t}}` }, code(e) { const { gen: t, data: n, schema: i, parentSchema: a, it: s } = e, { oneOf: l } = a; if (!s.opts.discriminator) throw new Error("discriminator: requires discriminator option"); const c = i.propertyName; if ("string" != typeof c) throw new Error("discriminator: requires propertyName"); if (!l) throw new Error("discriminator: requires oneOf keyword"); const u = t.let("valid", !1), p = t.const("tag", r._`${n}${r.getProperty(c)}`); function d(n) { const o = t.name("valid"), i = e.subschema({ keyword: "oneOf", schemaProp: n }, o); return e.mergeEvaluated(i, r.Name), o } function f(e) { return e.hasOwnProperty("$ref") } t.if(r._`typeof ${p} == "string"`, (() => function () { const n = function () { var e; const t = {}, n = o(a); let r = !0; for (let t = 0; t < l.length; t++) { const a = l[t]; let p; if (f(a)) { if (i.mapping) { const { mapping: e } = i; let n; if (Object.keys(e).forEach((function (t) { e[t] === a.$ref && (n = t) })), !n) throw new Error(`${a.$ref} should have corresponding entry in mapping`); u(n, t) } } else { if (p = null === (e = a.properties) || void 0 === e ? void 0 : e[c], "object" != typeof p) throw new Error(`discriminator: oneOf schemas must have "properties/${c}"`); r = r && (n || o(a)), s(p, t) } } if (!r) throw new Error(`discriminator: "${c}" must be required`); return t; function o({ required: e }) { return Array.isArray(e) && e.includes(c) } function s(e, t) { if (e.const) u(e.const, t); else { if (!e.enum) throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`); for (const n of e.enum) u(n, t) } } function u(e, n) { if ("string" != typeof e || e in t) throw new Error(`discriminator: "${c}" values must be unique strings`); t[e] = n } }(); t.if(!1); for (const e in n) t.elseIf(r._`${p} === ${e}`), t.assign(u, d(n[e])); t.else(), e.error(!1, { discrError: o.DiscrError.Mapping, tag: p, tagName: c }), t.endIf() }()), (() => e.error(!1, { discrError: o.DiscrError.Tag, tag: p, tagName: c }))), e.ok(u) } }; t.default = i }, 6545: function (e, t) { "use strict"; var n; Object.defineProperty(t, "__esModule", { value: !0 }), t.DiscrError = void 0, (n = t.DiscrError || (t.DiscrError = {})).Tag = "tag", n.Mapping = "mapping" }, 6479: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(8223), o = n(3799), i = n(9616), a = n(3815), s = n(4826), l = [r.default, o.default, i.default(), a.default, s.metadataVocabulary, s.contentVocabulary]; t.default = l }, 157: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = { keyword: "format", type: ["number", "string"], schemaType: "string", $data: !0, error: { message: ({ schemaCode: e }) => r.str`must match format "${e}"`, params: ({ schemaCode: e }) => r._`{format: ${e}}` }, code(e, t) { const { gen: n, data: o, $data: i, schema: a, schemaCode: s, it: l } = e, { opts: c, errSchemaPath: u, schemaEnv: p, self: d } = l; c.validateFormats && (i ? function () { const i = n.scopeValue("formats", { ref: d.formats, code: c.code.formats }), a = n.const("fDef", r._`${i}[${s}]`), l = n.let("fType"), u = n.let("format"); n.if(r._`typeof ${a} == "object" && !(${a} instanceof RegExp)`, (() => n.assign(l, r._`${a}.type || "string"`).assign(u, r._`${a}.validate`)), (() => n.assign(l, r._`"string"`).assign(u, a))), e.fail$data(r.or(!1 === c.strictSchema ? r.nil : r._`${s} && !${u}`, function () { const e = p.$async ? r._`(${a}.async ? await ${u}(${o}) : ${u}(${o}))` : r._`${u}(${o})`, n = r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`; return r._`${u} && ${u} !== true && ${l} === ${t} && !${n}` }())) }() : function () { const i = d.formats[a]; if (!i) return void function () { if (!1 !== c.strictSchema) throw new Error(e()); function e() { return `unknown format "${a}" ignored in schema at path "${u}"` } d.logger.warn(e()) }(); if (!0 === i) return; const [s, l, f] = function (e) { const t = e instanceof RegExp ? r.regexpCode(e) : c.code.formats ? r._`${c.code.formats}${r.getProperty(a)}` : void 0, o = n.scopeValue("formats", { key: a, ref: e, code: t }); return "object" != typeof e || e instanceof RegExp ? ["string", e, o] : [e.type || "string", e.validate, r._`${o}.validate`] }(i); s === t && e.pass(function () { if ("object" == typeof i && !(i instanceof RegExp) && i.async) { if (!p.$async) throw new Error("async format in sync schema"); return r._`await ${f}(${o})` } return "function" == typeof l ? r._`${f}(${o})` : r._`${f}.test(${o})` }()) }()) } }; t.default = o }, 3815: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = [n(157).default]; t.default = r }, 4826: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.contentVocabulary = t.metadataVocabulary = void 0, t.metadataVocabulary = ["title", "description", "default", "deprecated", "readOnly", "writeOnly", "examples"], t.contentVocabulary = ["contentMediaType", "contentEncoding", "contentSchema"] }, 7535: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6124), i = n(412), a = { keyword: "const", $data: !0, error: { message: "must be equal to constant", params: ({ schemaCode: e }) => r._`{allowedValue: ${e}}` }, code(e) { const { gen: t, data: n, $data: a, schemaCode: s, schema: l } = e; a || l && "object" == typeof l ? e.fail$data(r._`!${o.useFunc(t, i.default)}(${n}, ${s})`) : e.fail(r._`${l} !== ${n}`) } }; t.default = a }, 4147: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6124), i = n(412), a = { keyword: "enum", schemaType: "array", $data: !0, error: { message: "must be equal to one of the allowed values", params: ({ schemaCode: e }) => r._`{allowedValues: ${e}}` }, code(e) { const { gen: t, data: n, $data: a, schema: s, schemaCode: l, it: c } = e; if (!a && 0 === s.length) throw new Error("enum must have non-empty array"); const u = s.length >= c.opts.loopEnum, p = o.useFunc(t, i.default); let d; if (u || a) d = t.let("valid"), e.block$data(d, (function () { t.assign(d, !1), t.forOf("v", l, (e => t.if(r._`${p}(${n}, ${e})`, (() => t.assign(d, !0).break())))) })); else { if (!Array.isArray(s)) throw new Error("ajv implementation error"); const e = t.const("vSchema", l); d = r.or(...s.map(((t, o) => function (e, t) { const o = s[t]; return "object" == typeof o && null !== o ? r._`${p}(${n}, ${e}[${t}])` : r._`${n} === ${o}` }(e, o)))) } e.pass(d) } }; t.default = a }, 3799: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(9640), o = n(7692), i = n(3765), a = n(8582), s = n(6711), l = n(7835), c = n(8950), u = n(7326), p = n(7535), d = n(4147), f = [r.default, o.default, i.default, a.default, s.default, l.default, c.default, u.default, { keyword: "type", schemaType: ["string", "array"] }, { keyword: "nullable", schemaType: "boolean" }, p.default, d.default]; t.default = f }, 8950: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = { keyword: ["maxItems", "minItems"], type: "array", schemaType: "number", $data: !0, error: { message({ keyword: e, schemaCode: t }) { const n = "maxItems" === e ? "more" : "fewer"; return r.str`must NOT have ${n} than ${t} items` }, params: ({ schemaCode: e }) => r._`{limit: ${e}}` }, code(e) { const { keyword: t, data: n, schemaCode: o } = e, i = "maxItems" === t ? r.operators.GT : r.operators.LT; e.fail$data(r._`${n}.length ${i} ${o}`) } }; t.default = o }, 3765: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = n(6124), i = n(5872), a = { keyword: ["maxLength", "minLength"], type: "string", schemaType: "number", $data: !0, error: { message({ keyword: e, schemaCode: t }) { const n = "maxLength" === e ? "more" : "fewer"; return r.str`must NOT have ${n} than ${t} characters` }, params: ({ schemaCode: e }) => r._`{limit: ${e}}` }, code(e) { const { keyword: t, data: n, schemaCode: a, it: s } = e, l = "maxLength" === t ? r.operators.GT : r.operators.LT, c = !1 === s.opts.unicode ? r._`${n}.length` : r._`${o.useFunc(e.gen, i.default)}(${n})`; e.fail$data(r._`${c} ${l} ${a}`) } }; t.default = a }, 9640: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = r.operators, i = { maximum: { okStr: "<=", ok: o.LTE, fail: o.GT }, minimum: { okStr: ">=", ok: o.GTE, fail: o.LT }, exclusiveMaximum: { okStr: "<", ok: o.LT, fail: o.GTE }, exclusiveMinimum: { okStr: ">", ok: o.GT, fail: o.LTE } }, a = { message: ({ keyword: e, schemaCode: t }) => r.str`must be ${i[e].okStr} ${t}`, params: ({ keyword: e, schemaCode: t }) => r._`{comparison: ${i[e].okStr}, limit: ${t}}` }, s = { keyword: Object.keys(i), type: "number", schemaType: "number", $data: !0, error: a, code(e) { const { keyword: t, data: n, schemaCode: o } = e; e.fail$data(r._`${n} ${i[t].fail} ${o} || isNaN(${n})`) } }; t.default = s }, 6711: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = { keyword: ["maxProperties", "minProperties"], type: "object", schemaType: "number", $data: !0, error: { message({ keyword: e, schemaCode: t }) { const n = "maxProperties" === e ? "more" : "fewer"; return r.str`must NOT have ${n} than ${t} items` }, params: ({ schemaCode: e }) => r._`{limit: ${e}}` }, code(e) { const { keyword: t, data: n, schemaCode: o } = e, i = "maxProperties" === t ? r.operators.GT : r.operators.LT; e.fail$data(r._`Object.keys(${n}).length ${i} ${o}`) } }; t.default = o }, 7692: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(4475), o = { keyword: "multipleOf", type: "number", schemaType: "number", $data: !0, error: { message: ({ schemaCode: e }) => r.str`must be multiple of ${e}`, params: ({ schemaCode: e }) => r._`{multipleOf: ${e}}` }, code(e) { const { gen: t, data: n, schemaCode: o, it: i } = e, a = i.opts.multipleOfPrecision, s = t.let("res"), l = a ? r._`Math.abs(Math.round(${s}) - ${s}) > 1e-${a}` : r._`${s} !== parseInt(${s})`; e.fail$data(r._`(${o} === 0 || (${s} = ${n}/${o}, ${l}))`) } }; t.default = o }, 8582: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(8619), o = n(4475), i = { keyword: "pattern", type: "string", schemaType: "string", $data: !0, error: { message: ({ schemaCode: e }) => o.str`must match pattern "${e}"`, params: ({ schemaCode: e }) => o._`{pattern: ${e}}` }, code(e) { const { data: t, $data: n, schema: i, schemaCode: a, it: s } = e, l = s.opts.unicodeRegExp ? "u" : "", c = n ? o._`(new RegExp(${a}, ${l}))` : r.usePattern(e, i); e.fail$data(o._`!${c}.test(${t})`) } }; t.default = i }, 7835: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(8619), o = n(4475), i = n(6124), a = { keyword: "required", type: "object", schemaType: "array", $data: !0, error: { message: ({ params: { missingProperty: e } }) => o.str`must have required property '${e}'`, params: ({ params: { missingProperty: e } }) => o._`{missingProperty: ${e}}` }, code(e) { const { gen: t, schema: n, schemaCode: a, data: s, $data: l, it: c } = e, { opts: u } = c; if (!l && 0 === n.length) return; const p = n.length >= u.loopRequired; if (c.allErrors ? function () { if (p || l) e.block$data(o.nil, d); else for (const t of n) r.checkReportMissingProp(e, t) }() : function () { const i = t.let("missing"); if (p || l) { const n = t.let("valid", !0); e.block$data(n, (() => function (n, i) { e.setParams({ missingProperty: n }), t.forOf(n, a, (() => { t.assign(i, r.propertyInData(t, s, n, u.ownProperties)), t.if(o.not(i), (() => { e.error(), t.break() })) }), o.nil) }(i, n))), e.ok(n) } else t.if(r.checkMissingProp(e, n, i)), r.reportMissingProp(e, i), t.else() }(), u.strictRequired) { const t = e.parentSchema.properties, { definedProperties: r } = e.it; for (const e of n) if (void 0 === (null == t ? void 0 : t[e]) && !r.has(e)) { const t = `required property "${e}" is not defined at "${c.schemaEnv.baseId + c.errSchemaPath}" (strictRequired)`; i.checkStrictMode(c, t, c.opts.strictRequired) } } function d() { t.forOf("prop", a, (n => { e.setParams({ missingProperty: n }), t.if(r.noPropertyInData(t, s, n, u.ownProperties), (() => e.error())) })) } } }; t.default = a }, 7326: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); const r = n(7927), o = n(4475), i = n(6124), a = n(412), s = { keyword: "uniqueItems", type: "array", schemaType: "boolean", $data: !0, error: { message: ({ params: { i: e, j: t } }) => o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`, params: ({ params: { i: e, j: t } }) => o._`{i: ${e}, j: ${t}}` }, code(e) { const { gen: t, data: n, $data: s, schema: l, parentSchema: c, schemaCode: u, it: p } = e; if (!s && !l) return; const d = t.let("valid"), f = c.items ? r.getSchemaTypes(c.items) : []; function h(i, a) { const s = t.name("item"), l = r.checkDataTypes(f, s, p.opts.strictNumbers, r.DataType.Wrong), c = t.const("indices", o._`{}`); t.for(o._`;${i}--;`, (() => { t.let(s, o._`${n}[${i}]`), t.if(l, o._`continue`), f.length > 1 && t.if(o._`typeof ${s} == "string"`, o._`${s} += "_"`), t.if(o._`typeof ${c}[${s}] == "number"`, (() => { t.assign(a, o._`${c}[${s}]`), e.error(), t.assign(d, !1).break() })).code(o._`${c}[${s}] = ${i}`) })) } function m(r, s) { const l = i.useFunc(t, a.default), c = t.name("outer"); t.label(c).for(o._`;${r}--;`, (() => t.for(o._`${s} = ${r}; ${s}--;`, (() => t.if(o._`${l}(${n}[${r}], ${n}[${s}])`, (() => { e.error(), t.assign(d, !1).break(c) })))))) } e.block$data(d, (function () { const r = t.let("i", o._`${n}.length`), i = t.let("j"); e.setParams({ i: r, j: i }), t.assign(d, !0), t.if(o._`${r} > 1`, (() => (f.length > 0 && !f.some((e => "object" === e || "array" === e)) ? h : m)(r, i))) }), o._`${u} === false`), e.ok(d) } }; t.default = s }, 4029: function (e) { "use strict"; var t = e.exports = function (e, t, r) { "function" == typeof t && (r = t, t = {}), n(t, "function" == typeof (r = t.cb || r) ? r : r.pre || function () { }, r.post || function () { }, e, "", e) }; function n(e, r, o, i, a, s, l, c, u, p) { if (i && "object" == typeof i && !Array.isArray(i)) { for (var d in r(i, a, s, l, c, u, p), i) { var f = i[d]; if (Array.isArray(f)) { if (d in t.arrayKeywords) for (var h = 0; h < f.length; h++)n(e, r, o, f[h], a + "/" + d + "/" + h, s, a, d, i, h) } else if (d in t.propsKeywords) { if (f && "object" == typeof f) for (var m in f) n(e, r, o, f[m], a + "/" + d + "/" + m.replace(/~/g, "~0").replace(/\//g, "~1"), s, a, d, i, m) } else (d in t.keywords || e.allKeys && !(d in t.skipKeywords)) && n(e, r, o, f, a + "/" + d, s, a, d, i) } o(i, a, s, l, c, u, p) } } t.keywords = { additionalItems: !0, items: !0, contains: !0, additionalProperties: !0, propertyNames: !0, not: !0, if: !0, then: !0, else: !0 }, t.arrayKeywords = { items: !0, allOf: !0, anyOf: !0, oneOf: !0 }, t.propsKeywords = { $defs: !0, definitions: !0, properties: !0, patternProperties: !0, dependencies: !0 }, t.skipKeywords = { default: !0, enum: !0, const: !0, required: !0, maximum: !0, minimum: !0, exclusiveMaximum: !0, exclusiveMinimum: !0, multipleOf: !0, maxLength: !0, minLength: !0, pattern: !0, format: !0, maxItems: !0, minItems: !0, uniqueItems: !0, maxProperties: !0, minProperties: !0 } }, 3675: function (e, t, n) { "use strict"; var r = this && this.__awaiter || function (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) { var t; e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) { e(t) }))).then(a, s) } l((r = r.apply(e, t || [])).next()) })) }; Object.defineProperty(t, "__esModule", { value: !0 }), t.mapTypeToComponent = t.bundleDocument = t.bundle = t.OasVersion = void 0; const o = n(2307), i = n(4182), a = n(8065), s = n(5241), l = n(388), c = n(2608), u = n(5220), p = n(9443), d = n(1510), f = n(7468), h = n(5030), m = n(348), g = n(771), y = n(1094), v = n(4508), b = n(6350); var w; function x(e) { return r(this, void 0, void 0, (function* () { const { document: t, config: n, customTypes: r, externalRefResolver: o, dereference: f = !1, skipRedoclyRegistryRefs: m = !1, removeUnusedComponents: g = !1, keepUrlRefs: y = !1 } = e, x = d.detectOpenAPI(t.parsed), k = d.openAPIMajor(x), O = n.getRulesForOasVersion(k), S = u.normalizeTypes(n.extendTypes((null != r ? r : k === d.OasMajorVersion.Version3) ? x === w.Version3_1 ? c.Oas3_1Types : s.Oas3Types : l.Oas2Types, x), n), E = h.initRules(O, n, "preprocessors", x), P = h.initRules(O, n, "decorators", x), A = { problems: [], oasVersion: x, refTypes: new Map, visitorsData: {} }; g && P.push({ severity: "error", ruleId: "remove-unused-components", visitor: k === d.OasMajorVersion.Version2 ? v.RemoveUnusedComponents({}) : b.RemoveUnusedComponents({}) }); const $ = yield i.resolveDocument({ rootDocument: t, rootType: S.DefinitionRoot, externalRefResolver: o }), C = a.normalizeVisitors([...E, { severity: "error", ruleId: "bundler", visitor: _(k, f, m, t, $, y) }, ...P], S); return p.walkDocument({ document: t, rootType: S.DefinitionRoot, normalizedVisitors: C, resolvedRefMap: $, ctx: A }), { bundle: t, problems: A.problems.map((e => n.addProblemToIgnore(e))), fileDependencies: o.getFiles(), rootType: S.DefinitionRoot, refTypes: A.refTypes, visitorsData: A.visitorsData } })) } function k(e, t) { switch (t) { case d.OasMajorVersion.Version3: switch (e) { case "Schema": return "schemas"; case "Parameter": return "parameters"; case "Response": return "responses"; case "Example": return "examples"; case "RequestBody": return "requestBodies"; case "Header": return "headers"; case "SecuritySchema": return "securitySchemes"; case "Link": return "links"; case "Callback": return "callbacks"; default: return null }case d.OasMajorVersion.Version2: switch (e) { case "Schema": return "definitions"; case "Parameter": return "parameters"; case "Response": return "responses"; default: return null } } } function _(e, t, n, r, a, s) { let l; const c = { ref: { leave(o, l, c) { if (!c.location || void 0 === c.node) return void m.reportUnresolvedRef(c, l.report, l.location); if (c.location.source === r.source && c.location.source === l.location.source && "scalar" !== l.type.name && !t) return; if (n && y.isRedoclyRegistryURL(o.$ref)) return; if (s && f.isAbsoluteUrl(o.$ref)) return; const d = k(l.type.name, e); d ? t ? (p(d, c, l), u(o, c, l)) : (o.$ref = p(d, c, l), function (e, t, n) { const o = i.makeRefId(n.location.source.absoluteRef, e.$ref); a.set(o, { document: r, isRemote: !1, node: t.node, nodePointer: e.$ref, resolved: !0 }) }(o, c, l)) : u(o, c, l) } }, DefinitionRoot: { enter(t) { e === d.OasMajorVersion.Version3 ? l = t.components = t.components || {} : e === d.OasMajorVersion.Version2 && (l = t) } } }; function u(e, t, n) { g.isPlainObject(t.node) ? (delete e.$ref, Object.assign(e, t.node)) : n.parent[n.key] = t.node } function p(t, n, r) { l[t] = l[t] || {}; const o = function (e, t, n) { const [r, o] = [e.location.source.absoluteRef, e.location.pointer], i = l[t]; let a = ""; const s = o.slice(2).split("/").filter(Boolean); for (; s.length > 0;)if (a = s.pop() + (a ? `-${a}` : ""), !i || !i[a] || h(i[a], e, n)) return a; if (a = f.refBaseName(r) + (a ? `_${a}` : ""), !i[a] || h(i[a], e, n)) return a; const c = a; let u = 2; for (; i[a] && !h(i[a], e, n);)a = `${c}-${u}`, u++; return i[a] || n.report({ message: `Two schemas are referenced with the same name but different content. Renamed ${c} to ${a}.`, location: n.location, forceSeverity: "warn" }), a }(n, t, r); return l[t][o] = n.node, e === d.OasMajorVersion.Version3 ? `#/components/${t}/${o}` : `#/${t}/${o}` } function h(e, t, n) { var r; return !(!f.isRef(e) || (null === (r = n.resolve(e).location) || void 0 === r ? void 0 : r.absolutePointer) !== t.location.absolutePointer) || o(e, t.node) } return e === d.OasMajorVersion.Version3 && (c.DiscriminatorMapping = { leave(n, r) { for (const o of Object.keys(n)) { const i = n[o], a = r.resolve({ $ref: i }); if (!a.location || void 0 === a.node) return void m.reportUnresolvedRef(a, r.report, r.location.child(o)); const s = k("Schema", e); t ? p(s, a, r) : n[o] = p(s, a, r) } } }), c } !function (e) { e.Version2 = "oas2", e.Version3_0 = "oas3_0", e.Version3_1 = "oas3_1" }(w = t.OasVersion || (t.OasVersion = {})), t.bundle = function (e) { return r(this, void 0, void 0, (function* () { const { ref: t, doc: n, externalRefResolver: r = new i.BaseResolver(e.config.resolve), base: o = null } = e; if (!t && !n) throw new Error("Document or reference is required.\n"); const a = void 0 !== n ? n : yield r.resolveDocument(o, t, !0); if (a instanceof Error) throw a; return x(Object.assign(Object.assign({ document: a }, e), { config: e.config.lint, externalRefResolver: r })) })) }, t.bundleDocument = x, t.mapTypeToComponent = k }, 6877: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = { rules: { "info-description": "error", "info-contact": "error", "info-license": "error", "info-license-url": "error", "tag-description": "error", "tags-alphabetical": "error", "parameter-description": "error", "no-identical-paths": "error", "no-ambiguous-paths": "error", "no-path-trailing-slash": "error", "path-segment-plural": "error", "path-declaration-must-exist": "error", "path-not-include-query": "error", "path-parameters-defined": "error", "operation-description": "error", "operation-2xx-response": "error", "operation-4xx-response": "error", assertions: "error", "operation-operationId": "error", "operation-summary": "error", "operation-operationId-unique": "error", "operation-operationId-url-safe": "error", "operation-parameters-unique": "error", "operation-tag-defined": "error", "operation-security-defined": "error", "operation-singular-tag": "error", "no-unresolved-refs": "error", "no-enum-type-mismatch": "error", "boolean-parameter-prefixes": "error", "paths-kebab-case": "error", "no-http-verbs-in-paths": "error", "path-excludes-patterns": { severity: "error", patterns: [] }, "request-mime-type": "error", spec: "error", "no-invalid-schema-examples": "error", "no-invalid-parameter-examples": "error", "scalar-property-missing-example": "error" }, oas3_0Rules: { "no-invalid-media-type-examples": "error", "no-server-example.com": "error", "no-server-trailing-slash": "error", "no-empty-servers": "error", "no-example-value-and-externalValue": "error", "no-unused-components": "error", "no-undefined-server-variable": "error", "no-servers-empty-enum": "error" }, oas3_1Rules: { "no-server-example.com": "error", "no-server-trailing-slash": "error", "no-empty-servers": "error", "no-example-value-and-externalValue": "error", "no-unused-components": "error", "no-undefined-server-variable": "error", "no-servers-empty-enum": "error" } } }, 6242: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.defaultPlugin = t.builtInConfigs = void 0; const r = n(8057), o = n(6877), i = n(9016), a = n(226), s = n(7523), l = n(226), c = n(7523), u = n(1753), p = n(7060); t.builtInConfigs = { recommended: r.default, minimal: i.default, all: o.default, "redocly-registry": { decorators: { "registry-dependencies": "on" } } }, t.defaultPlugin = { id: "", rules: { oas3: a.rules, oas2: s.rules }, preprocessors: { oas3: l.preprocessors, oas2: c.preprocessors }, decorators: { oas3: u.decorators, oas2: p.decorators }, configs: t.builtInConfigs } }, 7040: function (e, t, n) { "use strict"; var r = this && this.__awaiter || function (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) { var t; e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) { e(t) }))).then(a, s) } l((r = r.apply(e, t || [])).next()) })) }, o = this && this.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (null != e && "function" == typeof Object.getOwnPropertySymbols) { var o = 0; for (r = Object.getOwnPropertySymbols(e); o < r.length; o++)t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]) } return n }; Object.defineProperty(t, "__esModule", { value: !0 }), t.resolvePreset = t.resolveLint = t.resolveApis = t.resolvePlugins = t.resolveConfig = void 0; const i = n(6470), a = n(6212), s = n(7468), l = n(4182), c = n(6242), u = n(2565), p = n(771), d = n(3777); function f(e, t = "") { if (!e) return []; const n = require, r = new Map; return e.map((e => { if (p.isString(e) && s.isAbsoluteUrl(e)) throw new Error(a.red("We don't support remote plugins yet.")); const o = p.isString(e) ? n(i.resolve(i.dirname(t), e)) : e, l = o.id; if ("string" != typeof l) throw new Error(a.red(`Plugin must define \`id\` property in ${a.blue(e.toString())}.`)); if (r.has(l)) { const t = r.get(l); throw new Error(a.red(`Plugin "id" must be unique. Plugin ${a.blue(e.toString())} uses id "${a.blue(l)}" already seen in ${a.blue(t)}`)) } r.set(l, e.toString()); const c = Object.assign(Object.assign({ id: l }, o.configs ? { configs: o.configs } : {}), o.typeExtension ? { typeExtension: o.typeExtension } : {}); if (o.rules) { if (!o.rules.oas3 && !o.rules.oas2) throw new Error(`Plugin rules must have \`oas3\` or \`oas2\` rules "${e}.`); c.rules = {}, o.rules.oas3 && (c.rules.oas3 = u.prefixRules(o.rules.oas3, l)), o.rules.oas2 && (c.rules.oas2 = u.prefixRules(o.rules.oas2, l)) } if (o.preprocessors) { if (!o.preprocessors.oas3 && !o.preprocessors.oas2) throw new Error(`Plugin \`preprocessors\` must have \`oas3\` or \`oas2\` preprocessors "${e}.`); c.preprocessors = {}, o.preprocessors.oas3 && (c.preprocessors.oas3 = u.prefixRules(o.preprocessors.oas3, l)), o.preprocessors.oas2 && (c.preprocessors.oas2 = u.prefixRules(o.preprocessors.oas2, l)) } if (o.decorators) { if (!o.decorators.oas3 && !o.decorators.oas2) throw new Error(`Plugin \`decorators\` must have \`oas3\` or \`oas2\` decorators "${e}.`); c.decorators = {}, o.decorators.oas3 && (c.decorators.oas3 = u.prefixRules(o.decorators.oas3, l)), o.decorators.oas2 && (c.decorators.oas2 = u.prefixRules(o.decorators.oas2, l)) } return c })).filter(p.notUndefined) } function h({ rawConfig: e, configPath: t = "", resolver: n }) { var o, i; return r(this, void 0, void 0, (function* () { const { apis: r = {}, lint: a = {} } = e; let s = {}; for (const [e, l] of Object.entries(r || {})) { if (null === (i = null === (o = l.lint) || void 0 === o ? void 0 : o.extends) || void 0 === i ? void 0 : i.some(p.isNotString)) throw new Error("Error configuration format not detected in extends value must contain strings"); const r = v(a, l.lint), c = yield g({ lintConfig: r, configPath: t, resolver: n }); s[e] = Object.assign(Object.assign({}, l), { lint: c }) } return s })) } function m({ lintConfig: e, configPath: t = "", resolver: n = new l.BaseResolver }, a = [], d = []) { var h, g, v; return r(this, void 0, void 0, (function* () { if (a.includes(t)) throw new Error(`Circular dependency in config file: "${t}"`); const l = u.getUniquePlugins(f([...(null == e ? void 0 : e.plugins) || [], c.defaultPlugin], t)), b = null === (h = null == e ? void 0 : e.plugins) || void 0 === h ? void 0 : h.filter(p.isString).map((e => i.resolve(i.dirname(t), e))), w = s.isAbsoluteUrl(t) ? t : t && i.resolve(t), x = yield Promise.all((null === (g = null == e ? void 0 : e.extends) || void 0 === g ? void 0 : g.map((e => r(this, void 0, void 0, (function* () { if (!s.isAbsoluteUrl(e) && !i.extname(e)) return y(e, l); const o = s.isAbsoluteUrl(e) ? e : s.isAbsoluteUrl(t) ? new URL(e, t).href : i.resolve(i.dirname(t), e), c = yield function (e, t) { return r(this, void 0, void 0, (function* () { try { const n = yield t.loadExternalRef(e), r = u.transformConfig(p.parseYaml(n.body)); if (!r.lint) throw new Error(`Lint configuration format not detected: "${e}"`); return r.lint } catch (t) { throw new Error(`Failed to load "${e}": ${t.message}`) } })) }(o, n); return yield m({ lintConfig: c, configPath: o, resolver: n }, [...a, w], d) }))))) || []), k = u.mergeExtends([...x, Object.assign(Object.assign({}, e), { plugins: l, extends: void 0, extendPaths: [...a, w], pluginPaths: b })]), { plugins: _ = [] } = k, O = o(k, ["plugins"]); return Object.assign(Object.assign({}, O), { extendPaths: null === (v = O.extendPaths) || void 0 === v ? void 0 : v.filter((e => e && !s.isAbsoluteUrl(e))), plugins: u.getUniquePlugins(_), recommendedFallback: null == e ? void 0 : e.recommendedFallback, doNotResolveExamples: null == e ? void 0 : e.doNotResolveExamples }) })) } function g(e, t = [], n = []) { return r(this, void 0, void 0, (function* () { const r = yield m(e, t, n); return Object.assign(Object.assign({}, r), { rules: r.rules && b(r.rules) }) })) } function y(e, t) { var n; const { pluginId: r, configName: o } = u.parsePresetName(e), i = t.find((e => e.id === r)); if (!i) throw new Error(`Invalid config ${a.red(e)}: plugin ${r} is not included.`); const s = null === (n = i.configs) || void 0 === n ? void 0 : n[o]; if (!s) throw new Error(r ? `Invalid config ${a.red(e)}: plugin ${r} doesn't export config with name ${o}.` : `Invalid config ${a.red(e)}: there is no such built-in config.`); return s } function v(e, t) { return Object.assign(Object.assign(Object.assign({}, e), t), { rules: Object.assign(Object.assign({}, null == e ? void 0 : e.rules), null == t ? void 0 : t.rules), oas2Rules: Object.assign(Object.assign({}, null == e ? void 0 : e.oas2Rules), null == t ? void 0 : t.oas2Rules), oas3_0Rules: Object.assign(Object.assign({}, null == e ? void 0 : e.oas3_0Rules), null == t ? void 0 : t.oas3_0Rules), oas3_1Rules: Object.assign(Object.assign({}, null == e ? void 0 : e.oas3_1Rules), null == t ? void 0 : t.oas3_1Rules), preprocessors: Object.assign(Object.assign({}, null == e ? void 0 : e.preprocessors), null == t ? void 0 : t.preprocessors), oas2Preprocessors: Object.assign(Object.assign({}, null == e ? void 0 : e.oas2Preprocessors), null == t ? void 0 : t.oas2Preprocessors), oas3_0Preprocessors: Object.assign(Object.assign({}, null == e ? void 0 : e.oas3_0Preprocessors), null == t ? void 0 : t.oas3_0Preprocessors), oas3_1Preprocessors: Object.assign(Object.assign({}, null == e ? void 0 : e.oas3_1Preprocessors), null == t ? void 0 : t.oas3_1Preprocessors), decorators: Object.assign(Object.assign({}, null == e ? void 0 : e.decorators), null == t ? void 0 : t.decorators), oas2Decorators: Object.assign(Object.assign({}, null == e ? void 0 : e.oas2Decorators), null == t ? void 0 : t.oas2Decorators), oas3_0Decorators: Object.assign(Object.assign({}, null == e ? void 0 : e.oas3_0Decorators), null == t ? void 0 : t.oas3_0Decorators), oas3_1Decorators: Object.assign(Object.assign({}, null == e ? void 0 : e.oas3_1Decorators), null == t ? void 0 : t.oas3_1Decorators), recommendedFallback: !(null == t ? void 0 : t.extends) && e.recommendedFallback }) } function b(e) { if (!e) return e; const t = {}, n = []; for (const [r, o] of Object.entries(e)) if (r.startsWith("assert/") && "object" == typeof o && null !== o) { const e = o; n.push(Object.assign(Object.assign({}, e), { assertionId: r.replace("assert/", "") })) } else t[r] = o; return n.length > 0 && (t.assertions = n), t } t.resolveConfig = function (e, t) { var n, o, i, a, s; return r(this, void 0, void 0, (function* () { if (null === (o = null === (n = e.lint) || void 0 === n ? void 0 : n.extends) || void 0 === o ? void 0 : o.some(p.isNotString)) throw new Error("Error configuration format not detected in extends value must contain strings"); const r = new l.BaseResolver(u.getResolveConfig(e.resolve)), c = null !== (a = null === (i = null == e ? void 0 : e.lint) || void 0 === i ? void 0 : i.extends) && void 0 !== a ? a : ["recommended"], f = !(null === (s = null == e ? void 0 : e.lint) || void 0 === s ? void 0 : s.extends), m = Object.assign(Object.assign({}, null == e ? void 0 : e.lint), { extends: c, recommendedFallback: f }), y = yield h({ rawConfig: Object.assign(Object.assign({}, e), { lint: m }), configPath: t, resolver: r }), v = yield g({ lintConfig: m, configPath: t, resolver: r }); return new d.Config(Object.assign(Object.assign({}, e), { apis: y, lint: v }), t) })) }, t.resolvePlugins = f, t.resolveApis = h, t.resolveLint = g, t.resolvePreset = y }, 3777: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.Config = t.LintConfig = t.AVAILABLE_REGIONS = t.DOMAINS = t.DEFAULT_REGION = t.IGNORE_FILE = t.env = void 0; const r = n(5101), o = n(6470), i = n(5273), a = n(771), s = n(1510), l = n(2565); t.env = "undefined" != typeof process && {} || {}, t.IGNORE_FILE = ".redocly.lint-ignore.yaml", t.DEFAULT_REGION = "us", t.DOMAINS = function () { const e = { us: "redocly.com", eu: "eu.redocly.com" }, n = t.env.REDOCLY_DOMAIN; return (null == n ? void 0 : n.endsWith(".redocly.host")) && (e[n.split(".")[0]] = n), "redoc.online" === n && (e[n] = n), e }(), t.AVAILABLE_REGIONS = Object.keys(t.DOMAINS); class c { constructor(e, n) { this.rawConfig = e, this.configFile = n, this.ignore = {}, this._usedRules = new Set, this._usedVersions = new Set, this.plugins = e.plugins || [], this.doNotResolveExamples = !!e.doNotResolveExamples, this.recommendedFallback = e.recommendedFallback || !1, this.rules = { [s.OasVersion.Version2]: Object.assign(Object.assign({}, e.rules), e.oas2Rules), [s.OasVersion.Version3_0]: Object.assign(Object.assign({}, e.rules), e.oas3_0Rules), [s.OasVersion.Version3_1]: Object.assign(Object.assign({}, e.rules), e.oas3_1Rules) }, this.preprocessors = { [s.OasVersion.Version2]: Object.assign(Object.assign({}, e.preprocessors), e.oas2Preprocessors), [s.OasVersion.Version3_0]: Object.assign(Object.assign({}, e.preprocessors), e.oas3_0Preprocessors), [s.OasVersion.Version3_1]: Object.assign(Object.assign({}, e.preprocessors), e.oas3_1Preprocessors) }, this.decorators = { [s.OasVersion.Version2]: Object.assign(Object.assign({}, e.decorators), e.oas2Decorators), [s.OasVersion.Version3_0]: Object.assign(Object.assign({}, e.decorators), e.oas3_0Decorators), [s.OasVersion.Version3_1]: Object.assign(Object.assign({}, e.decorators), e.oas3_1Decorators) }, this.extendPaths = e.extendPaths || [], this.pluginPaths = e.pluginPaths || []; const a = this.configFile ? o.dirname(this.configFile) : "undefined" != typeof process && process.cwd() || "", l = o.join(a, t.IGNORE_FILE); if (r.hasOwnProperty("existsSync") && r.existsSync(l)) { this.ignore = i.parseYaml(r.readFileSync(l, "utf-8")) || {}; for (const e of Object.keys(this.ignore)) { this.ignore[o.resolve(o.dirname(l), e)] = this.ignore[e]; for (const t of Object.keys(this.ignore[e])) this.ignore[e][t] = new Set(this.ignore[e][t]); delete this.ignore[e] } } } saveIgnore() { const e = this.configFile ? o.dirname(this.configFile) : process.cwd(), n = o.join(e, t.IGNORE_FILE), s = {}; for (const t of Object.keys(this.ignore)) { const n = s[a.slash(o.relative(e, t))] = this.ignore[t]; for (const e of Object.keys(n)) n[e] = Array.from(n[e]) } r.writeFileSync(n, "# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.\n# See https://redoc.ly/docs/cli/ for more information.\n" + i.stringifyYaml(s)) } addIgnore(e) { const t = this.ignore, n = e.location[0]; if (void 0 === n.pointer) return; const r = t[n.source.absoluteRef] = t[n.source.absoluteRef] || {}; (r[e.ruleId] = r[e.ruleId] || new Set).add(n.pointer) } addProblemToIgnore(e) { const t = e.location[0]; if (void 0 === t.pointer) return e; const n = (this.ignore[t.source.absoluteRef] || {})[e.ruleId], r = n && n.has(t.pointer); return r ? Object.assign(Object.assign({}, e), { ignored: r }) : e } extendTypes(e, t) { let n = e; for (const e of this.plugins) if (void 0 !== e.typeExtension) switch (t) { case s.OasVersion.Version3_0: case s.OasVersion.Version3_1: if (!e.typeExtension.oas3) continue; n = e.typeExtension.oas3(n, t); case s.OasVersion.Version2: if (!e.typeExtension.oas2) continue; n = e.typeExtension.oas2(n, t); default: throw new Error("Not implemented") }return n } getRuleSettings(e, t) { this._usedRules.add(e), this._usedVersions.add(t); const n = this.rules[t][e] || "off"; return "string" == typeof n ? { severity: n } : Object.assign({ severity: "error" }, n) } getPreprocessorSettings(e, t) { this._usedRules.add(e), this._usedVersions.add(t); const n = this.preprocessors[t][e] || "off"; return "string" == typeof n ? { severity: "on" === n ? "error" : n } : Object.assign({ severity: "error" }, n) } getDecoratorSettings(e, t) { this._usedRules.add(e), this._usedVersions.add(t); const n = this.decorators[t][e] || "off"; return "string" == typeof n ? { severity: "on" === n ? "error" : n } : Object.assign({ severity: "error" }, n) } getUnusedRules() { const e = [], t = [], n = []; for (const r of Array.from(this._usedVersions)) e.push(...Object.keys(this.rules[r]).filter((e => !this._usedRules.has(e)))), t.push(...Object.keys(this.decorators[r]).filter((e => !this._usedRules.has(e)))), n.push(...Object.keys(this.preprocessors[r]).filter((e => !this._usedRules.has(e)))); return { rules: e, preprocessors: n, decorators: t } } getRulesForOasVersion(e) { switch (e) { case s.OasMajorVersion.Version3: const e = []; return this.plugins.forEach((t => { var n; return (null === (n = t.preprocessors) || void 0 === n ? void 0 : n.oas3) && e.push(t.preprocessors.oas3) })), this.plugins.forEach((t => { var n; return (null === (n = t.rules) || void 0 === n ? void 0 : n.oas3) && e.push(t.rules.oas3) })), this.plugins.forEach((t => { var n; return (null === (n = t.decorators) || void 0 === n ? void 0 : n.oas3) && e.push(t.decorators.oas3) })), e; case s.OasMajorVersion.Version2: const t = []; return this.plugins.forEach((e => { var n; return (null === (n = e.preprocessors) || void 0 === n ? void 0 : n.oas2) && t.push(e.preprocessors.oas2) })), this.plugins.forEach((e => { var n; return (null === (n = e.rules) || void 0 === n ? void 0 : n.oas2) && t.push(e.rules.oas2) })), this.plugins.forEach((e => { var n; return (null === (n = e.decorators) || void 0 === n ? void 0 : n.oas2) && t.push(e.decorators.oas2) })), t } } skipRules(e) { for (const t of e || []) for (const e of Object.values(s.OasVersion)) this.rules[e][t] && (this.rules[e][t] = "off") } skipPreprocessors(e) { for (const t of e || []) for (const e of Object.values(s.OasVersion)) this.preprocessors[e][t] && (this.preprocessors[e][t] = "off") } skipDecorators(e) { for (const t of e || []) for (const e of Object.values(s.OasVersion)) this.decorators[e][t] && (this.decorators[e][t] = "off") } } t.LintConfig = c, t.Config = class { constructor(e, t) { this.rawConfig = e, this.configFile = t, this.apis = e.apis || {}, this.lint = new c(e.lint || {}, t), this["features.openapi"] = e["features.openapi"] || {}, this["features.mockServer"] = e["features.mockServer"] || {}, this.resolve = l.getResolveConfig(null == e ? void 0 : e.resolve), this.region = e.region, this.organization = e.organization } } }, 8698: function (e, t, n) { "use strict"; var r = this && this.__createBinding || (Object.create ? function (e, t, n, r) { void 0 === r && (r = n), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[n] } }) } : function (e, t, n, r) { void 0 === r && (r = n), e[r] = t[n] }), o = this && this.__exportStar || function (e, t) { for (var n in e) "default" === n || Object.prototype.hasOwnProperty.call(t, n) || r(t, e, n) }; Object.defineProperty(t, "__esModule", { value: !0 }), o(n(3777), t), o(n(3865), t), o(n(5030), t), o(n(6242), t), o(n(9129), t), o(n(2565), t), o(n(7040), t) }, 9129: function (e, t, n) { "use strict"; var r = this && this.__awaiter || function (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) { var t; e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) { e(t) }))).then(a, s) } l((r = r.apply(e, t || [])).next()) })) }; Object.defineProperty(t, "__esModule", { value: !0 }), t.getConfig = t.findConfig = t.CONFIG_FILE_NAMES = t.loadConfig = void 0; const o = n(5101), i = n(6470), a = n(1094), s = n(771), l = n(3777), c = n(2565), u = n(7040); function p(e) { if (!o.hasOwnProperty("existsSync")) return; const n = t.CONFIG_FILE_NAMES.map((t => e ? i.resolve(e, t) : t)).filter(o.existsSync); if (n.length > 1) throw new Error(`\n Multiple configuration files are not allowed. \n Found the following files: ${n.join(", ")}. \n Please use 'redocly.yaml' instead.\n `); return n[0] } function d(e = p()) { return r(this, void 0, void 0, (function* () { if (!e) return {}; try { const t = (yield s.loadYaml(e)) || {}; return c.transformConfig(t) } catch (t) { throw new Error(`Error parsing config file at '${e}': ${t.message}`) } })) } t.loadConfig = function (e = p(), t, n) { return r(this, void 0, void 0, (function* () { const o = yield d(e); return "function" == typeof n && (yield n(o)), yield function ({ rawConfig: e, customExtends: t, configPath: n }) { var o; return r(this, void 0, void 0, (function* () { void 0 !== t ? (e.lint = e.lint || {}, e.lint.extends = t) : s.isEmptyObject(e); const r = new a.RedoclyClient, i = yield r.getTokens(); if (i.length) { e.resolve || (e.resolve = {}), e.resolve.http || (e.resolve.http = {}), e.resolve.http.headers = [...null !== (o = e.resolve.http.headers) && void 0 !== o ? o : []]; for (const t of i) { const n = l.DOMAINS[t.region]; e.resolve.http.headers.push({ matches: `https://api.${n}/registry/**`, name: "Authorization", envVariable: void 0, value: t.token }, ..."us" === t.region ? [{ matches: "https://api.redoc.ly/registry/**", name: "Authorization", envVariable: void 0, value: t.token }] : []) } } return u.resolveConfig(e, n) })) }({ rawConfig: o, customExtends: t, configPath: e }) })) }, t.CONFIG_FILE_NAMES = ["redocly.yaml", "redocly.yml", ".redocly.yaml", ".redocly.yml"], t.findConfig = p, t.getConfig = d }, 9016: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = { rules: { "info-description": "warn", "info-contact": "off", "info-license": "off", "info-license-url": "off", "tag-description": "warn", "tags-alphabetical": "off", "parameter-description": "off", "no-path-trailing-slash": "warn", "no-identical-paths": "warn", "no-ambiguous-paths": "warn", "path-declaration-must-exist": "warn", "path-not-include-query": "warn", "path-parameters-defined": "warn", "operation-description": "off", "operation-2xx-response": "warn", "operation-4xx-response": "off", assertions: "warn", "operation-operationId": "warn", "operation-summary": "warn", "operation-operationId-unique": "warn", "operation-parameters-unique": "warn", "operation-tag-defined": "off", "operation-security-defined": "warn", "operation-operationId-url-safe": "warn", "operation-singular-tag": "off", "no-unresolved-refs": "error", "no-enum-type-mismatch": "warn", "boolean-parameter-prefixes": "off", "paths-kebab-case": "off", spec: "error" }, oas3_0Rules: { "no-invalid-media-type-examples": { severity: "warn", disallowAdditionalProperties: !0 }, "no-server-example.com": "warn", "no-server-trailing-slash": "error", "no-empty-servers": "warn", "no-example-value-and-externalValue": "warn", "no-unused-components": "warn", "no-undefined-server-variable": "warn", "no-servers-empty-enum": "error" }, oas3_1Rules: { "no-server-example.com": "warn", "no-server-trailing-slash": "error", "no-empty-servers": "warn", "no-example-value-and-externalValue": "warn", "no-unused-components": "warn", "no-undefined-server-variable": "warn", "no-servers-empty-enum": "error" } } }, 8057: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.default = { rules: { "info-description": "warn", "info-contact": "off", "info-license": "warn", "info-license-url": "warn", "tag-description": "warn", "tags-alphabetical": "off", "parameter-description": "off", "no-path-trailing-slash": "error", "no-identical-paths": "error", "no-ambiguous-paths": "warn", "path-declaration-must-exist": "error", "path-not-include-query": "error", "path-parameters-defined": "error", "operation-description": "off", "operation-2xx-response": "warn", assertions: "warn", "operation-4xx-response": "warn", "operation-operationId": "warn", "operation-summary": "error", "operation-operationId-unique": "error", "operation-operationId-url-safe": "error", "operation-parameters-unique": "error", "operation-tag-defined": "off", "operation-security-defined": "error", "operation-singular-tag": "off", "no-unresolved-refs": "error", "no-enum-type-mismatch": "error", "boolean-parameter-prefixes": "off", "paths-kebab-case": "off", spec: "error" }, oas3_0Rules: { "no-invalid-media-type-examples": { severity: "warn", disallowAdditionalProperties: !0 }, "no-server-example.com": "warn", "no-server-trailing-slash": "error", "no-empty-servers": "error", "no-example-value-and-externalValue": "error", "no-unused-components": "warn", "no-undefined-server-variable": "error", "no-servers-empty-enum": "error" }, oas3_1Rules: { "no-server-example.com": "warn", "no-server-trailing-slash": "error", "no-empty-servers": "error", "no-example-value-and-externalValue": "error", "no-unused-components": "warn", "no-undefined-server-variable": "error", "no-servers-empty-enum": "error" } } }, 5030: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.initRules = void 0; const r = n(771); t.initRules = function (e, t, n, o) { return e.flatMap((e => Object.keys(e).map((r => { const i = e[r], a = "rules" === n ? t.getRuleSettings(r, o) : "preprocessors" === n ? t.getPreprocessorSettings(r, o) : t.getDecoratorSettings(r, o); if ("off" === a.severity) return; const s = i(a); return Array.isArray(s) ? s.map((e => ({ severity: a.severity, ruleId: r, visitor: e }))) : { severity: a.severity, ruleId: r, visitor: s } })))).flatMap((e => e)).filter(r.notUndefined) } }, 3865: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }) }, 2565: function (e, t, n) { "use strict"; var r = this && this.__rest || function (e, t) { var n = {}; for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (null != e && "function" == typeof Object.getOwnPropertySymbols) { var o = 0; for (r = Object.getOwnPropertySymbols(e); o < r.length; o++)t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]) } return n }; Object.defineProperty(t, "__esModule", { value: !0 }), t.getUniquePlugins = t.getResolveConfig = t.transformConfig = t.getMergedConfig = t.mergeExtends = t.prefixRules = t.transformApiDefinitionsToApis = t.parsePresetName = void 0; const o = n(6212), i = n(771), a = n(3777); function s(e = {}) { let t = {}; for (const [n, r] of Object.entries(e)) t[n] = { root: r }; return t } t.parsePresetName = function (e) { if (e.indexOf("/") > -1) { const [t, n] = e.split("/"); return { pluginId: t, configName: n } } return { pluginId: "", configName: e } }, t.transformApiDefinitionsToApis = s, t.prefixRules = function (e, t) { if (!t) return e; const n = {}; for (const r of Object.keys(e)) n[`${t}/${r}`] = e[r]; return n }, t.mergeExtends = function (e) { const t = { rules: {}, oas2Rules: {}, oas3_0Rules: {}, oas3_1Rules: {}, preprocessors: {}, oas2Preprocessors: {}, oas3_0Preprocessors: {}, oas3_1Preprocessors: {}, decorators: {}, oas2Decorators: {}, oas3_0Decorators: {}, oas3_1Decorators: {}, plugins: [], pluginPaths: [], extendPaths: [] }; for (let n of e) { if (n.extends) throw new Error(`\`extends\` is not supported in shared configs yet: ${JSON.stringify(n, null, 2)}.`); Object.assign(t.rules, n.rules), Object.assign(t.oas2Rules, n.oas2Rules), i.assignExisting(t.oas2Rules, n.rules || {}), Object.assign(t.oas3_0Rules, n.oas3_0Rules), i.assignExisting(t.oas3_0Rules, n.rules || {}), Object.assign(t.oas3_1Rules, n.oas3_1Rules), i.assignExisting(t.oas3_1Rules, n.rules || {}), Object.assign(t.preprocessors, n.preprocessors), Object.assign(t.oas2Preprocessors, n.oas2Preprocessors), i.assignExisting(t.oas2Preprocessors, n.preprocessors || {}), Object.assign(t.oas3_0Preprocessors, n.oas3_0Preprocessors), i.assignExisting(t.oas3_0Preprocessors, n.preprocessors || {}), Object.assign(t.oas3_1Preprocessors, n.oas3_1Preprocessors), i.assignExisting(t.oas3_1Preprocessors, n.preprocessors || {}), Object.assign(t.decorators, n.decorators), Object.assign(t.oas2Decorators, n.oas2Decorators), i.assignExisting(t.oas2Decorators, n.decorators || {}), Object.assign(t.oas3_0Decorators, n.oas3_0Decorators), i.assignExisting(t.oas3_0Decorators, n.decorators || {}), Object.assign(t.oas3_1Decorators, n.oas3_1Decorators), i.assignExisting(t.oas3_1Decorators, n.decorators || {}), t.plugins.push(...n.plugins || []), t.pluginPaths.push(...n.pluginPaths || []), t.extendPaths.push(...new Set(n.extendPaths)) } return t }, t.getMergedConfig = function (e, t) { var n, r, o, i, s, l; const c = [...Object.values(e.apis).map((e => { var t; return null === (t = null == e ? void 0 : e.lint) || void 0 === t ? void 0 : t.extendPaths })), null === (r = null === (n = e.rawConfig) || void 0 === n ? void 0 : n.lint) || void 0 === r ? void 0 : r.extendPaths].flat().filter(Boolean), u = [...Object.values(e.apis).map((e => { var t; return null === (t = null == e ? void 0 : e.lint) || void 0 === t ? void 0 : t.pluginPaths })), null === (i = null === (o = e.rawConfig) || void 0 === o ? void 0 : o.lint) || void 0 === i ? void 0 : i.pluginPaths].flat().filter(Boolean); return t ? new a.Config(Object.assign(Object.assign({}, e.rawConfig), { lint: Object.assign(Object.assign({}, e.apis[t] ? e.apis[t].lint : e.rawConfig.lint), { extendPaths: c, pluginPaths: u }), "features.openapi": Object.assign(Object.assign({}, e["features.openapi"]), null === (s = e.apis[t]) || void 0 === s ? void 0 : s["features.openapi"]), "features.mockServer": Object.assign(Object.assign({}, e["features.mockServer"]), null === (l = e.apis[t]) || void 0 === l ? void 0 : l["features.mockServer"]) }), e.configFile) : e }, t.transformConfig = function (e) { if (e.apis && e.apiDefinitions) throw new Error("Do not use 'apiDefinitions' field. Use 'apis' instead.\n"); if (e["features.openapi"] && e.referenceDocs) throw new Error("Do not use 'referenceDocs' field. Use 'features.openapi' instead.\n"); const t = e, { apiDefinitions: n, referenceDocs: i } = t, a = r(t, ["apiDefinitions", "referenceDocs"]); return n && process.stderr.write(`The ${o.yellow("apiDefinitions")} field is deprecated. Use ${o.green("apis")} instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties\n`), i && process.stderr.write(`The ${o.yellow("referenceDocs")} field is deprecated. Use ${o.green("features.openapi")} instead. Read more about this change: https://redocly.com/docs/api-registry/guides/migration-guide-config-file/#changed-properties\n`), Object.assign({ "features.openapi": i, apis: s(n) }, a) }, t.getResolveConfig = function (e) { var t, n; return { http: { headers: null !== (n = null === (t = null == e ? void 0 : e.http) || void 0 === t ? void 0 : t.headers) && void 0 !== n ? n : [], customFetch: void 0 } } }, t.getUniquePlugins = function (e) { const t = new Set, n = []; for (const r of e) t.has(r.id) ? r.id && process.stderr.write(`Duplicate plugin id "${o.yellow(r.id)}".\n`) : (n.push(r), t.add(r.id)); return n } }, 1988: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.checkIfMatchByStrategy = t.filter = void 0; const r = n(7468), o = n(771); function i(e) { return Array.isArray(e) ? e : [e] } t.filter = function (e, t, n) { const { parent: i, key: a } = t; let s = !1; if (Array.isArray(e)) for (let o = 0; o < e.length; o++)r.isRef(e[o]) && n(t.resolve(e[o]).node) && (e.splice(o, 1), s = !0, o--), n(e[o]) && (e.splice(o, 1), s = !0, o--); else if (o.isPlainObject(e)) for (const o of Object.keys(e)) r.isRef(e[o]) && n(t.resolve(e[o]).node) && (delete e[o], s = !0), n(e[o]) && (delete e[o], s = !0); s && (o.isEmptyObject(e) || o.isEmptyArray(e)) && delete i[a] }, t.checkIfMatchByStrategy = function (e, t, n) { return void 0 !== e && void 0 !== t && (Array.isArray(t) || Array.isArray(e) ? (t = i(t), e = i(e), "any" === n ? t.some((t => e.includes(t))) : "all" === n && t.every((t => e.includes(t)))) : e === t) } }, 9244: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.FilterIn = void 0; const r = n(1988); t.FilterIn = ({ property: e, value: t, matchStrategy: n }) => { const o = n || "any", i = n => (null == n ? void 0 : n[e]) && !r.checkIfMatchByStrategy(null == n ? void 0 : n[e], t, o); return { any: { enter: (e, t) => { r.filter(e, t, i) } } } } }, 8623: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.FilterOut = void 0; const r = n(1988); t.FilterOut = ({ property: e, value: t, matchStrategy: n }) => { const o = n || "any", i = n => r.checkIfMatchByStrategy(null == n ? void 0 : n[e], t, o); return { any: { enter: (e, t) => { r.filter(e, t, i) } } } } }, 4555: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.InfoDescriptionOverride = void 0; const r = n(771); t.InfoDescriptionOverride = ({ filePath: e }) => ({ Info: { leave(t, { report: n, location: o }) { if (!e) throw new Error('Parameter "filePath" is not provided for "info-description-override" rule'); try { t.description = r.readFileAsStringSync(e) } catch (e) { n({ message: `Failed to read markdown override file for "info.description".\n${e.message}`, location: o.child("description") }) } } } }) }, 7802: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationDescriptionOverride = void 0; const r = n(771); t.OperationDescriptionOverride = ({ operationIds: e }) => ({ Operation: { leave(t, { report: n, location: o }) { if (!t.operationId) return; if (!e) throw new Error('Parameter "operationIds" is not provided for "operation-description-override" rule'); const i = t.operationId; if (e[i]) try { t.description = r.readFileAsStringSync(e[i]) } catch (e) { n({ message: `Failed to read markdown override file for operation "${i}".\n${e.message}`, location: o.child("operationId").key() }) } } } }) }, 2287: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.RegistryDependencies = void 0; const r = n(1094); t.RegistryDependencies = () => { let e = new Set; return { DefinitionRoot: { leave(t, n) { n.getVisitorData().links = Array.from(e) } }, ref(t) { if (t.$ref) { const n = t.$ref.split("#/")[0]; r.isRedoclyRegistryURL(n) && e.add(n) } } } } }, 5830: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.RemoveXInternal = void 0; const r = n(771), o = n(7468); t.RemoveXInternal = ({ internalFlagProperty: e }) => { const t = e || "x-internal"; return { any: { enter: (e, n) => { !function (e, n) { var i, a, s, l; const { parent: c, key: u } = n; let p = !1; if (Array.isArray(e)) for (let r = 0; r < e.length; r++)o.isRef(e[r]) && (null === (i = n.resolve(e[r]).node) || void 0 === i ? void 0 : i[t]) && (e.splice(r, 1), p = !0, r--), (null === (a = e[r]) || void 0 === a ? void 0 : a[t]) && (e.splice(r, 1), p = !0, r--); else if (r.isPlainObject(e)) for (const r of Object.keys(e)) o.isRef(e[r]) && (null === (s = n.resolve(e[r]).node) || void 0 === s ? void 0 : s[t]) && (delete e[r], p = !0), (null === (l = e[r]) || void 0 === l ? void 0 : l[t]) && (delete e[r], p = !0); p && (r.isEmptyObject(e) || r.isEmptyArray(e)) && delete c[u] }(e, n) } } } } }, 423: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.TagDescriptionOverride = void 0; const r = n(771); t.TagDescriptionOverride = ({ tagNames: e }) => ({ Tag: { leave(t, { report: n }) { if (!e) throw new Error('Parameter "tagNames" is not provided for "tag-description-override" rule'); if (e[t.name]) try { t.description = r.readFileAsStringSync(e[t.name]) } catch (e) { n({ message: `Failed to read markdown override file for tag "${t.name}".\n${e.message}` }) } } } }) }, 7060: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.decorators = void 0; const r = n(2287), o = n(7802), i = n(423), a = n(4555), s = n(5830), l = n(9244), c = n(8623); t.decorators = { "registry-dependencies": r.RegistryDependencies, "operation-description-override": o.OperationDescriptionOverride, "tag-description-override": i.TagDescriptionOverride, "info-description-override": a.InfoDescriptionOverride, "remove-x-internal": s.RemoveXInternal, "filter-in": l.FilterIn, "filter-out": c.FilterOut } }, 1753: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.decorators = void 0; const r = n(2287), o = n(7802), i = n(423), a = n(4555), s = n(5830), l = n(9244), c = n(8623); t.decorators = { "registry-dependencies": r.RegistryDependencies, "operation-description-override": o.OperationDescriptionOverride, "tag-description-override": i.TagDescriptionOverride, "info-description-override": a.InfoDescriptionOverride, "remove-x-internal": s.RemoveXInternal, "filter-in": l.FilterIn, "filter-out": c.FilterOut } }, 5273: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.stringifyYaml = t.parseYaml = void 0; const r = n(3320), o = r.JSON_SCHEMA.extend({ implicit: [r.types.merge], explicit: [r.types.binary, r.types.omap, r.types.pairs, r.types.set] }); t.parseYaml = (e, t) => r.load(e, Object.assign({ schema: o }, t)), t.stringifyYaml = (e, t) => r.dump(e, t) }, 1510: function (e, t) { "use strict"; var n, r; Object.defineProperty(t, "__esModule", { value: !0 }), t.openAPIMajor = t.detectOpenAPI = t.OasMajorVersion = t.OasVersion = void 0, function (e) { e.Version2 = "oas2", e.Version3_0 = "oas3_0", e.Version3_1 = "oas3_1" }(n = t.OasVersion || (t.OasVersion = {})), function (e) { e.Version2 = "oas2", e.Version3 = "oas3" }(r = t.OasMajorVersion || (t.OasMajorVersion = {})), t.detectOpenAPI = function (e) { if ("object" != typeof e) throw new Error("Document must be JSON object, got " + typeof e); if (!e.openapi && !e.swagger) throw new Error("This doesn’t look like an OpenAPI document.\n"); if (e.openapi && "string" != typeof e.openapi) throw new Error(`Invalid OpenAPI version: should be a string but got "${typeof e.openapi}"`); if (e.openapi && e.openapi.startsWith("3.0")) return n.Version3_0; if (e.openapi && e.openapi.startsWith("3.1")) return n.Version3_1; if (e.swagger && "2.0" === e.swagger) return n.Version2; throw new Error(`Unsupported OpenAPI Version: ${e.openapi || e.swagger}`) }, t.openAPIMajor = function (e) { return e === n.Version2 ? r.Version2 : r.Version3 } }, 1094: function (e, t, n) { "use strict"; var r = this && this.__awaiter || function (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) { var t; e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) { e(t) }))).then(a, s) } l((r = r.apply(e, t || [])).next()) })) }; Object.defineProperty(t, "__esModule", { value: !0 }), t.isRedoclyRegistryURL = t.RedoclyClient = void 0; const o = n(2116), i = n(6470), a = n(6918), s = n(8836), l = n(1390), c = n(3777), u = n(771), p = ".redocly-config.json"; t.RedoclyClient = class { constructor(e) { this.accessTokens = {}, this.region = this.loadRegion(e), this.loadTokens(), this.domain = e ? c.DOMAINS[e] : c.env.REDOCLY_DOMAIN || c.DOMAINS[c.DEFAULT_REGION], c.env.REDOCLY_DOMAIN = this.domain, this.registryApi = new l.RegistryApi(this.accessTokens, this.region) } loadRegion(e) { if (e && !c.DOMAINS[e]) throw new Error(`Invalid argument: region in config file.\nGiven: ${s.green(e)}, choices: "us", "eu".`); return c.env.REDOCLY_DOMAIN ? c.AVAILABLE_REGIONS.find((e => c.DOMAINS[e] === c.env.REDOCLY_DOMAIN)) || c.DEFAULT_REGION : e || c.DEFAULT_REGION } getRegion() { return this.region } hasTokens() { return u.isNotEmptyObject(this.accessTokens) } hasToken() { return !!this.accessTokens[this.region] } getAuthorizationHeader() { return r(this, void 0, void 0, (function* () { return this.accessTokens[this.region] })) } setAccessTokens(e) { this.accessTokens = e } loadTokens() { const e = i.resolve(a.homedir(), p), t = this.readCredentialsFile(e); u.isNotEmptyObject(t) && this.setAccessTokens(Object.assign(Object.assign({}, t), t.token && !t[this.region] && { [this.region]: t.token })), c.env.REDOCLY_AUTHORIZATION && this.setAccessTokens(Object.assign(Object.assign({}, this.accessTokens), { [this.region]: c.env.REDOCLY_AUTHORIZATION })) } getAllTokens() { return Object.entries(this.accessTokens).filter((([e]) => c.AVAILABLE_REGIONS.includes(e))).map((([e, t]) => ({ region: e, token: t }))) } getValidTokens() { return r(this, void 0, void 0, (function* () { const e = this.getAllTokens(), t = yield Promise.allSettled(e.map((({ token: e, region: t }) => this.verifyToken(e, t)))); return e.filter(((e, n) => "fulfilled" === t[n].status)).map((({ token: e, region: t }) => ({ token: e, region: t, valid: !0 }))) })) } getTokens() { return r(this, void 0, void 0, (function* () { return this.hasTokens() ? yield this.getValidTokens() : [] })) } isAuthorizedWithRedoclyByRegion() { return r(this, void 0, void 0, (function* () { if (!this.hasTokens()) return !1; const e = this.accessTokens[this.region]; if (!e) return !1; try { return yield this.verifyToken(e, this.region), !0 } catch (e) { return !1 } })) } isAuthorizedWithRedocly() { return r(this, void 0, void 0, (function* () { return this.hasTokens() && u.isNotEmptyObject(yield this.getValidTokens()) })) } readCredentialsFile(e) { return o.existsSync(e) ? JSON.parse(o.readFileSync(e, "utf-8")) : {} } verifyToken(e, t, n = !1) { return r(this, void 0, void 0, (function* () { return this.registryApi.authStatus(e, t, n) })) } login(e, t = !1) { return r(this, void 0, void 0, (function* () { const n = i.resolve(a.homedir(), p); try { yield this.verifyToken(e, this.region, t) } catch (e) { throw new Error("Authorization failed. Please check if you entered a valid API key.") } const r = Object.assign(Object.assign({}, this.readCredentialsFile(n)), { [this.region]: e, token: e }); this.accessTokens = r, this.registryApi.setAccessTokens(r), o.writeFileSync(n, JSON.stringify(r, null, 2)) })) } logout() { const e = i.resolve(a.homedir(), p); o.existsSync(e) && o.unlinkSync(e) } }, t.isRedoclyRegistryURL = function (e) { const t = c.env.REDOCLY_DOMAIN || c.DOMAINS[c.DEFAULT_REGION], n = "redocly.com" === t ? "redoc.ly" : t; return !(!e.startsWith(`https://api.${t}/registry/`) && !e.startsWith(`https://api.${n}/registry/`)) } }, 1390: function (e, t, n) { "use strict"; var r = this && this.__awaiter || function (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) { var t; e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) { e(t) }))).then(a, s) } l((r = r.apply(e, t || [])).next()) })) }; Object.defineProperty(t, "__esModule", { value: !0 }), t.RegistryApi = void 0; const o = n(8150), i = n(3777), a = n(771), s = n(3244).i8; t.RegistryApi = class { constructor(e, t) { this.accessTokens = e, this.region = t } get accessToken() { return a.isNotEmptyObject(this.accessTokens) && this.accessTokens[this.region] } getBaseUrl(e = i.DEFAULT_REGION) { return `https://api.${i.DOMAINS[e]}/registry` } setAccessTokens(e) { return this.accessTokens = e, this } request(e = "", t = {}, n) { return r(this, void 0, void 0, (function* () { const r = Object.assign({}, t.headers || {}, { "x-redocly-cli-version": s }); if (!r.hasOwnProperty("authorization")) throw new Error("Unauthorized"); const i = yield o.default(`${this.getBaseUrl(n)}${e}`, Object.assign({}, t, { headers: r })); if (401 === i.status) throw new Error("Unauthorized"); if (404 === i.status) { const e = yield i.json(); throw new Error(e.code) } return i })) } authStatus(e, t, n = !1) { return r(this, void 0, void 0, (function* () { try { const n = yield this.request("", { headers: { authorization: e } }, t); return yield n.json() } catch (e) { throw n && console.log(e), e } })) } prepareFileUpload({ organizationId: e, name: t, version: n, filesHash: o, filename: i, isUpsert: a }) { return r(this, void 0, void 0, (function* () { const r = yield this.request(`/${e}/${t}/${n}/prepare-file-upload`, { method: "POST", headers: { "content-type": "application/json", authorization: this.accessToken }, body: JSON.stringify({ filesHash: o, filename: i, isUpsert: a }) }, this.region); if (r.ok) return r.json(); throw new Error("Could not prepare file upload") })) } pushApi({ organizationId: e, name: t, version: n, rootFilePath: o, filePaths: i, branch: a, isUpsert: s, isPublic: l, batchId: c, batchSize: u }) { return r(this, void 0, void 0, (function* () { if (!(yield this.request(`/${e}/${t}/${n}`, { method: "PUT", headers: { "content-type": "application/json", authorization: this.accessToken }, body: JSON.stringify({ rootFilePath: o, filePaths: i, branch: a, isUpsert: s, isPublic: l, batchId: c, batchSize: u }) }, this.region)).ok) throw new Error("Could not push api") })) } } }, 7468: function (e, t) { "use strict"; function n(e, t) { return "" === e && (e = "#/"), "/" === e[e.length - 1] ? e + t : e + "/" + t } Object.defineProperty(t, "__esModule", { value: !0 }), t.isMappingRef = t.isAbsoluteUrl = t.refBaseName = t.pointerBaseName = t.parsePointer = t.parseRef = t.escapePointer = t.unescapePointer = t.Location = t.isRef = t.joinPointer = void 0, t.joinPointer = n, t.isRef = function (e) { return e && "string" == typeof e.$ref }; class r { constructor(e, t) { this.source = e, this.pointer = t } child(e) { return new r(this.source, n(this.pointer, (Array.isArray(e) ? e : [e]).map(i).join("/"))) } key() { return Object.assign(Object.assign({}, this), { reportOnKey: !0 }) } get absolutePointer() { return this.source.absoluteRef + ("#/" === this.pointer ? "" : this.pointer) } } function o(e) { return decodeURIComponent(e.replace(/~1/g, "/").replace(/~0/g, "~")) } function i(e) { return "number" == typeof e ? e : e.replace(/~/g, "~0").replace(/\//g, "~1") } t.Location = r, t.unescapePointer = o, t.escapePointer = i, t.parseRef = function (e) { const [t, n] = e.split("#/"); return { uri: t || null, pointer: n ? n.split("/").map(o).filter(Boolean) : [] } }, t.parsePointer = function (e) { return e.substr(2).split("/").map(o) }, t.pointerBaseName = function (e) { const t = e.split("/"); return t[t.length - 1] }, t.refBaseName = function (e) { const t = e.split(/[\/\\]/); return t[t.length - 1].replace(/\.[^.]+$/, "") }, t.isAbsoluteUrl = function (e) { return e.startsWith("http://") || e.startsWith("https://") }, t.isMappingRef = function (e) { return e.startsWith("#") || e.startsWith("https://") || e.startsWith("http://") || e.startsWith("./") || e.startsWith("../") || e.indexOf("/") > -1 } }, 4182: function (e, t, n) { "use strict"; var r = this && this.__awaiter || function (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) { var t; e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) { e(t) }))).then(a, s) } l((r = r.apply(e, t || [])).next()) })) }; Object.defineProperty(t, "__esModule", { value: !0 }), t.resolveDocument = t.BaseResolver = t.makeDocumentFromString = t.makeRefId = t.YamlParseError = t.ResolveError = t.Source = void 0; const o = n(3197), i = n(6470), a = n(7468), s = n(5220), l = n(771); class c { constructor(e, t, n) { this.absoluteRef = e, this.body = t, this.mimeType = n } getAst(e) { var t; return void 0 === this._ast && (this._ast = null !== (t = e(this.body, { filename: this.absoluteRef })) && void 0 !== t ? t : void 0, this._ast && 0 === this._ast.kind && "" === this._ast.value && 1 !== this._ast.startPosition && (this._ast.startPosition = 1, this._ast.endPosition = 1)), this._ast } getLines() { return void 0 === this._lines && (this._lines = this.body.split(/\r\n|[\n\r]/g)), this._lines } } t.Source = c; class u extends Error { constructor(e) { super(e.message), this.originalError = e, Object.setPrototypeOf(this, u.prototype) } } t.ResolveError = u; const p = /\((\d+):(\d+)\)$/; class d extends Error { constructor(e, t) { super(e.message.split("\n")[0]), this.originalError = e, this.source = t, Object.setPrototypeOf(this, d.prototype); const [, n, r] = this.message.match(p) || []; this.line = parseInt(n, 10), this.col = parseInt(r, 10) } } function f(e, t) { return e + "::" + t } function h(e, t) { return { prev: e, node: t } } t.YamlParseError = d, t.makeRefId = f, t.makeDocumentFromString = function (e, t) { const n = new c(t, e); try { return { source: n, parsed: l.parseYaml(e, { filename: t }) } } catch (e) { throw new d(e, n) } }, t.BaseResolver = class { constructor(e = { http: { headers: [] } }) { this.config = e, this.cache = new Map } getFiles() { return new Set(Array.from(this.cache.keys())) } resolveExternalRef(e, t) { return a.isAbsoluteUrl(t) ? t : e && a.isAbsoluteUrl(e) ? new URL(t, e).href : i.resolve(e ? i.dirname(e) : process.cwd(), t) } loadExternalRef(e) { return r(this, void 0, void 0, (function* () { try { if (a.isAbsoluteUrl(e)) { const { body: t, mimeType: n } = yield l.readFileFromUrl(e, this.config.http); return new c(e, t, n) } return new c(e, yield o.promises.readFile(e, "utf-8")) } catch (e) { throw new u(e) } })) } parseDocument(e, t = !1) { var n; const r = e.absoluteRef.substr(e.absoluteRef.lastIndexOf(".")); if (![".json", ".json", ".yml", ".yaml"].includes(r) && !(null === (n = e.mimeType) || void 0 === n ? void 0 : n.match(/(json|yaml|openapi)/)) && !t) return { source: e, parsed: e.body }; try { return { source: e, parsed: l.parseYaml(e.body, { filename: e.absoluteRef }) } } catch (t) { throw new d(t, e) } } resolveDocument(e, t, n = !1) { return r(this, void 0, void 0, (function* () { const r = this.resolveExternalRef(e, t), o = this.cache.get(r); if (o) return o; const i = this.loadExternalRef(r).then((e => this.parseDocument(e, n))); return this.cache.set(r, i), i })) } }; const m = { name: "unknown", properties: {} }, g = { name: "scalar", properties: {} }; t.resolveDocument = function (e) { return r(this, void 0, void 0, (function* () { const { rootDocument: t, externalRefResolver: n, rootType: o } = e, i = new Map, l = new Set, c = []; let u; !function e(t, o, u, p) { function d(e, t, o) { return r(this, void 0, void 0, (function* () { if (function (e, t) { for (; e;) { if (e.node === t) return !0; e = e.prev } return !1 }(o.prev, t)) throw new Error("Self-referencing circular pointer"); const { uri: r, pointer: s } = a.parseRef(t.$ref), l = null !== r; let c; try { c = l ? yield n.resolveDocument(e.source.absoluteRef, r) : e } catch (n) { const r = { resolved: !1, isRemote: l, document: void 0, error: n }, o = f(e.source.absoluteRef, t.$ref); return i.set(o, r), r } let u = { resolved: !0, document: c, isRemote: l, node: e.parsed, nodePointer: "#/" }, p = c.parsed; const m = s; for (let e of m) { if ("object" != typeof p) { p = void 0; break } if (void 0 !== p[e]) p = p[e], u.nodePointer = a.joinPointer(u.nodePointer, a.escapePointer(e)); else { if (!a.isRef(p)) { p = void 0; break } if (u = yield d(c, p, h(o, p)), c = u.document || c, "object" != typeof u.node) { p = void 0; break } p = u.node[e], u.nodePointer = a.joinPointer(u.nodePointer, a.escapePointer(e)) } } u.node = p, u.document = c; const g = f(e.source.absoluteRef, t.$ref); return u.document && a.isRef(p) && (u = yield d(u.document, p, h(o, p))), i.set(g, u), Object.assign({}, u) })) } !function t(n, r, i) { if ("object" != typeof n || null === n) return; const u = `${r.name}::${i}`; if (!l.has(u)) if (l.add(u), Array.isArray(n)) { const e = r.items; if (r !== m && void 0 === e) return; for (let r = 0; r < n.length; r++)t(n[r], e || m, a.joinPointer(i, r)) } else { for (const e of Object.keys(n)) { let o = n[e], l = r.properties[e]; void 0 === l && (l = r.additionalProperties), "function" == typeof l && (l = l(o, e)), void 0 === l && (l = m), !s.isNamedType(l) && (null == l ? void 0 : l.directResolveAs) && (l = l.directResolveAs, o = { $ref: o }), l && void 0 === l.name && !1 !== l.resolvable && (l = g), s.isNamedType(l) && "object" == typeof o && t(o, l, a.joinPointer(i, a.escapePointer(e))) } if (a.isRef(n)) { const t = d(o, n, { prev: null, node: n }).then((t => { t.resolved && e(t.node, t.document, t.nodePointer, r) })); c.push(t) } } }(t, p, o.source.absoluteRef + u) }(t.parsed, t, "#/", o); do { u = yield Promise.all(c) } while (c.length !== u.length); return i })) } }, 7275: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.validateJsonSchema = t.releaseAjvInstance = void 0; const r = n(5499), o = n(7468); let i = null; t.releaseAjvInstance = function () { i = null }, t.validateJsonSchema = function (e, t, n, a, s, l) { const c = function (e, t, n, o) { const a = function (e, t) { return i || (i = new r.default({ schemaId: "$id", meta: !0, allErrors: !0, strictSchema: !1, inlineRefs: !1, validateSchema: !1, discriminator: !0, allowUnionTypes: !0, validateFormats: !1, defaultAdditionalProperties: !t, loadSchemaSync(t, n) { const r = e({ $ref: n }, t.split("#")[0]); return !(!r || !r.location) && Object.assign({ $id: r.location.absolutePointer }, r.node) }, logger: !1 })), i }(n, o); return a.getSchema(t.absolutePointer) || a.addSchema(Object.assign({ $id: t.absolutePointer }, e), t.absolutePointer), a.getSchema(t.absolutePointer) }(t, n, s, l); return c ? { valid: !!c(e, { instancePath: a, parentData: { fake: {} }, parentDataProperty: "fake", rootData: {}, dynamicAnchors: {} }), errors: (c.errors || []).map((function (e) { let t = e.message, n = "enum" === e.keyword ? e.params.allowedValues : void 0; n && (t += ` ${n.map((e => `"${e}"`)).join(", ")}`), "type" === e.keyword && (t = `type ${t}`); const r = e.instancePath.substring(a.length + 1), i = r.substring(r.lastIndexOf("/") + 1); if (i && (t = `\`${i}\` property ${t}`), "additionalProperties" === e.keyword) { const n = e.params.additionalProperty; t = `${t} \`${n}\``, e.instancePath += "/" + o.escapePointer(n) } return Object.assign(Object.assign({}, e), { message: t, suggest: n }) })) } : { valid: !0, errors: [] } } }, 9740: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.asserts = t.runOnValuesSet = t.runOnKeysSet = void 0; const r = n(771), o = n(5738); t.runOnKeysSet = new Set(["mutuallyExclusive", "mutuallyRequired", "enum", "pattern", "minLength", "maxLength", "casing", "sortOrder", "disallowed", "required", "requireAny", "ref"]), t.runOnValuesSet = new Set(["pattern", "enum", "defined", "undefined", "nonEmpty", "minLength", "maxLength", "casing", "sortOrder", "ref"]), t.asserts = { pattern: (e, t, n) => { if (void 0 === e) return { isValid: !0 }; const i = r.isString(e) ? [e] : e, a = o.regexFromString(t); for (let t of i) if (!(null == a ? void 0 : a.test(t))) return { isValid: !1, location: r.isString(e) ? n : n.key() }; return { isValid: !0 } }, enum: (e, t, n) => { if (void 0 === e) return { isValid: !0 }; const o = r.isString(e) ? [e] : e; for (let i of o) if (!t.includes(i)) return { isValid: !1, location: r.isString(e) ? n : n.child(i).key() }; return { isValid: !0 } }, defined: (e, t = !0, n) => { const r = void 0 !== e; return { isValid: t ? r : !r, location: n } }, required: (e, t, n) => { for (const r of t) if (!e.includes(r)) return { isValid: !1, location: n.key() }; return { isValid: !0 } }, disallowed: (e, t, n) => { if (void 0 === e) return { isValid: !0 }; const o = r.isString(e) ? [e] : e; for (let i of o) if (t.includes(i)) return { isValid: !1, location: r.isString(e) ? n : n.child(i).key() }; return { isValid: !0 } }, undefined: (e, t = !0, n) => { const r = void 0 === e; return { isValid: t ? r : !r, location: n } }, nonEmpty: (e, t = !0, n) => { const r = null == e || "" === e; return { isValid: t ? !r : r, location: n } }, minLength: (e, t, n) => void 0 === e ? { isValid: !0 } : { isValid: e.length >= t, location: n }, maxLength: (e, t, n) => void 0 === e ? { isValid: !0 } : { isValid: e.length <= t, location: n }, casing: (e, t, n) => { if (void 0 === e) return { isValid: !0 }; const o = r.isString(e) ? [e] : e; for (let i of o) { let o = !1; switch (t) { case "camelCase": o = !!i.match(/^[a-z][a-zA-Z0-9]+$/g); break; case "kebab-case": o = !!i.match(/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/g); break; case "snake_case": o = !!i.match(/^([a-z][a-z0-9]*)(_[a-z0-9]+)*$/g); break; case "PascalCase": o = !!i.match(/^[A-Z][a-zA-Z0-9]+$/g); break; case "MACRO_CASE": o = !!i.match(/^([A-Z][A-Z0-9]*)(_[A-Z0-9]+)*$/g); break; case "COBOL-CASE": o = !!i.match(/^([A-Z][A-Z0-9]*)(-[A-Z0-9]+)*$/g); break; case "flatcase": o = !!i.match(/^[a-z][a-z0-9]+$/g) }if (!o) return { isValid: !1, location: r.isString(e) ? n : n.child(i).key() } } return { isValid: !0 } }, sortOrder: (e, t, n) => void 0 === e ? { isValid: !0 } : { isValid: o.isOrdered(e, t), location: n }, mutuallyExclusive: (e, t, n) => ({ isValid: o.getIntersectionLength(e, t) < 2, location: n.key() }), mutuallyRequired: (e, t, n) => ({ isValid: !(o.getIntersectionLength(e, t) > 0) || o.getIntersectionLength(e, t) === t.length, location: n.key() }), requireAny: (e, t, n) => ({ isValid: o.getIntersectionLength(e, t) >= 1, location: n.key() }), ref: (e, t, n, r) => { if (void 0 === r) return { isValid: !0 }; const i = r.hasOwnProperty("$ref"); if ("boolean" == typeof t) return { isValid: t ? i : !i, location: i ? n : n.key() }; const a = o.regexFromString(t); return { isValid: i && (null == a ? void 0 : a.test(r.$ref)), location: i ? n : n.key() } } } }, 4015: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.Assertions = void 0; const r = n(9740), o = n(5738); t.Assertions = e => { let t = []; const n = Object.values(e).filter((e => "object" == typeof e && null !== e)); for (const [e, i] of n.entries()) { const n = i.assertionId && `${i.assertionId} assertion` || `assertion #${e + 1}`; if (!i.subject) throw new Error(`${n}: 'subject' is required`); const a = Array.isArray(i.subject) ? i.subject : [i.subject], s = Object.keys(r.asserts).filter((e => void 0 !== i[e])).map((e => ({ assertId: n, name: e, conditions: i[e], message: i.message, severity: i.severity || "error", suggest: i.suggest || [], runsOnKeys: r.runOnKeysSet.has(e), runsOnValues: r.runOnValuesSet.has(e) }))), l = s.find((e => e.runsOnKeys && !e.runsOnValues)), c = s.find((e => e.runsOnValues && !e.runsOnKeys)); if (c && !i.property) throw new Error(`${c.name} can't be used on all keys. Please provide a single property.`); if (l && i.property) throw new Error(`${l.name} can't be used on a single property. Please use 'property'.`); for (const e of a) { const n = o.buildSubjectVisitor(i.property, s, i.context), r = o.buildVisitorObject(e, i.context, n); t.push(r) } } return t } }, 5738: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.regexFromString = t.isOrdered = t.getIntersectionLength = t.buildSubjectVisitor = t.buildVisitorObject = void 0; const r = n(7468), o = n(9740); function i({ values: e, rawValues: t, assert: n, location: r, report: i }) { const a = o.asserts[n.name](e, n.conditions, r, t); a.isValid || i({ message: n.message || `The ${n.assertId} doesn't meet required conditions`, location: a.location || r, forceSeverity: n.severity, suggest: n.suggest, ruleId: n.assertId }) } t.buildVisitorObject = function (e, t, n) { if (!t) return { [e]: n }; let r = {}; const o = r; for (let n = 0; n < t.length; n++) { const o = t[n]; if (t.length === n + 1 && o.type === e) continue; const i = o.matchParentKeys, a = o.excludeParentKeys; if (i && a) throw new Error("Both 'matchParentKeys' and 'excludeParentKeys' can't be under one context item"); r[o.type] = i || a ? { skip: (e, t) => i ? !i.includes(t) : a ? a.includes(t) : void 0 } : {}, r = r[o.type] } return r[e] = n, o }, t.buildSubjectVisitor = function (e, t, n) { return (o, { report: a, location: s, rawLocation: l, key: c, type: u, resolve: p, rawNode: d }) => { var f; if (n) { const e = n[n.length - 1]; if (e.type === u.name) { const t = e.matchParentKeys, n = e.excludeParentKeys; if (t && !t.includes(c)) return; if (n && n.includes(c)) return } } e && (e = Array.isArray(e) ? e : [e]); for (const n of t) { const t = "ref" === n.name ? l : s; if (e) for (const s of e) i({ values: r.isRef(o[s]) ? null === (f = p(o[s])) || void 0 === f ? void 0 : f.node : o[s], rawValues: d[s], assert: n, location: t.child(s), report: a }); else { const e = "ref" === n.name ? d : Object.keys(o); i({ values: Object.keys(o), rawValues: e, assert: n, location: t, report: a }) } } } }, t.getIntersectionLength = function (e, t) { const n = new Set(t); let r = 0; for (const t of e) n.has(t) && r++; return r }, t.isOrdered = function (e, t) { const n = t.direction || t, r = t.property; for (let t = 1; t < e.length; t++) { let o = e[t], i = e[t - 1]; if (r) { if (!e[t][r] || !e[t - 1][r]) return !1; o = e[t][r], i = e[t - 1][r] } if (!("asc" === n ? o >= i : o <= i)) return !1 } return !0 }, t.regexFromString = function (e) { const t = e.match(/^\/(.*)\/(.*)|(.*)/); return t && new RegExp(t[1] || t[3], t[2]) } }, 8265: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.InfoContact = void 0; const r = n(780); t.InfoContact = () => ({ Info(e, { report: t, location: n }) { e.contact || t({ message: r.missingRequiredField("Info", "contact"), location: n.child("contact").key() }) } }) }, 8675: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.InfoDescription = void 0; const r = n(780); t.InfoDescription = () => ({ Info(e, t) { r.validateDefinedAndNonEmpty("description", e, t) } }) }, 9622: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.InfoLicense = void 0; const r = n(780); t.InfoLicense = () => ({ Info(e, { report: t }) { e.license || t({ message: r.missingRequiredField("Info", "license"), location: { reportOnKey: !0 } }) } }) }, 476: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.InfoLicenseUrl = void 0; const r = n(780); t.InfoLicenseUrl = () => ({ License(e, t) { r.validateDefinedAndNonEmpty("url", e, t) } }) }, 3467: function (e, t) { "use strict"; function n(e, t) { const n = e.split("/"), r = t.split("/"); if (n.length !== r.length) return !1; let o = 0, i = 0, a = !0; for (let e = 0; e < n.length; e++) { const t = n[e].match(/^{.+?}$/), s = r[e].match(/^{.+?}$/); t || s ? (t && o++, s && i++) : n[e] !== r[e] && (a = !1) } return a && o === i } Object.defineProperty(t, "__esModule", { value: !0 }), t.NoAmbiguousPaths = void 0, t.NoAmbiguousPaths = () => ({ PathMap(e, { report: t, location: r }) { const o = []; for (const i of Object.keys(e)) { const e = o.find((e => n(e, i))); e && t({ message: `Paths should resolve unambiguously. Found two ambiguous paths: \`${e}\` and \`${i}\`.`, location: r.child([i]).key() }), o.push(i) } } }) }, 2319: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoEnumTypeMismatch = void 0; const r = n(780); t.NoEnumTypeMismatch = () => ({ Schema(e, { report: t, location: n }) { if (!e.enum || Array.isArray(e.enum)) { if (e.enum && e.type && !Array.isArray(e.type)) { const o = e.enum.filter((t => !r.matchesJsonSchemaType(t, e.type, e.nullable))); for (const i of o) t({ message: `All values of \`enum\` field must be of the same type as the \`type\` field: expected "${e.type}" but received "${r.oasTypeOf(i)}".`, location: n.child(["enum", e.enum.indexOf(i)]) }) } if (e.enum && e.type && Array.isArray(e.type)) { const o = {}; for (const t of e.enum) { o[t] = []; for (const n of e.type) r.matchesJsonSchemaType(t, n, e.nullable) || o[t].push(n); o[t].length !== e.type.length && delete o[t] } for (const r of Object.keys(o)) t({ message: `Enum value \`${r}\` must be of one type. Allowed types: \`${e.type}\`.`, location: n.child(["enum", e.enum.indexOf(r)]) }) } } } }) }, 525: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoHttpVerbsInPaths = void 0; const r = n(771), o = ["get", "head", "post", "put", "patch", "delete", "options", "trace"]; t.NoHttpVerbsInPaths = ({ splitIntoWords: e }) => ({ PathItem(t, { key: n, report: i, location: a }) { const s = n.toString(); if (!s.startsWith("/")) return; const l = s.split("/"); for (const t of l) { if (!t || r.isPathParameter(t)) continue; const n = n => e ? r.splitCamelCaseIntoWords(t).has(n) : t.toLocaleLowerCase().includes(n); for (const e of o) n(e) && i({ message: `path \`${s}\` should not contain http verb ${e}`, location: a.key() }) } } }) }, 4628: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoIdenticalPaths = void 0, t.NoIdenticalPaths = () => ({ PathMap(e, { report: t, location: n }) { const r = new Map; for (const o of Object.keys(e)) { const e = o.replace(/{.+?}/g, "{VARIABLE}"), i = r.get(e); i ? t({ message: `The path already exists which differs only by path parameter name(s): \`${i}\` and \`${o}\`.`, location: n.child([o]).key() }) : r.set(e, o) } } }) }, 1562: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoInvalidParameterExamples = void 0; const r = n(780); t.NoInvalidParameterExamples = e => { var t; const n = null === (t = e.disallowAdditionalProperties) || void 0 === t || t; return { Parameter: { leave(e, t) { if (e.example && r.validateExample(e.example, e.schema, t.location.child("example"), t, n), e.examples) for (const [n, o] of Object.entries(e.examples)) "value" in o && r.validateExample(o.value, e.schema, t.location.child(["examples", n]), t, !1) } } } } }, 78: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoInvalidSchemaExamples = void 0; const r = n(780); t.NoInvalidSchemaExamples = e => { var t; const n = null === (t = e.disallowAdditionalProperties) || void 0 === t || t; return { Schema: { leave(e, t) { if (e.examples) for (const o of e.examples) r.validateExample(o, e, t.location.child(["examples", e.examples.indexOf(o)]), t, n); e.example && r.validateExample(e.example, e, t.location.child("example"), t, !1) } } } } }, 700: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoPathTrailingSlash = void 0, t.NoPathTrailingSlash = () => ({ PathItem(e, { report: t, key: n, location: r }) { n.endsWith("/") && "/" !== n && t({ message: `\`${n}\` should not have a trailing slash.`, location: r.key() }) } }) }, 5946: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.Operation2xxResponse = void 0, t.Operation2xxResponse = () => ({ ResponsesMap(e, { report: t }) { Object.keys(e).some((e => "default" === e || /2[Xx0-9]{2}/.test(e))) || t({ message: "Operation must have at least one `2xx` response.", location: { reportOnKey: !0 } }) } }) }, 5281: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.Operation4xxResponse = void 0, t.Operation4xxResponse = () => ({ ResponsesMap(e, { report: t }) { Object.keys(e).some((e => /4[Xx0-9]{2}/.test(e))) || t({ message: "Operation must have at least one `4xx` response.", location: { reportOnKey: !0 } }) } }) }, 3408: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationDescription = void 0; const r = n(780); t.OperationDescription = () => ({ Operation(e, t) { r.validateDefinedAndNonEmpty("description", e, t) } }) }, 8742: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationIdUnique = void 0, t.OperationIdUnique = () => { const e = new Set; return { Operation(t, { report: n, location: r }) { t.operationId && (e.has(t.operationId) && n({ message: "Every operation must have a unique `operationId`.", location: r.child([t.operationId]) }), e.add(t.operationId)) } } } }, 5064: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationIdUrlSafe = void 0; const n = /^[A-Za-z0-9-._~:/?#\[\]@!\$&'()*+,;=]*$/; t.OperationIdUrlSafe = () => ({ Operation(e, { report: t, location: r }) { e.operationId && !n.test(e.operationId) && t({ message: "Operation `operationId` should not have URL invalid characters.", location: r.child(["operationId"]) }) } }) }, 8786: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationOperationId = void 0; const r = n(780); t.OperationOperationId = () => ({ DefinitionRoot: { PathItem: { Operation(e, t) { r.validateDefinedAndNonEmpty("operationId", e, t) } } } }) }, 4112: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationParametersUnique = void 0, t.OperationParametersUnique = () => { let e, t; return { PathItem: { enter() { e = new Set }, Parameter(t, { report: n, key: r, parentLocations: o }) { const i = `${t.in}___${t.name}`; e.has(i) && n({ message: `Paths must have unique \`name\` + \`in\` parameters.\nRepeats of \`in:${t.in}\` + \`name:${t.name}\`.`, location: o.PathItem.child(["parameters", r]) }), e.add(`${t.in}___${t.name}`) }, Operation: { enter() { t = new Set }, Parameter(e, { report: n, key: r, parentLocations: o }) { const i = `${e.in}___${e.name}`; t.has(i) && n({ message: `Operations must have unique \`name\` + \`in\` parameters. Repeats of \`in:${e.in}\` + \`name:${e.name}\`.`, location: o.Operation.child(["parameters", r]) }), t.add(i) } } } } } }, 7892: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationSecurityDefined = void 0, t.OperationSecurityDefined = () => { let e = new Map; return { DefinitionRoot: { leave(t, { report: n }) { for (const [t, r] of e.entries()) if (!r.defined) for (const e of r.from) n({ message: `There is no \`${t}\` security scheme defined.`, location: e.key() }) } }, SecurityScheme(t, { key: n }) { e.set(n.toString(), { defined: !0, from: [] }) }, SecurityRequirement(t, { location: n }) { for (const r of Object.keys(t)) { const t = e.get(r), o = n.child([r]); t ? t.from.push(o) : e.set(r, { from: [o] }) } } } } }, 8613: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationSingularTag = void 0, t.OperationSingularTag = () => ({ Operation(e, { report: t, location: n }) { e.tags && e.tags.length > 1 && t({ message: "Operation `tags` object should have only one tag.", location: n.child(["tags"]).key() }) } }) }, 9578: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationSummary = void 0; const r = n(780); t.OperationSummary = () => ({ Operation(e, t) { r.validateDefinedAndNonEmpty("summary", e, t) } }) }, 5097: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OperationTagDefined = void 0, t.OperationTagDefined = () => { let e; return { DefinitionRoot(t) { var n; e = new Set((null !== (n = t.tags) && void 0 !== n ? n : []).map((e => e.name))) }, Operation(t, { report: n, location: r }) { if (t.tags) for (let o = 0; o < t.tags.length; o++)e.has(t.tags[o]) || n({ message: "Operation tags should be defined in global tags.", location: r.child(["tags", o]) }) } } } }, 3529: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ParameterDescription = void 0, t.ParameterDescription = () => ({ Parameter(e, { report: t, location: n }) { void 0 === e.description ? t({ message: "Parameter object description must be present.", location: { reportOnKey: !0 } }) : e.description || t({ message: "Parameter object description must be non-empty string.", location: n.child(["description"]) }) } }) }, 7890: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.PathDeclarationMustExist = void 0, t.PathDeclarationMustExist = () => ({ PathItem(e, { report: t, key: n }) { -1 !== n.indexOf("{}") && t({ message: "Path parameter declarations must be non-empty. `{}` is invalid.", location: { reportOnKey: !0 } }) } }) }, 3689: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.PathExcludesPatterns = void 0, t.PathExcludesPatterns = ({ patterns: e }) => ({ PathItem(t, { report: n, key: r, location: o }) { if (!e) throw new Error('Parameter "patterns" is not provided for "path-excludes-patterns" rule'); const i = r.toString(); if (i.startsWith("/")) { const t = e.filter((e => i.match(e))); for (const e of t) n({ message: `path \`${i}\` should not match regex pattern: \`${e}\``, location: o.key() }) } } }) }, 2332: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.PathHttpVerbsOrder = void 0; const n = ["get", "head", "post", "put", "patch", "delete", "options", "trace"]; t.PathHttpVerbsOrder = e => { const t = e && e.order || n; if (!Array.isArray(t)) throw new Error("path-http-verbs-order `order` option must be an array"); return { PathItem(e, { report: n, location: r }) { const o = Object.keys(e).filter((e => t.includes(e))); for (let e = 0; e < o.length - 1; e++) { const i = t.indexOf(o[e]); t.indexOf(o[e + 1]) < i && n({ message: "Operation http verbs must be ordered.", location: Object.assign({ reportOnKey: !0 }, r.child(o[e + 1])) }) } } } } }, 5023: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.PathNotIncludeQuery = void 0, t.PathNotIncludeQuery = () => ({ PathMap: { PathItem(e, { report: t, key: n }) { n.toString().includes("?") && t({ message: "Don't put query string items in the path, they belong in parameters with `in: query`.", location: { reportOnKey: !0 } }) } } }) }, 7421: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.PathParamsDefined = void 0; const n = /\{([a-zA-Z0-9_.-]+)\}+/g; t.PathParamsDefined = () => { let e, t, r; return { PathItem: { enter(o, { key: i }) { t = new Set, r = i, e = new Set(Array.from(i.toString().matchAll(n)).map((e => e[1]))) }, Parameter(n, { report: o, location: i }) { "path" === n.in && n.name && (t.add(n.name), e.has(n.name) || o({ message: `Path parameter \`${n.name}\` is not used in the path \`${r}\`.`, location: i.child(["name"]) })) }, Operation: { leave(n, { report: o, location: i }) { for (const n of Array.from(e.keys())) t.has(n) || o({ message: `The operation does not define the path parameter \`{${n}}\` expected by path \`${r}\`.`, location: i.child(["parameters"]).key() }) }, Parameter(n, { report: o, location: i }) { "path" === n.in && n.name && (t.add(n.name), e.has(n.name) || o({ message: `Path parameter \`${n.name}\` is not used in the path \`${r}\`.`, location: i.child(["name"]) })) } } } } } }, 3807: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.PathSegmentPlural = void 0; const r = n(771); t.PathSegmentPlural = e => { const { ignoreLastPathSegment: t, exceptions: n } = e; return { PathItem: { leave(e, { report: o, key: i, location: a }) { const s = i.toString(); if (s.startsWith("/")) { const e = s.split("/"); e.shift(), t && e.length > 1 && e.pop(); for (const t of e) n && n.includes(t) || !r.isPathParameter(t) && r.isSingular(t) && o({ message: `path segment \`${t}\` should be plural.`, location: a.key() }) } } } } } }, 9527: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.PathsKebabCase = void 0, t.PathsKebabCase = () => ({ PathItem(e, { report: t, key: n }) { n.substr(1).split("/").filter((e => "" !== e)).every((e => /^{.+}$/.test(e) || /^[a-z0-9-.]+$/.test(e))) || t({ message: `\`${n}\` does not use kebab-case.`, location: { reportOnKey: !0 } }) } }) }, 5839: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ResponseContainsHeader = void 0; const r = n(771); t.ResponseContainsHeader = e => { const t = e.names || {}; return { Operation: { Response: { enter: (e, { report: n, location: o, key: i }) => { var a; const s = t[i] || t[r.getMatchingStatusCodeRange(i)] || t[r.getMatchingStatusCodeRange(i).toLowerCase()] || []; for (const t of s) (null === (a = e.headers) || void 0 === a ? void 0 : a[t]) || n({ message: `Response object must contain a "${t}" header.`, location: o.child("headers").key() }) } } } } } }, 5669: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ScalarPropertyMissingExample = void 0; const r = n(1510), o = ["string", "integer", "number", "boolean", "null"]; t.ScalarPropertyMissingExample = () => ({ SchemaProperties(e, { report: t, location: n, oasVersion: i, resolve: a }) { for (const l of Object.keys(e)) { const c = a(e[l]).node; c && ((s = c).type && !(s.allOf || s.anyOf || s.oneOf) && "binary" !== s.format && (Array.isArray(s.type) ? s.type.every((e => o.includes(e))) : o.includes(s.type))) && void 0 === c.example && void 0 === c.examples && t({ message: `Scalar property should have "example"${i === r.OasVersion.Version3_1 ? ' or "examples"' : ""} defined.`, location: n.child(l).key() }) } var s } }) }, 6471: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.OasSpec = void 0; const r = n(5220), o = n(780), i = n(7468), a = n(771); t.OasSpec = () => ({ any(e, { report: t, type: n, location: s, key: l, resolve: c, ignoreNextVisitorsOnNode: u }) { var p, d, f, h; const m = o.oasTypeOf(e); if (n.items) return void ("array" !== m && (t({ message: `Expected type \`${n.name}\` (array) but got \`${m}\`` }), u())); if ("object" !== m) return t({ message: `Expected type \`${n.name}\` (object) but got \`${m}\`` }), void u(); const g = "function" == typeof n.required ? n.required(e, l) : n.required; for (let n of g || []) e.hasOwnProperty(n) || t({ message: `The field \`${n}\` must be present on this level.`, location: [{ reportOnKey: !0 }] }); const y = null === (p = n.allowed) || void 0 === p ? void 0 : p.call(n, e); if (y && a.isPlainObject(e)) for (const r in e) y.includes(r) || n.extensionsPrefix && r.startsWith(n.extensionsPrefix) || !Object.keys(n.properties).includes(r) || t({ message: `The field \`${r}\` is not allowed here.`, location: s.child([r]).key() }); const v = n.requiredOneOf || null; if (v) { let r = !1; for (let t of v || []) e.hasOwnProperty(t) && (r = !0); r || t({ message: `Must contain at least one of the following fields: ${null === (d = n.requiredOneOf) || void 0 === d ? void 0 : d.join(", ")}.`, location: [{ reportOnKey: !0 }] }) } for (const a of Object.keys(e)) { const l = s.child([a]); let u = e[a], p = n.properties[a]; if (void 0 === p && (p = n.additionalProperties), "function" == typeof p && (p = p(u, a)), r.isNamedType(p)) continue; const d = p, m = o.oasTypeOf(u); if (void 0 !== d) { if (null !== d) { if (!1 !== d.resolvable && i.isRef(u) && (u = c(u).node), d.enum) d.enum.includes(u) || t({ location: l, message: `\`${a}\` can be one of the following only: ${d.enum.map((e => `"${e}"`)).join(", ")}.`, suggest: o.getSuggest(u, d.enum) }); else if (d.type && !o.matchesJsonSchemaType(u, d.type, !1)) t({ message: `Expected type \`${d.type}\` but got \`${m}\`.`, location: l }); else if ("array" === m && (null === (f = d.items) || void 0 === f ? void 0 : f.type)) { const e = null === (h = d.items) || void 0 === h ? void 0 : h.type; for (let n = 0; n < u.length; n++) { const r = u[n]; o.matchesJsonSchemaType(r, e, !1) || t({ message: `Expected type \`${e}\` but got \`${o.oasTypeOf(r)}\`.`, location: l.child([n]) }) } } "number" == typeof d.minimum && d.minimum > e[a] && t({ message: `The value of the ${a} field must be greater than or equal to ${d.minimum}`, location: s.child([a]) }) } } else { if (a.startsWith("x-")) continue; t({ message: `Property \`${a}\` is not expected here.`, suggest: o.getSuggest(a, Object.keys(n.properties)), location: l.key() }) } } } }) }, 7281: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.TagDescription = void 0; const r = n(780); t.TagDescription = () => ({ Tag(e, t) { r.validateDefinedAndNonEmpty("description", e, t) } }) }, 6855: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.TagsAlphabetical = void 0, t.TagsAlphabetical = () => ({ DefinitionRoot(e, { report: t, location: n }) { if (e.tags) for (let r = 0; r < e.tags.length - 1; r++)e.tags[r].name > e.tags[r + 1].name && t({ message: "The `tags` array should be in alphabetical order.", location: n.child(["tags", r]) }) } }) }, 348: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.reportUnresolvedRef = t.NoUnresolvedRefs = void 0; const r = n(4182); function o(e, t, n) { var o; const i = e.error; i instanceof r.YamlParseError && t({ message: "Failed to parse: " + i.message, location: { source: i.source, pointer: void 0, start: { col: i.col, line: i.line } } }); const a = null === (o = e.error) || void 0 === o ? void 0 : o.message; t({ location: n, message: "Can't resolve $ref" + (a ? ": " + a : "") }) } t.NoUnresolvedRefs = () => ({ ref: { leave(e, { report: t, location: n }, r) { void 0 === r.node && o(r, t, n) } }, DiscriminatorMapping(e, { report: t, resolve: n, location: r }) { for (const i of Object.keys(e)) { const a = n({ $ref: e[i] }); if (void 0 !== a.node) return; o(a, t, r.child(i)) } } }), t.reportUnresolvedRef = o }, 9566: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.BooleanParameterPrefixes = void 0, t.BooleanParameterPrefixes = e => { const t = e.prefixes || ["is", "has"], n = new RegExp(`^(${t.join("|")})[A-Z-_]`), r = t.map((e => `\`${e}\``)), o = 1 === r.length ? r[0] : r.slice(0, -1).join(", ") + " or " + r[t.length - 1]; return { Parameter(e, { report: t, location: r }) { "boolean" !== e.type || n.test(e.name) || t({ message: `Boolean parameter \`${e.name}\` should have ${o} prefix.`, location: r.child("name") }) } } } }, 7523: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preprocessors = t.rules = void 0; const r = n(6471), o = n(78), i = n(1562), a = n(8675), s = n(8265), l = n(9622), c = n(476), u = n(9566), p = n(7281), d = n(6855), f = n(9527), h = n(2319), m = n(700), g = n(5946), y = n(5281), v = n(4015), b = n(8742), w = n(4112), x = n(7421), k = n(5097), _ = n(7890), O = n(5064), S = n(3408), E = n(5023), P = n(3529), A = n(8613), $ = n(7892), C = n(348), R = n(2332), j = n(4628), T = n(8786), I = n(9578), N = n(3467), D = n(525), L = n(3689), M = n(7028), F = n(1750), z = n(3807), U = n(5839), V = n(7899), B = n(5669); t.rules = { spec: r.OasSpec, "no-invalid-schema-examples": o.NoInvalidSchemaExamples, "no-invalid-parameter-examples": i.NoInvalidParameterExamples, "info-description": a.InfoDescription, "info-contact": s.InfoContact, "info-license": l.InfoLicense, "info-license-url": c.InfoLicenseUrl, "tag-description": p.TagDescription, "tags-alphabetical": d.TagsAlphabetical, "paths-kebab-case": f.PathsKebabCase, "no-enum-type-mismatch": h.NoEnumTypeMismatch, "boolean-parameter-prefixes": u.BooleanParameterPrefixes, "no-path-trailing-slash": m.NoPathTrailingSlash, "operation-2xx-response": g.Operation2xxResponse, "operation-4xx-response": y.Operation4xxResponse, assertions: v.Assertions, "operation-operationId-unique": b.OperationIdUnique, "operation-parameters-unique": w.OperationParametersUnique, "path-parameters-defined": x.PathParamsDefined, "operation-tag-defined": k.OperationTagDefined, "path-declaration-must-exist": _.PathDeclarationMustExist, "operation-operationId-url-safe": O.OperationIdUrlSafe, "operation-operationId": T.OperationOperationId, "operation-summary": I.OperationSummary, "operation-description": S.OperationDescription, "path-not-include-query": E.PathNotIncludeQuery, "path-params-defined": x.PathParamsDefined, "parameter-description": P.ParameterDescription, "operation-singular-tag": A.OperationSingularTag, "operation-security-defined": $.OperationSecurityDefined, "no-unresolved-refs": C.NoUnresolvedRefs, "no-identical-paths": j.NoIdenticalPaths, "no-ambiguous-paths": N.NoAmbiguousPaths, "path-http-verbs-order": R.PathHttpVerbsOrder, "no-http-verbs-in-paths": D.NoHttpVerbsInPaths, "path-excludes-patterns": L.PathExcludesPatterns, "request-mime-type": M.RequestMimeType, "response-mime-type": F.ResponseMimeType, "path-segment-plural": z.PathSegmentPlural, "response-contains-header": U.ResponseContainsHeader, "response-contains-property": V.ResponseContainsProperty, "scalar-property-missing-example": B.ScalarPropertyMissingExample }, t.preprocessors = {} }, 4508: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.RemoveUnusedComponents = void 0; const r = n(771); t.RemoveUnusedComponents = () => { let e = new Map; function t(t, n, r) { var o; e.set(t.absolutePointer, { used: (null === (o = e.get(t.absolutePointer)) || void 0 === o ? void 0 : o.used) || !1, componentType: n, name: r }) } return { ref: { leave(t, { type: n, resolve: r, key: o }) { if (["Schema", "Parameter", "Response", "SecurityScheme"].includes(n.name)) { const n = r(t); if (!n.location) return; e.set(n.location.absolutePointer, { used: !0, name: o.toString() }) } } }, DefinitionRoot: { leave(t, n) { const o = n.getVisitorData(); o.removedCount = 0; let i = new Set; e.forEach((e => { const { used: n, name: r, componentType: a } = e; !n && a && (i.add(a), delete t[a][r], o.removedCount++) })); for (const e of i) r.isEmptyObject(t[e]) && delete t[e] } }, NamedSchemas: { Schema(e, { location: n, key: r }) { e.allOf || t(n, "definitions", r.toString()) } }, NamedParameters: { Parameter(e, { location: n, key: r }) { t(n, "parameters", r.toString()) } }, NamedResponses: { Response(e, { location: n, key: r }) { t(n, "responses", r.toString()) } }, NamedSecuritySchemes: { SecurityScheme(e, { location: n, key: r }) { t(n, "securityDefinitions", r.toString()) } } } } }, 7028: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.RequestMimeType = void 0; const r = n(771); t.RequestMimeType = ({ allowedValues: e }) => ({ DefinitionRoot(t, n) { r.validateMimeType({ type: "consumes", value: t }, n, e) }, Operation: { leave(t, n) { r.validateMimeType({ type: "consumes", value: t }, n, e) } } }) }, 7899: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ResponseContainsProperty = void 0; const r = n(771); t.ResponseContainsProperty = e => { const t = e.names || {}; let n; return { Operation: { Response: { skip: (e, t) => "204" == `${t}`, enter: (e, t) => { n = t.key }, Schema(e, { report: o, location: i }) { var a; if ("object" !== e.type) return; const s = t[n] || t[r.getMatchingStatusCodeRange(n)] || t[r.getMatchingStatusCodeRange(n).toLowerCase()] || []; for (const t of s) (null === (a = e.properties) || void 0 === a ? void 0 : a[t]) || o({ message: `Response object must contain a top-level "${t}" property.`, location: i.child("properties").key() }) } } } } } }, 1750: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ResponseMimeType = void 0; const r = n(771); t.ResponseMimeType = ({ allowedValues: e }) => ({ DefinitionRoot(t, n) { r.validateMimeType({ type: "produces", value: t }, n, e) }, Operation: { leave(t, n) { r.validateMimeType({ type: "produces", value: t }, n, e) } } }) }, 962: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.BooleanParameterPrefixes = void 0, t.BooleanParameterPrefixes = e => { const t = e.prefixes || ["is", "has"], n = new RegExp(`^(${t.join("|")})[A-Z-_]`), r = t.map((e => `\`${e}\``)), o = 1 === r.length ? r[0] : r.slice(0, -1).join(", ") + " or " + r[t.length - 1]; return { Parameter: { Schema(e, { report: t, parentLocations: r }, i) { "boolean" !== e.type || n.test(i.Parameter.name) || t({ message: `Boolean parameter \`${i.Parameter.name}\` should have ${o} prefix.`, location: r.Parameter.child(["name"]) }) } } } } }, 226: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.preprocessors = t.rules = void 0; const r = n(6471), o = n(5946), i = n(5281), a = n(4015), s = n(8742), l = n(4112), c = n(7421), u = n(5097), p = n(1265), d = n(2319), f = n(700), h = n(7890), m = n(5064), g = n(6855), y = n(5486), v = n(2947), b = n(8675), w = n(7281), x = n(8265), k = n(9622), _ = n(3408), O = n(897), S = n(5023), E = n(3529), P = n(8613), A = n(476), $ = n(7892), C = n(348), R = n(962), j = n(9527), T = n(2332), I = n(7020), N = n(9336), D = n(4628), L = n(6208), M = n(8786), F = n(9578), z = n(3467), U = n(472), V = n(525), B = n(3736), q = n(503), W = n(3807), H = n(3689), Y = n(78), K = n(1562), G = n(5839), Q = n(7557), X = n(5669); t.rules = { spec: r.OasSpec, "info-description": b.InfoDescription, "info-contact": x.InfoContact, "info-license": k.InfoLicense, "info-license-url": A.InfoLicenseUrl, "operation-2xx-response": o.Operation2xxResponse, "operation-4xx-response": i.Operation4xxResponse, assertions: a.Assertions, "operation-operationId-unique": s.OperationIdUnique, "operation-parameters-unique": l.OperationParametersUnique, "path-parameters-defined": c.PathParamsDefined, "operation-tag-defined": u.OperationTagDefined, "no-example-value-and-externalValue": p.NoExampleValueAndExternalValue, "no-enum-type-mismatch": d.NoEnumTypeMismatch, "no-path-trailing-slash": f.NoPathTrailingSlash, "no-empty-servers": I.NoEmptyServers, "path-declaration-must-exist": h.PathDeclarationMustExist, "operation-operationId-url-safe": m.OperationIdUrlSafe, "operation-operationId": M.OperationOperationId, "operation-summary": F.OperationSummary, "tags-alphabetical": g.TagsAlphabetical, "no-server-example.com": y.NoServerExample, "no-server-trailing-slash": v.NoServerTrailingSlash, "tag-description": w.TagDescription, "operation-description": _.OperationDescription, "no-unused-components": O.NoUnusedComponents, "path-not-include-query": S.PathNotIncludeQuery, "path-params-defined": c.PathParamsDefined, "parameter-description": E.ParameterDescription, "operation-singular-tag": P.OperationSingularTag, "operation-security-defined": $.OperationSecurityDefined, "no-unresolved-refs": C.NoUnresolvedRefs, "paths-kebab-case": j.PathsKebabCase, "boolean-parameter-prefixes": R.BooleanParameterPrefixes, "path-http-verbs-order": T.PathHttpVerbsOrder, "no-invalid-media-type-examples": N.ValidContentExamples, "no-identical-paths": D.NoIdenticalPaths, "no-ambiguous-paths": z.NoAmbiguousPaths, "no-undefined-server-variable": L.NoUndefinedServerVariable, "no-servers-empty-enum": U.NoEmptyEnumServers, "no-http-verbs-in-paths": V.NoHttpVerbsInPaths, "path-excludes-patterns": H.PathExcludesPatterns, "request-mime-type": B.RequestMimeType, "response-mime-type": q.ResponseMimeType, "path-segment-plural": W.PathSegmentPlural, "no-invalid-schema-examples": Y.NoInvalidSchemaExamples, "no-invalid-parameter-examples": K.NoInvalidParameterExamples, "response-contains-header": G.ResponseContainsHeader, "response-contains-property": Q.ResponseContainsProperty, "scalar-property-missing-example": X.ScalarPropertyMissingExample }, t.preprocessors = {} }, 7020: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoEmptyServers = void 0, t.NoEmptyServers = () => ({ DefinitionRoot(e, { report: t, location: n }) { e.hasOwnProperty("servers") ? Array.isArray(e.servers) && 0 !== e.servers.length || t({ message: "Servers must be a non-empty array.", location: n.child(["servers"]).key() }) : t({ message: "Servers must be present.", location: n.child(["openapi"]).key() }) } }) }, 1265: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoExampleValueAndExternalValue = void 0, t.NoExampleValueAndExternalValue = () => ({ Example(e, { report: t, location: n }) { e.value && e.externalValue && t({ message: "Example object can have either `value` or `externalValue` fields.", location: n.child(["value"]).key() }) } }) }, 9336: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ValidContentExamples = void 0; const r = n(7468), o = n(780); t.ValidContentExamples = e => { var t; const n = null === (t = e.disallowAdditionalProperties) || void 0 === t || t; return { MediaType: { leave(e, t) { const { location: i, resolve: a } = t; if (e.schema) if (e.example) s(e.example, i.child("example")); else if (e.examples) for (const t of Object.keys(e.examples)) s(e.examples[t], i.child(["examples", t, "value"]), !0); function s(i, s, l) { if (r.isRef(i)) { const e = a(i); if (!e.location) return; s = l ? e.location.child("value") : e.location, i = e.node } o.validateExample(l ? i.value : i, e.schema, s, t, n) } } } } } }, 5486: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoServerExample = void 0, t.NoServerExample = () => ({ Server(e, { report: t, location: n }) { -1 !== ["example.com", "localhost"].indexOf(e.url) && t({ message: "Server `url` should not point at example.com.", location: n.child(["url"]) }) } }) }, 2947: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoServerTrailingSlash = void 0, t.NoServerTrailingSlash = () => ({ Server(e, { report: t, location: n }) { e.url && e.url.endsWith("/") && "/" !== e.url && t({ message: "Server `url` should not have a trailing slash.", location: n.child(["url"]) }) } }) }, 472: function (e, t) { "use strict"; var n; function r(e) { var t; if (e.variables && 0 === Object.keys(e.variables).length) return; const r = []; for (var o in e.variables) { const i = e.variables[o]; if (!i.enum) continue; if (Array.isArray(i.enum) && 0 === (null === (t = i.enum) || void 0 === t ? void 0 : t.length) && r.push(n.empty), !i.default) continue; const a = e.variables[o].default; i.enum && !i.enum.includes(a) && r.push(n.invalidDefaultValue) } return r.length ? r : void 0 } Object.defineProperty(t, "__esModule", { value: !0 }), t.NoEmptyEnumServers = void 0, function (e) { e.empty = "empty", e.invalidDefaultValue = "invalidDefaultValue" }(n || (n = {})), t.NoEmptyEnumServers = () => ({ DefinitionRoot(e, { report: t, location: o }) { if (!e.servers || 0 === e.servers.length) return; const i = []; if (Array.isArray(e.servers)) for (const t of e.servers) { const e = r(t); e && i.push(...e) } else { const t = r(e.servers); if (!t) return; i.push(...t) } for (const e of i) e === n.empty && t({ message: "Server variable with `enum` must be a non-empty array.", location: o.child(["servers"]).key() }), e === n.invalidDefaultValue && t({ message: "Server variable define `enum` and `default`. `enum` must include default value", location: o.child(["servers"]).key() }) } }) }, 6208: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoUndefinedServerVariable = void 0, t.NoUndefinedServerVariable = () => ({ Server(e, { report: t, location: n }) { var r; if (!e.url) return; const o = (null === (r = e.url.match(/{[^}]+}/g)) || void 0 === r ? void 0 : r.map((e => e.slice(1, e.length - 1)))) || [], i = (null == e ? void 0 : e.variables) && Object.keys(e.variables) || []; for (const e of o) i.includes(e) || t({ message: `The \`${e}\` variable is not defined in the \`variables\` objects.`, location: n.child(["url"]) }); for (const e of i) o.includes(e) || t({ message: `The \`${e}\` variable is not used in the server's \`url\` field.`, location: n.child(["variables", e]).key(), from: n.child("url") }) } }) }, 897: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.NoUnusedComponents = void 0, t.NoUnusedComponents = () => { let e = new Map; function t(t, n) { var r; e.set(t.absolutePointer, { used: (null === (r = e.get(t.absolutePointer)) || void 0 === r ? void 0 : r.used) || !1, location: t, name: n }) } return { ref(t, { type: n, resolve: r, key: o, location: i }) { if (["Schema", "Header", "Parameter", "Response", "Example", "RequestBody"].includes(n.name)) { const n = r(t); if (!n.location) return; e.set(n.location.absolutePointer, { used: !0, name: o.toString(), location: i }) } }, DefinitionRoot: { leave(t, { report: n }) { e.forEach((e => { e.used || n({ message: `Component: "${e.name}" is never used.`, location: e.location.key() }) })) } }, NamedSchemas: { Schema(e, { location: n, key: r }) { e.allOf || t(n, r.toString()) } }, NamedParameters: { Parameter(e, { location: n, key: r }) { t(n, r.toString()) } }, NamedResponses: { Response(e, { location: n, key: r }) { t(n, r.toString()) } }, NamedExamples: { Example(e, { location: n, key: r }) { t(n, r.toString()) } }, NamedRequestBodies: { RequestBody(e, { location: n, key: r }) { t(n, r.toString()) } }, NamedHeaders: { Header(e, { location: n, key: r }) { t(n, r.toString()) } } } } }, 6350: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.RemoveUnusedComponents = void 0; const r = n(771); t.RemoveUnusedComponents = () => { let e = new Map; function t(t, n, r) { var o; e.set(t.absolutePointer, { used: (null === (o = e.get(t.absolutePointer)) || void 0 === o ? void 0 : o.used) || !1, componentType: n, name: r }) } return { ref: { leave(t, { type: n, resolve: r, key: o }) { if (["Schema", "Header", "Parameter", "Response", "Example", "RequestBody"].includes(n.name)) { const n = r(t); if (!n.location) return; e.set(n.location.absolutePointer, { used: !0, name: o.toString() }) } } }, DefinitionRoot: { leave(t, n) { const o = n.getVisitorData(); o.removedCount = 0, e.forEach((e => { const { used: n, componentType: i, name: a } = e; if (!n && i) { let e = t.components[i]; delete e[a], o.removedCount++, r.isEmptyObject(e) && delete t.components[i] } })), r.isEmptyObject(t.components) && delete t.components } }, NamedSchemas: { Schema(e, { location: n, key: r }) { e.allOf || t(n, "schemas", r.toString()) } }, NamedParameters: { Parameter(e, { location: n, key: r }) { t(n, "parameters", r.toString()) } }, NamedResponses: { Response(e, { location: n, key: r }) { t(n, "responses", r.toString()) } }, NamedExamples: { Example(e, { location: n, key: r }) { t(n, "examples", r.toString()) } }, NamedRequestBodies: { RequestBody(e, { location: n, key: r }) { t(n, "requestBodies", r.toString()) } }, NamedHeaders: { Header(e, { location: n, key: r }) { t(n, "headers", r.toString()) } } } } }, 3736: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.RequestMimeType = void 0; const r = n(771); t.RequestMimeType = ({ allowedValues: e }) => ({ PathMap: { RequestBody: { leave(t, n) { r.validateMimeTypeOAS3({ type: "consumes", value: t }, n, e) } }, Callback: { RequestBody() { }, Response: { leave(t, n) { r.validateMimeTypeOAS3({ type: "consumes", value: t }, n, e) } } } }, WebhooksMap: { Response: { leave(t, n) { r.validateMimeTypeOAS3({ type: "consumes", value: t }, n, e) } } } }) }, 7557: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ResponseContainsProperty = void 0; const r = n(771); t.ResponseContainsProperty = e => { const t = e.names || {}; let n; return { Operation: { Response: { skip: (e, t) => "204" == `${t}`, enter: (e, t) => { n = t.key }, MediaType: { Schema(e, { report: o, location: i }) { var a; if ("object" !== e.type) return; const s = t[n] || t[r.getMatchingStatusCodeRange(n)] || t[r.getMatchingStatusCodeRange(n).toLowerCase()] || []; for (const t of s) (null === (a = e.properties) || void 0 === a ? void 0 : a[t]) || o({ message: `Response object must contain a top-level "${t}" property.`, location: i.child("properties").key() }) } } } } } } }, 503: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.ResponseMimeType = void 0; const r = n(771); t.ResponseMimeType = ({ allowedValues: e }) => ({ PathMap: { Response: { leave(t, n) { r.validateMimeTypeOAS3({ type: "produces", value: t }, n, e) } }, Callback: { Response() { }, RequestBody: { leave(t, n) { r.validateMimeTypeOAS3({ type: "produces", value: t }, n, e) } } } }, WebhooksMap: { RequestBody: { leave(t, n) { r.validateMimeTypeOAS3({ type: "produces", value: t }, n, e) } } } }) }, 780: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.validateExample = t.getSuggest = t.validateDefinedAndNonEmpty = t.fieldNonEmpty = t.missingRequiredField = t.matchesJsonSchemaType = t.oasTypeOf = void 0; const r = n(9991), o = n(7468), i = n(7275); function a(e, t) { return `${e} object should contain \`${t}\` field.` } function s(e, t) { return `${e} object \`${t}\` must be non-empty string.` } t.oasTypeOf = function (e) { return Array.isArray(e) ? "array" : null === e ? "null" : typeof e }, t.matchesJsonSchemaType = function (e, t, n) { if (n && null === e) return null === e; switch (t) { case "array": return Array.isArray(e); case "object": return "object" == typeof e && null !== e && !Array.isArray(e); case "null": return null === e; case "integer": return Number.isInteger(e); default: return typeof e === t } }, t.missingRequiredField = a, t.fieldNonEmpty = s, t.validateDefinedAndNonEmpty = function (e, t, n) { "object" == typeof t && (void 0 === t[e] ? n.report({ message: a(n.type.name, e), location: n.location.child([e]).key() }) : t[e] || n.report({ message: s(n.type.name, e), location: n.location.child([e]).key() })) }, t.getSuggest = function (e, t) { if ("string" != typeof e || !t.length) return []; const n = []; for (let o = 0; o < t.length; o++) { const i = r(e, t[o]); i < 4 && n.push({ distance: i, variant: t[o] }) } return n.sort(((e, t) => e.distance - t.distance)), n.map((e => e.variant)) }, t.validateExample = function (e, t, n, { resolve: r, location: a, report: s }, l) { try { const { valid: c, errors: u } = i.validateJsonSchema(e, t, a.child("schema"), n.pointer, r, l); if (!c) for (let e of u) s({ message: `Example value must conform to the schema: ${e.message}.`, location: Object.assign(Object.assign({}, new o.Location(n.source, e.instancePath)), { reportOnKey: "additionalProperties" === e.keyword }), from: a, suggest: e.suggest }) } catch (e) { s({ message: `Example validation errored: ${e.message}.`, location: a.child("schema"), from: a }) } } }, 5220: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.isNamedType = t.normalizeTypes = t.mapOf = t.listOf = void 0, t.listOf = function (e) { return { name: `${e}List`, properties: {}, items: e } }, t.mapOf = function (e) { return { name: `${e}Map`, properties: {}, additionalProperties: () => e } }, t.normalizeTypes = function (e, t = {}) { const n = {}; for (const t of Object.keys(e)) n[t] = Object.assign(Object.assign({}, e[t]), { name: t }); for (const e of Object.values(n)) r(e); return n; function r(e) { if (e.additionalProperties && (e.additionalProperties = o(e.additionalProperties)), e.items && (e.items = o(e.items)), e.properties) { const n = {}; for (const [r, i] of Object.entries(e.properties)) n[r] = o(i), t.doNotResolveExamples && i && i.isExample && (n[r] = Object.assign(Object.assign({}, i), { resolvable: !1 })); e.properties = n } } function o(e) { if ("string" == typeof e) { if (!n[e]) throw new Error(`Unknown type name found: ${e}`); return n[e] } return "function" == typeof e ? (t, n) => o(e(t, n)) : e && e.name ? (r(e = Object.assign({}, e)), e) : e && e.directResolveAs ? Object.assign(Object.assign({}, e), { directResolveAs: o(e.directResolveAs) }) : e } }, t.isNamedType = function (e) { return "string" == typeof (null == e ? void 0 : e.name) } }, 388: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.Oas2Types = void 0; const r = n(5220), o = /^[0-9][0-9Xx]{2}$/, i = { properties: { swagger: { type: "string" }, info: "Info", host: { type: "string" }, basePath: { type: "string" }, schemes: { type: "array", items: { type: "string" } }, consumes: { type: "array", items: { type: "string" } }, produces: { type: "array", items: { type: "string" } }, paths: "PathMap", definitions: "NamedSchemas", parameters: "NamedParameters", responses: "NamedResponses", securityDefinitions: "NamedSecuritySchemes", security: r.listOf("SecurityRequirement"), tags: r.listOf("Tag"), externalDocs: "ExternalDocs" }, required: ["swagger", "paths", "info"] }, a = { properties: { $ref: { type: "string" }, parameters: r.listOf("Parameter"), get: "Operation", put: "Operation", post: "Operation", delete: "Operation", options: "Operation", head: "Operation", patch: "Operation" } }, s = { properties: { tags: { type: "array", items: { type: "string" } }, summary: { type: "string" }, description: { type: "string" }, externalDocs: "ExternalDocs", operationId: { type: "string" }, consumes: { type: "array", items: { type: "string" } }, produces: { type: "array", items: { type: "string" } }, parameters: r.listOf("Parameter"), responses: "ResponsesMap", schemes: { type: "array", items: { type: "string" } }, deprecated: { type: "boolean" }, security: r.listOf("SecurityRequirement"), "x-codeSamples": r.listOf("XCodeSample"), "x-code-samples": r.listOf("XCodeSample"), "x-hideTryItPanel": { type: "boolean" } }, required: ["responses"] }, l = { properties: { default: "Response" }, additionalProperties: (e, t) => o.test(t) ? "Response" : void 0 }, c = { properties: { description: { type: "string" }, schema: "Schema", headers: r.mapOf("Header"), examples: "Examples" }, required: ["description"] }, u = { properties: { format: { type: "string" }, title: { type: "string" }, description: { type: "string" }, default: null, multipleOf: { type: "number" }, maximum: { type: "number" }, minimum: { type: "number" }, exclusiveMaximum: { type: "boolean" }, exclusiveMinimum: { type: "boolean" }, maxLength: { type: "number" }, minLength: { type: "number" }, pattern: { type: "string" }, maxItems: { type: "number" }, minItems: { type: "number" }, uniqueItems: { type: "boolean" }, maxProperties: { type: "number" }, minProperties: { type: "number" }, required: { type: "array", items: { type: "string" } }, enum: { type: "array" }, type: { type: "string", enum: ["object", "array", "string", "number", "integer", "boolean", "null"] }, items: e => Array.isArray(e) ? r.listOf("Schema") : "Schema", allOf: r.listOf("Schema"), properties: "SchemaProperties", additionalProperties: e => "boolean" == typeof e ? { type: "boolean" } : "Schema", discriminator: { type: "string" }, readOnly: { type: "boolean" }, xml: "Xml", externalDocs: "ExternalDocs", example: { isExample: !0 }, "x-tags": { type: "array", items: { type: "string" } } } }, p = { properties: { type: { enum: ["basic", "apiKey", "oauth2"] }, description: { type: "string" }, name: { type: "string" }, in: { type: "string", enum: ["query", "header"] }, flow: { enum: ["implicit", "password", "application", "accessCode"] }, authorizationUrl: { type: "string" }, tokenUrl: { type: "string" }, scopes: { type: "object", additionalProperties: { type: "string" } } }, required(e) { switch (null == e ? void 0 : e.type) { case "apiKey": return ["type", "name", "in"]; case "oauth2": switch (null == e ? void 0 : e.flow) { case "implicit": return ["type", "flow", "authorizationUrl", "scopes"]; case "accessCode": return ["type", "flow", "authorizationUrl", "tokenUrl", "scopes"]; case "application": case "password": return ["type", "flow", "tokenUrl", "scopes"]; default: return ["type", "flow", "scopes"] }default: return ["type"] } }, allowed(e) { switch (null == e ? void 0 : e.type) { case "basic": return ["type", "description"]; case "apiKey": return ["type", "name", "in", "description"]; case "oauth2": switch (null == e ? void 0 : e.flow) { case "implicit": return ["type", "flow", "authorizationUrl", "description", "scopes"]; case "accessCode": return ["type", "flow", "authorizationUrl", "tokenUrl", "description", "scopes"]; case "application": case "password": return ["type", "flow", "tokenUrl", "description", "scopes"]; default: return ["type", "flow", "tokenUrl", "authorizationUrl", "description", "scopes"] }default: return ["type", "description"] } }, extensionsPrefix: "x-" }; t.Oas2Types = { DefinitionRoot: i, Tag: { properties: { name: { type: "string" }, description: { type: "string" }, externalDocs: "ExternalDocs" }, required: ["name"] }, ExternalDocs: { properties: { description: { type: "string" }, url: { type: "string" } }, required: ["url"] }, SecurityRequirement: { properties: {}, additionalProperties: { type: "array", items: { type: "string" } } }, Info: { properties: { title: { type: "string" }, description: { type: "string" }, termsOfService: { type: "string" }, contact: "Contact", license: "License", version: { type: "string" } }, required: ["title", "version"] }, Contact: { properties: { name: { type: "string" }, url: { type: "string" }, email: { type: "string" } } }, License: { properties: { name: { type: "string" }, url: { type: "string" } }, required: ["name"] }, PathMap: { properties: {}, additionalProperties: (e, t) => t.startsWith("/") ? "PathItem" : void 0 }, PathItem: a, Parameter: { properties: { name: { type: "string" }, in: { type: "string", enum: ["query", "header", "path", "formData", "body"] }, description: { type: "string" }, required: { type: "boolean" }, schema: "Schema", type: { type: "string", enum: ["string", "number", "integer", "boolean", "array", "file"] }, format: { type: "string" }, allowEmptyValue: { type: "boolean" }, items: "ParameterItems", collectionFormat: { type: "string", enum: ["csv", "ssv", "tsv", "pipes", "multi"] }, default: null, maximum: { type: "integer" }, exclusiveMaximum: { type: "boolean" }, minimum: { type: "integer" }, exclusiveMinimum: { type: "boolean" }, maxLength: { type: "integer" }, minLength: { type: "integer" }, pattern: { type: "string" }, maxItems: { type: "integer" }, minItems: { type: "integer" }, uniqueItems: { type: "boolean" }, enum: { type: "array" }, multipleOf: { type: "number" } }, required: e => e && e.in ? "body" === e.in ? ["name", "in", "schema"] : "array" === e.type ? ["name", "in", "type", "items"] : ["name", "in", "type"] : ["name", "in"] }, ParameterItems: { properties: { type: { type: "string", enum: ["string", "number", "integer", "boolean", "array"] }, format: { type: "string" }, items: "ParameterItems", collectionFormat: { type: "string", enum: ["csv", "ssv", "tsv", "pipes", "multi"] }, default: null, maximum: { type: "integer" }, exclusiveMaximum: { type: "boolean" }, minimum: { type: "integer" }, exclusiveMinimum: { type: "boolean" }, maxLength: { type: "integer" }, minLength: { type: "integer" }, pattern: { type: "string" }, maxItems: { type: "integer" }, minItems: { type: "integer" }, uniqueItems: { type: "boolean" }, enum: { type: "array" }, multipleOf: { type: "number" } }, required: e => e && "array" === e.type ? ["type", "items"] : ["type"] }, Operation: s, Examples: { properties: {}, additionalProperties: { isExample: !0 } }, Header: { properties: { description: { type: "string" }, type: { type: "string", enum: ["string", "number", "integer", "boolean", "array"] }, format: { type: "string" }, items: "ParameterItems", collectionFormat: { type: "string", enum: ["csv", "ssv", "tsv", "pipes", "multi"] }, default: null, maximum: { type: "integer" }, exclusiveMaximum: { type: "boolean" }, minimum: { type: "integer" }, exclusiveMinimum: { type: "boolean" }, maxLength: { type: "integer" }, minLength: { type: "integer" }, pattern: { type: "string" }, maxItems: { type: "integer" }, minItems: { type: "integer" }, uniqueItems: { type: "boolean" }, enum: { type: "array" }, multipleOf: { type: "number" } }, required: e => e && "array" === e.type ? ["type", "items"] : ["type"] }, ResponsesMap: l, Response: c, Schema: u, Xml: { properties: { name: { type: "string" }, namespace: { type: "string" }, prefix: { type: "string" }, attribute: { type: "boolean" }, wrapped: { type: "boolean" } } }, SchemaProperties: { properties: {}, additionalProperties: "Schema" }, NamedSchemas: r.mapOf("Schema"), NamedResponses: r.mapOf("Response"), NamedParameters: r.mapOf("Parameter"), NamedSecuritySchemes: r.mapOf("SecurityScheme"), SecurityScheme: p, XCodeSample: { properties: { lang: { type: "string" }, label: { type: "string" }, source: { type: "string" } } } } }, 5241: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.Oas3Types = void 0; const r = n(5220), o = n(7468), i = /^[0-9][0-9Xx]{2}$/, a = { properties: { openapi: null, info: "Info", servers: r.listOf("Server"), security: r.listOf("SecurityRequirement"), tags: r.listOf("Tag"), externalDocs: "ExternalDocs", paths: "PathMap", components: "Components", "x-webhooks": "WebhooksMap" }, required: ["openapi", "paths", "info"] }, s = { properties: { url: { type: "string" }, description: { type: "string" }, variables: r.mapOf("ServerVariable") }, required: ["url"] }, l = { properties: { $ref: { type: "string" }, servers: r.listOf("Server"), parameters: r.listOf("Parameter"), summary: { type: "string" }, description: { type: "string" }, get: "Operation", put: "Operation", post: "Operation", delete: "Operation", options: "Operation", head: "Operation", patch: "Operation", trace: "Operation" } }, c = { properties: { name: { type: "string" }, in: { enum: ["query", "header", "path", "cookie"] }, description: { type: "string" }, required: { type: "boolean" }, deprecated: { type: "boolean" }, allowEmptyValue: { type: "boolean" }, style: { enum: ["form", "simple", "label", "matrix", "spaceDelimited", "pipeDelimited", "deepObject"] }, explode: { type: "boolean" }, allowReserved: { type: "boolean" }, schema: "Schema", example: { isExample: !0 }, examples: r.mapOf("Example"), content: "MediaTypeMap" }, required: ["name", "in"], requiredOneOf: ["schema", "content"] }, u = { properties: { tags: { type: "array", items: { type: "string" } }, summary: { type: "string" }, description: { type: "string" }, externalDocs: "ExternalDocs", operationId: { type: "string" }, parameters: r.listOf("Parameter"), security: r.listOf("SecurityRequirement"), servers: r.listOf("Server"), requestBody: "RequestBody", responses: "ResponsesMap", deprecated: { type: "boolean" }, callbacks: r.mapOf("Callback"), "x-codeSamples": r.listOf("XCodeSample"), "x-code-samples": r.listOf("XCodeSample"), "x-hideTryItPanel": { type: "boolean" } }, required: ["responses"] }, p = { properties: { schema: "Schema", example: { isExample: !0 }, examples: r.mapOf("Example"), encoding: r.mapOf("Encoding") } }, d = { properties: { contentType: { type: "string" }, headers: r.mapOf("Header"), style: { enum: ["form", "simple", "label", "matrix", "spaceDelimited", "pipeDelimited", "deepObject"] }, explode: { type: "boolean" }, allowReserved: { type: "boolean" } } }, f = { properties: { description: { type: "string" }, required: { type: "boolean" }, deprecated: { type: "boolean" }, allowEmptyValue: { type: "boolean" }, style: { enum: ["form", "simple", "label", "matrix", "spaceDelimited", "pipeDelimited", "deepObject"] }, explode: { type: "boolean" }, allowReserved: { type: "boolean" }, schema: "Schema", example: { isExample: !0 }, examples: r.mapOf("Example"), content: "MediaTypeMap" } }, h = { properties: { default: "Response" }, additionalProperties: (e, t) => i.test(t) ? "Response" : void 0 }, m = { properties: { description: { type: "string" }, headers: r.mapOf("Header"), content: "MediaTypeMap", links: r.mapOf("Link") }, required: ["description"] }, g = { properties: { externalDocs: "ExternalDocs", discriminator: "Discriminator", title: { type: "string" }, multipleOf: { type: "number", minimum: 0 }, maximum: { type: "number" }, minimum: { type: "number" }, exclusiveMaximum: { type: "boolean" }, exclusiveMinimum: { type: "boolean" }, maxLength: { type: "integer", minimum: 0 }, minLength: { type: "integer", minimum: 0 }, pattern: { type: "string" }, maxItems: { type: "integer", minimum: 0 }, minItems: { type: "integer", minimum: 0 }, uniqueItems: { type: "boolean" }, maxProperties: { type: "integer", minimum: 0 }, minProperties: { type: "integer", minimum: 0 }, required: { type: "array", items: { type: "string" } }, enum: { type: "array" }, type: { enum: ["object", "array", "string", "number", "integer", "boolean", "null"] }, allOf: r.listOf("Schema"), anyOf: r.listOf("Schema"), oneOf: r.listOf("Schema"), not: "Schema", properties: "SchemaProperties", items: e => Array.isArray(e) ? r.listOf("Schema") : "Schema", additionalItems: e => "boolean" == typeof e ? { type: "boolean" } : "Schema", additionalProperties: e => "boolean" == typeof e ? { type: "boolean" } : "Schema", description: { type: "string" }, format: { type: "string" }, default: null, nullable: { type: "boolean" }, readOnly: { type: "boolean" }, writeOnly: { type: "boolean" }, xml: "Xml", example: { isExample: !0 }, deprecated: { type: "boolean" }, "x-tags": { type: "array", items: { type: "string" } } } }, y = { properties: {}, additionalProperties: e => o.isMappingRef(e) ? { type: "string", directResolveAs: "Schema" } : { type: "string" } }, v = { properties: { type: { enum: ["apiKey", "http", "oauth2", "openIdConnect"] }, description: { type: "string" }, name: { type: "string" }, in: { type: "string", enum: ["query", "header", "cookie"] }, scheme: { type: "string" }, bearerFormat: { type: "string" }, flows: "SecuritySchemeFlows", openIdConnectUrl: { type: "string" } }, required(e) { switch (null == e ? void 0 : e.type) { case "apiKey": return ["type", "name", "in"]; case "http": return ["type", "scheme"]; case "oauth2": return ["type", "flows"]; case "openIdConnect": return ["type", "openIdConnectUrl"]; default: return ["type"] } }, allowed(e) { switch (null == e ? void 0 : e.type) { case "apiKey": return ["type", "name", "in", "description"]; case "http": return ["type", "scheme", "bearerFormat", "description"]; case "oauth2": return ["type", "flows", "description"]; case "openIdConnect": return ["type", "openIdConnectUrl", "description"]; default: return ["type", "description"] } }, extensionsPrefix: "x-" }; t.Oas3Types = { DefinitionRoot: a, Tag: { properties: { name: { type: "string" }, description: { type: "string" }, externalDocs: "ExternalDocs" }, required: ["name"] }, ExternalDocs: { properties: { description: { type: "string" }, url: { type: "string" } }, required: ["url"] }, Server: s, ServerVariable: { properties: { enum: { type: "array", items: { type: "string" } }, default: { type: "string" }, description: null }, required: ["default"] }, SecurityRequirement: { properties: {}, additionalProperties: { type: "array", items: { type: "string" } } }, Info: { properties: { title: { type: "string" }, version: { type: "string" }, description: { type: "string" }, termsOfService: { type: "string" }, contact: "Contact", license: "License" }, required: ["title", "version"] }, Contact: { properties: { name: { type: "string" }, url: { type: "string" }, email: { type: "string" } } }, License: { properties: { name: { type: "string" }, url: { type: "string" } }, required: ["name"] }, PathMap: { properties: {}, additionalProperties: (e, t) => t.startsWith("/") ? "PathItem" : void 0 }, PathItem: l, Parameter: c, Operation: u, Callback: r.mapOf("PathItem"), RequestBody: { properties: { description: { type: "string" }, required: { type: "boolean" }, content: "MediaTypeMap" }, required: ["content"] }, MediaTypeMap: { properties: {}, additionalProperties: "MediaType" }, MediaType: p, Example: { properties: { value: { isExample: !0 }, summary: { type: "string" }, description: { type: "string" }, externalValue: { type: "string" } } }, Encoding: d, Header: f, ResponsesMap: h, Response: m, Link: { properties: { operationRef: { type: "string" }, operationId: { type: "string" }, parameters: null, requestBody: null, description: { type: "string" }, server: "Server" } }, Schema: g, Xml: { properties: { name: { type: "string" }, namespace: { type: "string" }, prefix: { type: "string" }, attribute: { type: "boolean" }, wrapped: { type: "boolean" } } }, SchemaProperties: { properties: {}, additionalProperties: "Schema" }, DiscriminatorMapping: y, Discriminator: { properties: { propertyName: { type: "string" }, mapping: "DiscriminatorMapping" }, required: ["propertyName"] }, Components: { properties: { parameters: "NamedParameters", schemas: "NamedSchemas", responses: "NamedResponses", examples: "NamedExamples", requestBodies: "NamedRequestBodies", headers: "NamedHeaders", securitySchemes: "NamedSecuritySchemes", links: "NamedLinks", callbacks: "NamedCallbacks" } }, NamedSchemas: r.mapOf("Schema"), NamedResponses: r.mapOf("Response"), NamedParameters: r.mapOf("Parameter"), NamedExamples: r.mapOf("Example"), NamedRequestBodies: r.mapOf("RequestBody"), NamedHeaders: r.mapOf("Header"), NamedSecuritySchemes: r.mapOf("SecurityScheme"), NamedLinks: r.mapOf("Link"), NamedCallbacks: r.mapOf("Callback"), ImplicitFlow: { properties: { refreshUrl: { type: "string" }, scopes: { type: "object", additionalProperties: { type: "string" } }, authorizationUrl: { type: "string" } }, required: ["authorizationUrl", "scopes"] }, PasswordFlow: { properties: { refreshUrl: { type: "string" }, scopes: { type: "object", additionalProperties: { type: "string" } }, tokenUrl: { type: "string" } }, required: ["tokenUrl", "scopes"] }, ClientCredentials: { properties: { refreshUrl: { type: "string" }, scopes: { type: "object", additionalProperties: { type: "string" } }, tokenUrl: { type: "string" } }, required: ["tokenUrl", "scopes"] }, AuthorizationCode: { properties: { refreshUrl: { type: "string" }, authorizationUrl: { type: "string" }, scopes: { type: "object", additionalProperties: { type: "string" } }, tokenUrl: { type: "string" } }, required: ["authorizationUrl", "tokenUrl", "scopes"] }, SecuritySchemeFlows: { properties: { implicit: "ImplicitFlow", password: "PasswordFlow", clientCredentials: "ClientCredentials", authorizationCode: "AuthorizationCode" } }, SecurityScheme: v, XCodeSample: { properties: { lang: { type: "string" }, label: { type: "string" }, source: { type: "string" } } }, WebhooksMap: { properties: {}, additionalProperties: () => "PathItem" } } }, 2608: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.Oas3_1Types = void 0; const r = n(5220), o = n(5241), i = { properties: { openapi: null, info: "Info", servers: r.listOf("Server"), security: r.listOf("SecurityRequirement"), tags: r.listOf("Tag"), externalDocs: "ExternalDocs", paths: "PathMap", webhooks: "WebhooksMap", components: "Components", jsonSchemaDialect: { type: "string" } }, required: ["openapi", "info"], requiredOneOf: ["paths", "components", "webhooks"] }, a = { properties: { tags: { type: "array", items: { type: "string" } }, summary: { type: "string" }, description: { type: "string" }, externalDocs: "ExternalDocs", operationId: { type: "string" }, parameters: r.listOf("Parameter"), security: r.listOf("SecurityRequirement"), servers: r.listOf("Server"), requestBody: "RequestBody", responses: "ResponsesMap", deprecated: { type: "boolean" }, callbacks: r.mapOf("Callback"), "x-codeSamples": r.listOf("XCodeSample"), "x-code-samples": r.listOf("XCodeSample"), "x-hideTryItPanel": { type: "boolean" } } }, s = { properties: { $id: { type: "string" }, id: { type: "string" }, $schema: { type: "string" }, definitions: "NamedSchemas", $defs: "NamedSchemas", $vocabulary: { type: "string" }, externalDocs: "ExternalDocs", discriminator: "Discriminator", myArbitraryKeyword: { type: "boolean" }, title: { type: "string" }, multipleOf: { type: "number", minimum: 0 }, maximum: { type: "number" }, minimum: { type: "number" }, exclusiveMaximum: { type: "number" }, exclusiveMinimum: { type: "number" }, maxLength: { type: "integer", minimum: 0 }, minLength: { type: "integer", minimum: 0 }, pattern: { type: "string" }, maxItems: { type: "integer", minimum: 0 }, minItems: { type: "integer", minimum: 0 }, uniqueItems: { type: "boolean" }, maxProperties: { type: "integer", minimum: 0 }, minProperties: { type: "integer", minimum: 0 }, required: { type: "array", items: { type: "string" } }, enum: { type: "array" }, type: e => Array.isArray(e) ? { type: "array", items: { enum: ["object", "array", "string", "number", "integer", "boolean", "null"] } } : { enum: ["object", "array", "string", "number", "integer", "boolean", "null"] }, allOf: r.listOf("Schema"), anyOf: r.listOf("Schema"), oneOf: r.listOf("Schema"), not: "Schema", if: "Schema", then: "Schema", else: "Schema", dependentSchemas: r.listOf("Schema"), prefixItems: r.listOf("Schema"), contains: "Schema", minContains: { type: "integer", minimum: 0 }, maxContains: { type: "integer", minimum: 0 }, patternProperties: { type: "object" }, propertyNames: "Schema", unevaluatedItems: "Schema", unevaluatedProperties: e => "boolean" == typeof e ? { type: "boolean" } : "Schema", summary: { type: "string" }, properties: "SchemaProperties", items: e => "boolean" == typeof e ? { type: "boolean" } : "Schema", additionalProperties: e => "boolean" == typeof e ? { type: "boolean" } : "Schema", description: { type: "string" }, format: { type: "string" }, contentEncoding: { type: "string" }, contentMediaType: { type: "string" }, default: null, readOnly: { type: "boolean" }, writeOnly: { type: "boolean" }, xml: "Xml", examples: { type: "array" }, example: { isExample: !0 }, deprecated: { type: "boolean" }, const: null, $comment: { type: "string" }, "x-tags": { type: "array", items: { type: "string" } } } }, l = { properties: { type: { enum: ["apiKey", "http", "oauth2", "openIdConnect", "mutualTLS"] }, description: { type: "string" }, name: { type: "string" }, in: { type: "string", enum: ["query", "header", "cookie"] }, scheme: { type: "string" }, bearerFormat: { type: "string" }, flows: "SecuritySchemeFlows", openIdConnectUrl: { type: "string" } }, required(e) { switch (null == e ? void 0 : e.type) { case "apiKey": return ["type", "name", "in"]; case "http": return ["type", "scheme"]; case "oauth2": return ["type", "flows"]; case "openIdConnect": return ["type", "openIdConnectUrl"]; default: return ["type"] } }, allowed(e) { switch (null == e ? void 0 : e.type) { case "apiKey": return ["type", "name", "in", "description"]; case "http": return ["type", "scheme", "bearerFormat", "description"]; case "oauth2": switch (null == e ? void 0 : e.flows) { case "implicit": return ["type", "flows", "authorizationUrl", "refreshUrl", "description", "scopes"]; case "password": case "clientCredentials": return ["type", "flows", "tokenUrl", "refreshUrl", "description", "scopes"]; default: return ["type", "flows", "authorizationUrl", "refreshUrl", "tokenUrl", "description", "scopes"] }case "openIdConnect": return ["type", "openIdConnectUrl", "description"]; default: return ["type", "description"] } }, extensionsPrefix: "x-" }; t.Oas3_1Types = Object.assign(Object.assign({}, o.Oas3Types), { Info: { properties: { title: { type: "string" }, version: { type: "string" }, description: { type: "string" }, termsOfService: { type: "string" }, summary: { type: "string" }, contact: "Contact", license: "License" }, required: ["title", "version"] }, DefinitionRoot: i, Schema: s, License: { properties: { name: { type: "string" }, url: { type: "string" }, identifier: { type: "string" } }, required: ["name"] }, Components: { properties: { parameters: "NamedParameters", schemas: "NamedSchemas", responses: "NamedResponses", examples: "NamedExamples", requestBodies: "NamedRequestBodies", headers: "NamedHeaders", securitySchemes: "NamedSecuritySchemes", links: "NamedLinks", callbacks: "NamedCallbacks", pathItems: "NamedPathItems" } }, NamedPathItems: r.mapOf("PathItem"), SecurityScheme: l, Operation: a }) }, 771: function (e, t, n) { "use strict"; var r = this && this.__awaiter || function (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) { var t; e.done ? o(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) { e(t) }))).then(a, s) } l((r = r.apply(e, t || [])).next()) })) }; Object.defineProperty(t, "__esModule", { value: !0 }), t.isCustomRuleId = t.getMatchingStatusCodeRange = t.assignExisting = t.isNotString = t.isString = t.isNotEmptyObject = t.slash = t.isPathParameter = t.readFileAsStringSync = t.isSingular = t.validateMimeTypeOAS3 = t.validateMimeType = t.splitCamelCaseIntoWords = t.omitObjectProps = t.pickObjectProps = t.readFileFromUrl = t.isEmptyArray = t.isEmptyObject = t.isPlainObject = t.notUndefined = t.loadYaml = t.popStack = t.pushStack = t.stringifyYaml = t.parseYaml = void 0; const o = n(3197), i = n(4099), a = n(8150), s = n(3450), l = n(5273), c = n(8698); var u = n(5273); function p(e) { return null !== e && "object" == typeof e && !Array.isArray(e) } function d(e, t) { return t.match(/^https?:\/\//) || (e = e.replace(/^https?:\/\//, "")), i(e, t) } function f(e) { return "string" == typeof e } Object.defineProperty(t, "parseYaml", { enumerable: !0, get: function () { return u.parseYaml } }), Object.defineProperty(t, "stringifyYaml", { enumerable: !0, get: function () { return u.stringifyYaml } }), t.pushStack = function (e, t) { return { prev: e, value: t } }, t.popStack = function (e) { var t; return null !== (t = null == e ? void 0 : e.prev) && void 0 !== t ? t : null }, t.loadYaml = function (e) { return r(this, void 0, void 0, (function* () { const t = yield o.promises.readFile(e, "utf-8"); return l.parseYaml(t) })) }, t.notUndefined = function (e) { return void 0 !== e }, t.isPlainObject = p, t.isEmptyObject = function (e) { return p(e) && 0 === Object.keys(e).length }, t.isEmptyArray = function (e) { return Array.isArray(e) && 0 === e.length }, t.readFileFromUrl = function (e, t) { return r(this, void 0, void 0, (function* () { const n = {}; for (const r of t.headers) d(e, r.matches) && (n[r.name] = void 0 !== r.envVariable ? c.env[r.envVariable] || "" : r.value); const r = yield (t.customFetch || a.default)(e, { headers: n }); if (!r.ok) throw new Error(`Failed to load ${e}: ${r.status} ${r.statusText}`); return { body: yield r.text(), mimeType: r.headers.get("content-type") } })) }, t.pickObjectProps = function (e, t) { return Object.fromEntries(t.filter((t => t in e)).map((t => [t, e[t]]))) }, t.omitObjectProps = function (e, t) { return Object.fromEntries(Object.entries(e).filter((([e]) => !t.includes(e)))) }, t.splitCamelCaseIntoWords = function (e) { const t = e.split(/(?:[-._])|([A-Z][a-z]+)/).filter(Boolean).map((e => e.toLocaleLowerCase())), n = e.split(/([A-Z]{2,})/).filter((e => e && e === e.toUpperCase())).map((e => e.toLocaleLowerCase())); return new Set([...t, ...n]) }, t.validateMimeType = function ({ type: e, value: t }, { report: n, location: r }, o) { if (!o) throw new Error(`Parameter "allowedValues" is not provided for "${"consumes" === e ? "request" : "response"}-mime-type" rule`); if (t[e]) for (const i of t[e]) o.includes(i) || n({ message: `Mime type "${i}" is not allowed`, location: r.child(t[e].indexOf(i)).key() }) }, t.validateMimeTypeOAS3 = function ({ type: e, value: t }, { report: n, location: r }, o) { if (!o) throw new Error(`Parameter "allowedValues" is not provided for "${"consumes" === e ? "request" : "response"}-mime-type" rule`); if (t.content) for (const e of Object.keys(t.content)) o.includes(e) || n({ message: `Mime type "${e}" is not allowed`, location: r.child("content").child(e).key() }) }, t.isSingular = function (e) { return s.isSingular(e) }, t.readFileAsStringSync = function (e) { return o.readFileSync(e, "utf-8") }, t.isPathParameter = function (e) { return e.startsWith("{") && e.endsWith("}") }, t.slash = function (e) { return /^\\\\\?\\/.test(e) ? e : e.replace(/\\/g, "/") }, t.isNotEmptyObject = function (e) { return !!e && Object.keys(e).length > 0 }, t.isString = f, t.isNotString = function (e) { return !f(e) }, t.assignExisting = function (e, t) { for (let n of Object.keys(t)) e.hasOwnProperty(n) && (e[n] = t[n]) }, t.getMatchingStatusCodeRange = e => `${e}`.replace(/^(\d)\d\d$/, ((e, t) => `${t}XX`)), t.isCustomRuleId = function (e) { return e.includes("/") } }, 8065: function (e, t) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.normalizeVisitors = void 0, t.normalizeVisitors = function (e, t) { const n = { any: { enter: [], leave: [] } }; for (const e of Object.keys(t)) n[e] = { enter: [], leave: [] }; n.ref = { enter: [], leave: [] }; for (const { ruleId: t, severity: n, visitor: r } of e) o({ ruleId: t, severity: n }, r, null); for (const e of Object.keys(n)) n[e].enter.sort(((e, t) => t.depth - e.depth)), n[e].leave.sort(((e, t) => e.depth - t.depth)); return n; function r(e, t, o, i, a = []) { if (a.includes(t)) return; a = [...a, t]; const s = new Set; for (let n of Object.values(t.properties)) n !== o ? "object" == typeof n && null !== n && n.name && s.add(n) : l(e, a); t.additionalProperties && "function" != typeof t.additionalProperties && (t.additionalProperties === o ? l(e, a) : void 0 !== t.additionalProperties.name && s.add(t.additionalProperties)), t.items && (t.items === o ? l(e, a) : void 0 !== t.items.name && s.add(t.items)); for (let t of Array.from(s.values())) r(e, t, o, i, a); function l(e, t) { for (const r of t.slice(1)) n[r.name] = n[r.name] || { enter: [], leave: [] }, n[r.name].enter.push(Object.assign(Object.assign({}, e), { visit: () => { }, depth: 0, context: { isSkippedLevel: !0, seen: new Set, parent: i } })) } } function o(e, i, a, s = 0) { const l = Object.keys(t); if (0 === s) l.push("any"), l.push("ref"); else { if (i.any) throw new Error("any() is allowed only on top level"); if (i.ref) throw new Error("ref() is allowed only on top level") } for (const c of l) { const l = i[c], u = n[c]; if (!l) continue; let p, d, f; const h = "object" == typeof l; if ("ref" === c && h && l.skip) throw new Error("ref() visitor does not support skip"); "function" == typeof l ? p = l : h && (p = l.enter, d = l.leave, f = l.skip); const m = { activatedOn: null, type: t[c], parent: a, isSkippedLevel: !1 }; if ("object" == typeof l && o(e, l, m, s + 1), a && r(e, a.type, t[c], a), p || h) { if (p && "function" != typeof p) throw new Error("DEV: should be function"); u.enter.push(Object.assign(Object.assign({}, e), { visit: p || (() => { }), skip: f, depth: s, context: m })) } if (d) { if ("function" != typeof d) throw new Error("DEV: should be function"); u.leave.push(Object.assign(Object.assign({}, e), { visit: d, depth: s, context: m })) } } } } }, 9443: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.walkDocument = void 0; const r = n(7468), o = n(4182), i = n(771), a = n(5220); function s(e) { var t, n; const r = {}; for (; e.parent;)(null === (t = e.parent.activatedOn) || void 0 === t ? void 0 : t.value.location) && (r[e.parent.type.name] = null === (n = e.parent.activatedOn) || void 0 === n ? void 0 : n.value.location), e = e.parent; return r } t.walkDocument = function (e) { const { document: t, rootType: n, normalizedVisitors: l, resolvedRefMap: c, ctx: u } = e, p = {}, d = new Set; !function e(t, n, f, h, m) { var g, y, v, b, w, x, k, _, O, S, E; const P = (e, t = $.source.absoluteRef) => { if (!r.isRef(e)) return { location: f, node: e }; const n = o.makeRefId(t, e.$ref), i = c.get(n); if (!i) return { location: void 0, node: void 0 }; const { resolved: a, node: s, document: l, nodePointer: u, error: p } = i; return { location: a ? new r.Location(l.source, u) : p instanceof o.YamlParseError ? new r.Location(p.source, "") : void 0, node: s, error: p } }, A = f; let $ = f; const { node: C, location: R, error: j } = P(t), T = new Set; if (r.isRef(t)) { const e = l.ref.enter; for (const { visit: r, ruleId: o, severity: i, context: a } of e) if (!d.has(t)) { T.add(a); r(t, { report: N.bind(void 0, o, i), resolve: P, rawNode: t, rawLocation: A, location: f, type: n, parent: h, key: m, parentLocations: {}, oasVersion: u.oasVersion, getVisitorData: D.bind(void 0, o) }, { node: C, location: R, error: j }), (null == R ? void 0 : R.source.absoluteRef) && u.refTypes && u.refTypes.set(null == R ? void 0 : R.source.absoluteRef, n) } } if (void 0 !== C && R && "scalar" !== n.name) { $ = R; const o = null === (y = null === (g = p[n.name]) || void 0 === g ? void 0 : g.has) || void 0 === y ? void 0 : y.call(g, C); let s = !1; const c = l.any.enter.concat((null === (v = l[n.name]) || void 0 === v ? void 0 : v.enter) || []), u = []; for (const { context: e, visit: r, skip: a, ruleId: l, severity: p } of c) if (e.isSkippedLevel) !e.parent.activatedOn || e.parent.activatedOn.value.nextLevelTypeActivated || e.seen.has(t) || (e.seen.add(t), s = !0, u.push(e)); else if (e.parent && e.parent.activatedOn && (null === (b = e.activatedOn) || void 0 === b ? void 0 : b.value.withParentNode) !== e.parent.activatedOn.value.node && (null === (w = e.parent.activatedOn.value.nextLevelTypeActivated) || void 0 === w ? void 0 : w.value) !== n || !e.parent && !o) { u.push(e); const o = { node: C, location: R, nextLevelTypeActivated: null, withParentNode: null === (k = null === (x = e.parent) || void 0 === x ? void 0 : x.activatedOn) || void 0 === k ? void 0 : k.value.node, skipped: null !== (S = (null === (O = null === (_ = e.parent) || void 0 === _ ? void 0 : _.activatedOn) || void 0 === O ? void 0 : O.value.skipped) || (null == a ? void 0 : a(C, m))) && void 0 !== S && S }; e.activatedOn = i.pushStack(e.activatedOn, o); let c = e.parent; for (; c;)c.activatedOn.value.nextLevelTypeActivated = i.pushStack(c.activatedOn.value.nextLevelTypeActivated, n), c = c.parent; if (!o.skipped) { s = !0, T.add(e); const { ignoreNextVisitorsOnNode: n } = I(r, C, t, e, l, p); if (n) break } } if (s || !o) if (p[n.name] = p[n.name] || new Set, p[n.name].add(C), Array.isArray(C)) { const t = n.items; if (void 0 !== t) for (let n = 0; n < C.length; n++)e(C[n], t, R.child([n]), C, n) } else if ("object" == typeof C && null !== C) { const o = Object.keys(n.properties); n.additionalProperties && o.push(...Object.keys(C).filter((e => !o.includes(e)))), r.isRef(t) && o.push(...Object.keys(t).filter((e => "$ref" !== e && !o.includes(e)))); for (const i of o) { let o = C[i], s = R; void 0 === o && (o = t[i], s = f); let l = n.properties[i]; void 0 === l && (l = n.additionalProperties), "function" == typeof l && (l = l(o, i)), !a.isNamedType(l) && (null == l ? void 0 : l.directResolveAs) && (l = l.directResolveAs, o = { $ref: o }), l && void 0 === l.name && !1 !== l.resolvable && (l = { name: "scalar", properties: {} }), a.isNamedType(l) && ("scalar" !== l.name || r.isRef(o)) && e(o, l, s.child([i]), C, i) } } const d = l.any.leave, h = ((null === (E = l[n.name]) || void 0 === E ? void 0 : E.leave) || []).concat(d); for (const e of u.reverse()) if (e.isSkippedLevel) e.seen.delete(C); else if (e.activatedOn = i.popStack(e.activatedOn), e.parent) { let t = e.parent; for (; t;)t.activatedOn.value.nextLevelTypeActivated = i.popStack(t.activatedOn.value.nextLevelTypeActivated), t = t.parent } for (const { context: e, visit: n, ruleId: r, severity: o } of h) !e.isSkippedLevel && T.has(e) && I(n, C, t, e, r, o) } if ($ = f, r.isRef(t)) { const e = l.ref.leave; for (const { visit: r, ruleId: o, severity: i, context: a } of e) if (T.has(a)) { r(t, { report: N.bind(void 0, o, i), resolve: P, rawNode: t, rawLocation: A, location: f, type: n, parent: h, key: m, parentLocations: {}, oasVersion: u.oasVersion, getVisitorData: D.bind(void 0, o) }, { node: C, location: R, error: j }) } } function I(e, t, r, o, i, a) { const l = N.bind(void 0, i, a); let c = !1; return e(t, { report: l, resolve: P, rawNode: r, location: $, rawLocation: A, type: n, parent: h, key: m, parentLocations: s(o), oasVersion: u.oasVersion, ignoreNextVisitorsOnNode: () => { c = !0 }, getVisitorData: D.bind(void 0, i) }, function (e) { var t; const n = {}; for (; e.parent;)n[e.parent.type.name] = null === (t = e.parent.activatedOn) || void 0 === t ? void 0 : t.value.node, e = e.parent; return n }(o), o), { ignoreNextVisitorsOnNode: c } } function N(e, t, n) { const r = n.location ? Array.isArray(n.location) ? n.location : [n.location] : [Object.assign(Object.assign({}, $), { reportOnKey: !1 })]; u.problems.push(Object.assign(Object.assign({ ruleId: n.ruleId || e, severity: n.forceSeverity || t }, n), { suggest: n.suggest || [], location: r.map((e => Object.assign(Object.assign(Object.assign({}, $), { reportOnKey: !1 }), e))) })) } function D(e) { return u.visitorsData[e] = u.visitorsData[e] || {}, u.visitorsData[e] } }(t.parsed, n, new r.Location(t.source, "#/"), void 0, "") } }, 5019: function (e, t, n) { var r = n(5623); e.exports = function (e) { return e ? ("{}" === e.substr(0, 2) && (e = "\\{\\}" + e.substr(2)), g(function (e) { return e.split("\\\\").join(o).split("\\{").join(i).split("\\}").join(a).split("\\,").join(s).split("\\.").join(l) }(e), !0).map(u)) : [] }; var o = "\0SLASH" + Math.random() + "\0", i = "\0OPEN" + Math.random() + "\0", a = "\0CLOSE" + Math.random() + "\0", s = "\0COMMA" + Math.random() + "\0", l = "\0PERIOD" + Math.random() + "\0"; function c(e) { return parseInt(e, 10) == e ? parseInt(e, 10) : e.charCodeAt(0) } function u(e) { return e.split(o).join("\\").split(i).join("{").split(a).join("}").split(s).join(",").split(l).join(".") } function p(e) { if (!e) return [""]; var t = [], n = r("{", "}", e); if (!n) return e.split(","); var o = n.pre, i = n.body, a = n.post, s = o.split(","); s[s.length - 1] += "{" + i + "}"; var l = p(a); return a.length && (s[s.length - 1] += l.shift(), s.push.apply(s, l)), t.push.apply(t, s), t } function d(e) { return "{" + e + "}" } function f(e) { return /^-?0\d/.test(e) } function h(e, t) { return e <= t } function m(e, t) { return e >= t } function g(e, t) { var n = [], o = r("{", "}", e); if (!o) return [e]; var i = o.pre, s = o.post.length ? g(o.post, !1) : [""]; if (/\$$/.test(o.pre)) for (var l = 0; l < s.length; l++) { var u = i + "{" + o.body + "}" + s[l]; n.push(u) } else { var y, v, b = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body), w = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body), x = b || w, k = o.body.indexOf(",") >= 0; if (!x && !k) return o.post.match(/,.*\}/) ? g(e = o.pre + "{" + o.body + a + o.post) : [e]; if (x) y = o.body.split(/\.\./); else if (1 === (y = p(o.body)).length && 1 === (y = g(y[0], !1).map(d)).length) return s.map((function (e) { return o.pre + y[0] + e })); if (x) { var _ = c(y[0]), O = c(y[1]), S = Math.max(y[0].length, y[1].length), E = 3 == y.length ? Math.abs(c(y[2])) : 1, P = h; O < _ && (E *= -1, P = m); var A = y.some(f); v = []; for (var $ = _; P($, O); $ += E) { var C; if (w) "\\" === (C = String.fromCharCode($)) && (C = ""); else if (C = String($), A) { var R = S - C.length; if (R > 0) { var j = new Array(R + 1).join("0"); C = $ < 0 ? "-" + j + C.slice(1) : j + C } } v.push(C) } } else { v = []; for (var T = 0; T < y.length; T++)v.push.apply(v, g(y[T], !1)) } for (T = 0; T < v.length; T++)for (l = 0; l < s.length; l++)u = i + v[T] + s[l], (!t || x || u) && n.push(u) } return n } }, 5751: function (e) { const t = "object" == typeof process && process && !1; e.exports = t ? { sep: "\\" } : { sep: "/" } }, 4099: function (e, t, n) { const r = e.exports = (e, t, n = {}) => (g(t), !(!n.nocomment && "#" === t.charAt(0)) && new v(t, n).match(e)); e.exports = r; const o = n(5751); r.sep = o.sep; const i = Symbol("globstar **"); r.GLOBSTAR = i; const a = n(5019), s = { "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, "?": { open: "(?:", close: ")?" }, "+": { open: "(?:", close: ")+" }, "*": { open: "(?:", close: ")*" }, "@": { open: "(?:", close: ")" } }, l = "[^/]", c = "[^/]*?", u = e => e.split("").reduce(((e, t) => (e[t] = !0, e)), {}), p = u("().*{}+?[]^$\\!"), d = u("[.("), f = /\/+/; r.filter = (e, t = {}) => (n, o, i) => r(n, e, t); const h = (e, t = {}) => { const n = {}; return Object.keys(e).forEach((t => n[t] = e[t])), Object.keys(t).forEach((e => n[e] = t[e])), n }; r.defaults = e => { if (!e || "object" != typeof e || !Object.keys(e).length) return r; const t = r, n = (n, r, o) => t(n, r, h(e, o)); return (n.Minimatch = class extends t.Minimatch { constructor(t, n) { super(t, h(e, n)) } }).defaults = n => t.defaults(h(e, n)).Minimatch, n.filter = (n, r) => t.filter(n, h(e, r)), n.defaults = n => t.defaults(h(e, n)), n.makeRe = (n, r) => t.makeRe(n, h(e, r)), n.braceExpand = (n, r) => t.braceExpand(n, h(e, r)), n.match = (n, r, o) => t.match(n, r, h(e, o)), n }, r.braceExpand = (e, t) => m(e, t); const m = (e, t = {}) => (g(e), t.nobrace || !/\{(?:(?!\{).)*\}/.test(e) ? [e] : a(e)), g = e => { if ("string" != typeof e) throw new TypeError("invalid pattern"); if (e.length > 65536) throw new TypeError("pattern is too long") }, y = Symbol("subparse"); r.makeRe = (e, t) => new v(e, t || {}).makeRe(), r.match = (e, t, n = {}) => { const r = new v(t, n); return e = e.filter((e => r.match(e))), r.options.nonull && !e.length && e.push(t), e }; class v { constructor(e, t) { g(e), t || (t = {}), this.options = t, this.set = [], this.pattern = e, this.regexp = null, this.negate = !1, this.comment = !1, this.empty = !1, this.partial = !!t.partial, this.make() } debug() { } make() { const e = this.pattern, t = this.options; if (!t.nocomment && "#" === e.charAt(0)) return void (this.comment = !0); if (!e) return void (this.empty = !0); this.parseNegate(); let n = this.globSet = this.braceExpand(); t.debug && (this.debug = (...e) => console.error(...e)), this.debug(this.pattern, n), n = this.globParts = n.map((e => e.split(f))), this.debug(this.pattern, n), n = n.map(((e, t, n) => e.map(this.parse, this))), this.debug(this.pattern, n), n = n.filter((e => -1 === e.indexOf(!1))), this.debug(this.pattern, n), this.set = n } parseNegate() { if (this.options.nonegate) return; const e = this.pattern; let t = !1, n = 0; for (let r = 0; r < e.length && "!" === e.charAt(r); r++)t = !t, n++; n && (this.pattern = e.substr(n)), this.negate = t } matchOne(e, t, n) { var r = this.options; this.debug("matchOne", { this: this, file: e, pattern: t }), this.debug("matchOne", e.length, t.length); for (var o = 0, a = 0, s = e.length, l = t.length; o < s && a < l; o++, a++) { this.debug("matchOne loop"); var c, u = t[a], p = e[o]; if (this.debug(t, u, p), !1 === u) return !1; if (u === i) { this.debug("GLOBSTAR", [t, u, p]); var d = o, f = a + 1; if (f === l) { for (this.debug("** at the end"); o < s; o++)if ("." === e[o] || ".." === e[o] || !r.dot && "." === e[o].charAt(0)) return !1; return !0 } for (; d < s;) { var h = e[d]; if (this.debug("\nglobstar while", e, d, t, f, h), this.matchOne(e.slice(d), t.slice(f), n)) return this.debug("globstar found match!", d, s, h), !0; if ("." === h || ".." === h || !r.dot && "." === h.charAt(0)) { this.debug("dot detected!", e, d, t, f); break } this.debug("globstar swallow a segment, and continue"), d++ } return !(!n || (this.debug("\n>>> no match, partial?", e, d, t, f), d !== s)) } if ("string" == typeof u ? (c = p === u, this.debug("string match", u, p, c)) : (c = p.match(u), this.debug("pattern match", u, p, c)), !c) return !1 } if (o === s && a === l) return !0; if (o === s) return n; if (a === l) return o === s - 1 && "" === e[o]; throw new Error("wtf?") } braceExpand() { return m(this.pattern, this.options) } parse(e, t) { g(e); const n = this.options; if ("**" === e) { if (!n.noglobstar) return i; e = "*" } if ("" === e) return ""; let r = "", o = !!n.nocase, a = !1; const u = [], f = []; let h, m, v, b, w = !1, x = -1, k = -1; const _ = "." === e.charAt(0) ? "" : n.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", O = () => { if (h) { switch (h) { case "*": r += c, o = !0; break; case "?": r += l, o = !0; break; default: r += "\\" + h }this.debug("clearStateChar %j %j", h, r), h = !1 } }; for (let t, i = 0; i < e.length && (t = e.charAt(i)); i++)if (this.debug("%s\t%s %s %j", e, i, r, t), a) { if ("/" === t) return !1; p[t] && (r += "\\"), r += t, a = !1 } else switch (t) { case "/": return !1; case "\\": O(), a = !0; continue; case "?": case "*": case "+": case "@": case "!": if (this.debug("%s\t%s %s %j <-- stateChar", e, i, r, t), w) { this.debug(" in class"), "!" === t && i === k + 1 && (t = "^"), r += t; continue } this.debug("call clearStateChar %j", h), O(), h = t, n.noext && O(); continue; case "(": if (w) { r += "("; continue } if (!h) { r += "\\("; continue } u.push({ type: h, start: i - 1, reStart: r.length, open: s[h].open, close: s[h].close }), r += "!" === h ? "(?:(?!(?:" : "(?:", this.debug("plType %j %j", h, r), h = !1; continue; case ")": if (w || !u.length) { r += "\\)"; continue } O(), o = !0, v = u.pop(), r += v.close, "!" === v.type && f.push(v), v.reEnd = r.length; continue; case "|": if (w || !u.length) { r += "\\|"; continue } O(), r += "|"; continue; case "[": if (O(), w) { r += "\\" + t; continue } w = !0, k = i, x = r.length, r += t; continue; case "]": if (i === k + 1 || !w) { r += "\\" + t; continue } m = e.substring(k + 1, i); try { RegExp("[" + m + "]") } catch (e) { b = this.parse(m, y), r = r.substr(0, x) + "\\[" + b[0] + "\\]", o = o || b[1], w = !1; continue } o = !0, w = !1, r += t; continue; default: O(), !p[t] || "^" === t && w || (r += "\\"), r += t }for (w && (m = e.substr(k + 1), b = this.parse(m, y), r = r.substr(0, x) + "\\[" + b[0], o = o || b[1]), v = u.pop(); v; v = u.pop()) { let e; e = r.slice(v.reStart + v.open.length), this.debug("setting tail", r, v), e = e.replace(/((?:\\{2}){0,64})(\\?)\|/g, ((e, t, n) => (n || (n = "\\"), t + t + n + "|"))), this.debug("tail=%j\n %s", e, e, v, r); const t = "*" === v.type ? c : "?" === v.type ? l : "\\" + v.type; o = !0, r = r.slice(0, v.reStart) + t + "\\(" + e } O(), a && (r += "\\\\"); const S = d[r.charAt(0)]; for (let e = f.length - 1; e > -1; e--) { const n = f[e], o = r.slice(0, n.reStart), i = r.slice(n.reStart, n.reEnd - 8); let a = r.slice(n.reEnd); const s = r.slice(n.reEnd - 8, n.reEnd) + a, l = o.split("(").length - 1; let c = a; for (let e = 0; e < l; e++)c = c.replace(/\)[+*?]?/, ""); a = c, r = o + i + a + ("" === a && t !== y ? "$" : "") + s } if ("" !== r && o && (r = "(?=.)" + r), S && (r = _ + r), t === y) return [r, o]; if (!o) return e.replace(/\\(.)/g, "$1"); const E = n.nocase ? "i" : ""; try { return Object.assign(new RegExp("^" + r + "$", E), { _glob: e, _src: r }) } catch (e) { return new RegExp("$.") } } makeRe() { if (this.regexp || !1 === this.regexp) return this.regexp; const e = this.set; if (!e.length) return this.regexp = !1, this.regexp; const t = this.options, n = t.noglobstar ? c : t.dot ? "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?" : "(?:(?!(?:\\/|^)\\.).)*?", r = t.nocase ? "i" : ""; let o = e.map((e => (e = e.map((e => "string" == typeof e ? e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") : e === i ? i : e._src)).reduce(((e, t) => (e[e.length - 1] === i && t === i || e.push(t), e)), []), e.forEach(((t, r) => { t === i && e[r - 1] !== i && (0 === r ? e.length > 1 ? e[r + 1] = "(?:\\/|" + n + "\\/)?" + e[r + 1] : e[r] = n : r === e.length - 1 ? e[r - 1] += "(?:\\/|" + n + ")?" : (e[r - 1] += "(?:\\/|\\/" + n + "\\/)" + e[r + 1], e[r + 1] = i)) })), e.filter((e => e !== i)).join("/")))).join("|"); o = "^(?:" + o + ")$", this.negate && (o = "^(?!" + o + ").*$"); try { this.regexp = new RegExp(o, r) } catch (e) { this.regexp = !1 } return this.regexp } match(e, t = this.partial) { if (this.debug("match", e, this.pattern), this.comment) return !1; if (this.empty) return "" === e; if ("/" === e && t) return !0; const n = this.options; "/" !== o.sep && (e = e.split(o.sep).join("/")), e = e.split(f), this.debug(this.pattern, "split", e); const r = this.set; let i; this.debug(this.pattern, "set", r); for (let t = e.length - 1; t >= 0 && (i = e[t], !i); t--); for (let o = 0; o < r.length; o++) { const a = r[o]; let s = e; if (n.matchBase && 1 === a.length && (s = [i]), this.matchOne(s, a, t)) return !!n.flipNegate || !this.negate } return !n.flipNegate && this.negate } static defaults(e) { return r.defaults(e).Minimatch } } r.Minimatch = v }, 5623: function (e) { "use strict"; function t(e, t, o) { e instanceof RegExp && (e = n(e, o)), t instanceof RegExp && (t = n(t, o)); var i = r(e, t, o); return i && { start: i[0], end: i[1], pre: o.slice(0, i[0]), body: o.slice(i[0] + e.length, i[1]), post: o.slice(i[1] + t.length) } } function n(e, t) { var n = t.match(e); return n ? n[0] : null } function r(e, t, n) { var r, o, i, a, s, l = n.indexOf(e), c = n.indexOf(t, l + 1), u = l; if (l >= 0 && c > 0) { if (e === t) return [l, c]; for (r = [], i = n.length; u >= 0 && !s;)u == l ? (r.push(u), l = n.indexOf(e, u + 1)) : 1 == r.length ? s = [r.pop(), c] : ((o = r.pop()) < i && (i = o, a = c), c = n.indexOf(t, u + 1)), u = l < c && l >= 0 ? l : c; r.length && (s = [i, a]) } return s } e.exports = t, t.range = r }, 4480: function (e, t, n) { "use strict"; var r = n.g.process && process.nextTick || n.g.setImmediate || function (e) { setTimeout(e, 0) }; e.exports = function (e, t) { return e ? void t.then((function (t) { r((function () { e(null, t) })) }), (function (t) { r((function () { e(t) })) })) : t } }, 4184: function (e, t) { var n; !function () { "use strict"; var r = {}.hasOwnProperty; function o() { for (var e = [], t = 0; t < arguments.length; t++) { var n = arguments[t]; if (n) { var i = typeof n; if ("string" === i || "number" === i) e.push(n); else if (Array.isArray(n)) { if (n.length) { var a = o.apply(null, n); a && e.push(a) } } else if ("object" === i) if (n.toString === Object.prototype.toString) for (var s in n) r.call(n, s) && n[s] && e.push(s); else e.push(n.toString()) } } return e.join(" ") } e.exports ? (o.default = o, e.exports = o) : void 0 === (n = function () { return o }.apply(t, [])) || (e.exports = n) }() }, 9266: function (e, t, n) { n(2222), n(1539), n(2526), n(2443), n(1817), n(2401), n(8722), n(2165), n(9007), n(6066), n(3510), n(1840), n(6982), n(2159), n(6649), n(9341), n(543), n(3706), n(408), n(1299); var r = n(857); e.exports = r.Symbol }, 3099: function (e) { e.exports = function (e) { if ("function" != typeof e) throw TypeError(String(e) + " is not a function"); return e } }, 9670: function (e, t, n) { var r = n(111); e.exports = function (e) { if (!r(e)) throw TypeError(String(e) + " is not an object"); return e } }, 1318: function (e, t, n) { var r = n(5656), o = n(7466), i = n(1400), a = function (e) { return function (t, n, a) { var s, l = r(t), c = o(l.length), u = i(a, c); if (e && n != n) { for (; c > u;)if ((s = l[u++]) != s) return !0 } else for (; c > u; u++)if ((e || u in l) && l[u] === n) return e || u || 0; return !e && -1 } }; e.exports = { includes: a(!0), indexOf: a(!1) } }, 2092: function (e, t, n) { var r = n(9974), o = n(8361), i = n(7908), a = n(7466), s = n(5417), l = [].push, c = function (e) { var t = 1 == e, n = 2 == e, c = 3 == e, u = 4 == e, p = 6 == e, d = 7 == e, f = 5 == e || p; return function (h, m, g, y) { for (var v, b, w = i(h), x = o(w), k = r(m, g, 3), _ = a(x.length), O = 0, S = y || s, E = t ? S(h, _) : n || d ? S(h, 0) : void 0; _ > O; O++)if ((f || O in x) && (b = k(v = x[O], O, w), e)) if (t) E[O] = b; else if (b) switch (e) { case 3: return !0; case 5: return v; case 6: return O; case 2: l.call(E, v) } else switch (e) { case 4: return !1; case 7: l.call(E, v) }return p ? -1 : c || u ? u : E } }; e.exports = { forEach: c(0), map: c(1), filter: c(2), some: c(3), every: c(4), find: c(5), findIndex: c(6), filterOut: c(7) } }, 1194: function (e, t, n) { var r = n(7293), o = n(5112), i = n(7392), a = o("species"); e.exports = function (e) { return i >= 51 || !r((function () { var t = []; return (t.constructor = {})[a] = function () { return { foo: 1 } }, 1 !== t[e](Boolean).foo })) } }, 5417: function (e, t, n) { var r = n(111), o = n(3157), i = n(5112)("species"); e.exports = function (e, t) { var n; return o(e) && ("function" != typeof (n = e.constructor) || n !== Array && !o(n.prototype) ? r(n) && null === (n = n[i]) && (n = void 0) : n = void 0), new (void 0 === n ? Array : n)(0 === t ? 0 : t) } }, 4326: function (e) { var t = {}.toString; e.exports = function (e) { return t.call(e).slice(8, -1) } }, 648: function (e, t, n) { var r = n(1694), o = n(4326), i = n(5112)("toStringTag"), a = "Arguments" == o(function () { return arguments }()); e.exports = r ? o : function (e) { var t, n, r; 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 : a ? o(t) : "Object" == (r = o(t)) && "function" == typeof t.callee ? "Arguments" : r } }, 9920: function (e, t, n) { var r = n(6656), o = n(3887), i = n(1236), a = n(3070); e.exports = function (e, t) { for (var n = o(t), s = a.f, l = i.f, c = 0; c < n.length; c++) { var u = n[c]; r(e, u) || s(e, u, l(t, u)) } } }, 8880: function (e, t, n) { var r = n(9781), o = n(3070), i = n(9114); e.exports = r ? function (e, t, n) { return o.f(e, t, i(1, n)) } : function (e, t, n) { return e[t] = n, e } }, 9114: function (e) { e.exports = function (e, t) { return { enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t } } }, 6135: function (e, t, n) { "use strict"; var r = n(7593), o = n(3070), i = n(9114); e.exports = function (e, t, n) { var a = r(t); a in e ? o.f(e, a, i(0, n)) : e[a] = n } }, 7235: function (e, t, n) { var r = n(857), o = n(6656), i = n(6061), a = n(3070).f; e.exports = function (e) { var t = r.Symbol || (r.Symbol = {}); o(t, e) || a(t, e, { value: i.f(e) }) } }, 9781: function (e, t, n) { var r = n(7293); e.exports = !r((function () { return 7 != Object.defineProperty({}, 1, { get: function () { return 7 } })[1] })) }, 317: function (e, t, n) { var r = n(7854), o = n(111), i = r.document, a = o(i) && o(i.createElement); e.exports = function (e) { return a ? i.createElement(e) : {} } }, 8113: function (e, t, n) { var r = n(5005); e.exports = r("navigator", "userAgent") || "" }, 7392: function (e, t, n) { var r, o, i = n(7854), a = n(8113), s = i.process, l = s && s.versions, c = l && l.v8; c ? o = (r = c.split("."))[0] < 4 ? 1 : r[0] + r[1] : a && (!(r = a.match(/Edge\/(\d+)/)) || r[1] >= 74) && (r = a.match(/Chrome\/(\d+)/)) && (o = r[1]), e.exports = o && +o }, 748: function (e) { e.exports = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"] }, 2109: function (e, t, n) { var r = n(7854), o = n(1236).f, i = n(8880), a = n(1320), s = n(3505), l = n(9920), c = n(4705); e.exports = function (e, t) { var n, u, p, d, f, h = e.target, m = e.global, g = e.stat; if (n = m ? r : g ? r[h] || s(h, {}) : (r[h] || {}).prototype) for (u in t) { if (d = t[u], p = e.noTargetGet ? (f = o(n, u)) && f.value : n[u], !c(m ? u : h + (g ? "." : "#") + u, e.forced) && void 0 !== p) { if (typeof d == typeof p) continue; l(d, p) } (e.sham || p && p.sham) && i(d, "sham", !0), a(n, u, d, e) } } }, 7293: function (e) { e.exports = function (e) { try { return !!e() } catch (e) { return !0 } } }, 9974: function (e, t, n) { var r = n(3099); e.exports = function (e, t, n) { if (r(e), void 0 === t) return e; switch (n) { case 0: return function () { return e.call(t) }; 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) } } }, 5005: function (e, t, n) { var r = n(857), o = n(7854), i = function (e) { return "function" == typeof e ? e : void 0 }; e.exports = function (e, t) { return arguments.length < 2 ? i(r[e]) || i(o[e]) : r[e] && r[e][t] || o[e] && o[e][t] } }, 7854: function (e, t, n) { var r = function (e) { return e && e.Math == Math && e }; e.exports = r("object" == typeof globalThis && globalThis) || r("object" == typeof window && window) || r("object" == typeof self && self) || r("object" == typeof n.g && n.g) || function () { return this }() || Function("return this")() }, 6656: function (e, t, n) { var r = n(7908), o = {}.hasOwnProperty; e.exports = Object.hasOwn || function (e, t) { return o.call(r(e), t) } }, 3501: function (e) { e.exports = {} }, 490: function (e, t, n) { var r = n(5005); e.exports = r("document", "documentElement") }, 4664: function (e, t, n) { var r = n(9781), o = n(7293), i = n(317); e.exports = !r && !o((function () { return 7 != Object.defineProperty(i("div"), "a", { get: function () { return 7 } }).a })) }, 8361: function (e, t, n) { var r = n(7293), o = n(4326), i = "".split; e.exports = r((function () { return !Object("z").propertyIsEnumerable(0) })) ? function (e) { return "String" == o(e) ? i.call(e, "") : Object(e) } : Object }, 2788: function (e, t, n) { var r = n(5465), o = Function.toString; "function" != typeof r.inspectSource && (r.inspectSource = function (e) { return o.call(e) }), e.exports = r.inspectSource }, 9909: function (e, t, n) { var r, o, i, a = n(8536), s = n(7854), l = n(111), c = n(8880), u = n(6656), p = n(5465), d = n(6200), f = n(3501), h = "Object already initialized", m = s.WeakMap; if (a || p.state) { var g = p.state || (p.state = new m), y = g.get, v = g.has, b = g.set; r = function (e, t) { if (v.call(g, e)) throw new TypeError(h); return t.facade = e, b.call(g, e, t), t }, o = function (e) { return y.call(g, e) || {} }, i = function (e) { return v.call(g, e) } } else { var w = d("state"); f[w] = !0, r = function (e, t) { if (u(e, w)) throw new TypeError(h); return t.facade = e, c(e, w, t), t }, o = function (e) { return u(e, w) ? e[w] : {} }, i = function (e) { return u(e, w) } } e.exports = { set: r, get: o, has: i, enforce: function (e) { return i(e) ? o(e) : r(e, {}) }, getterFor: function (e) { return function (t) { var n; if (!l(t) || (n = o(t)).type !== e) throw TypeError("Incompatible receiver, " + e + " required"); return n } } } }, 3157: function (e, t, n) { var r = n(4326); e.exports = Array.isArray || function (e) { return "Array" == r(e) } }, 4705: function (e, t, n) { var r = n(7293), o = /#|\.prototype\./, i = function (e, t) { var n = s[a(e)]; return n == c || n != l && ("function" == typeof t ? r(t) : !!t) }, a = i.normalize = function (e) { return String(e).replace(o, ".").toLowerCase() }, s = i.data = {}, l = i.NATIVE = "N", c = i.POLYFILL = "P"; e.exports = i }, 111: function (e) { e.exports = function (e) { return "object" == typeof e ? null !== e : "function" == typeof e } }, 1913: function (e) { e.exports = !1 }, 133: function (e, t, n) { var r = n(7392), o = n(7293); e.exports = !!Object.getOwnPropertySymbols && !o((function () { var e = Symbol(); return !String(e) || !(Object(e) instanceof Symbol) || !Symbol.sham && r && r < 41 })) }, 8536: function (e, t, n) { var r = n(7854), o = n(2788), i = r.WeakMap; e.exports = "function" == typeof i && /native code/.test(o(i)) }, 30: function (e, t, n) { var r, o = n(9670), i = n(6048), a = n(748), s = n(3501), l = n(490), c = n(317), u = n(6200)("IE_PROTO"), p = function () { }, d = function (e) { return "