django-esi 8.0.0a1__py3-none-any.whl → 8.0.0a3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of django-esi might be problematic. Click here for more details.
- {django_esi-8.0.0a1.dist-info → django_esi-8.0.0a3.dist-info}/METADATA +3 -4
- {django_esi-8.0.0a1.dist-info → django_esi-8.0.0a3.dist-info}/RECORD +14 -13
- esi/__init__.py +2 -2
- esi/aiopenapi3/plugins.py +39 -0
- esi/app_settings.py +1 -1
- esi/exceptions.py +29 -0
- esi/locale/en/LC_MESSAGES/django.po +3 -3
- esi/locale/ru/LC_MESSAGES/django.po +8 -7
- esi/management/commands/generate_esi_stubs.py +33 -16
- esi/openapi_clients.py +154 -36
- esi/stubs.pyi +483 -567
- esi/tests/test_openapi.py +14 -0
- {django_esi-8.0.0a1.dist-info → django_esi-8.0.0a3.dist-info}/WHEEL +0 -0
- {django_esi-8.0.0a1.dist-info → django_esi-8.0.0a3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-esi
|
|
3
|
-
Version: 8.0.
|
|
3
|
+
Version: 8.0.0a3
|
|
4
4
|
Summary: Django app for accessing the EVE Swagger Interface (ESI).
|
|
5
|
+
Keywords: eveonline
|
|
5
6
|
Author-email: Alliance Auth <adarnof@gmail.com>
|
|
6
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.10
|
|
7
8
|
Description-Content-Type: text/markdown
|
|
8
9
|
Classifier: Environment :: Web Environment
|
|
9
10
|
Classifier: Framework :: Django
|
|
@@ -15,8 +16,6 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
|
15
16
|
Classifier: Operating System :: OS Independent
|
|
16
17
|
Classifier: Programming Language :: Python
|
|
17
18
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
esi/__init__.py,sha256=
|
|
1
|
+
esi/__init__.py,sha256=h7UNGlHMW_Mr3hZ1uc6-nP6J4YJU0GnnNvq1WRgx1Eo,199
|
|
2
2
|
esi/admin.py,sha256=9i68WwW_gR0zsGhJKTWK2yMEi44EkhpAaOW0LDpVfM8,1176
|
|
3
|
-
esi/app_settings.py,sha256=
|
|
3
|
+
esi/app_settings.py,sha256=2Jp_1myzKCL8A20RYvwQnQd04Ds_CBGsCqwDtsrYf0M,4289
|
|
4
4
|
esi/apps.py,sha256=HIu1niTkOXYmCzMVAjYcaFhHrrXeBbHvui6I44OCHXw,280
|
|
5
5
|
esi/checks.py,sha256=31puQdsrpRUJB-kedp2k7Evo0x2knTWQPZsCUUrJ3dY,1912
|
|
6
6
|
esi/clients.py,sha256=WB5YseJnfZdTeJ9C1Eze-iWXEqIpo5i_8uiQ6w0VkCw,23503
|
|
7
7
|
esi/decorators.py,sha256=2RmPdkrIAwbxOV5Ls8-RIWd_VhmXEDzIG6g5-bs6WZc,9093
|
|
8
8
|
esi/errors.py,sha256=KfFtgX8Mys4uMoQtco0n_pQeaM83yVrRSyW6StXuUjo,308
|
|
9
|
-
esi/exceptions.py,sha256=
|
|
9
|
+
esi/exceptions.py,sha256=nR-Z0BXVt5xSkgUL56E97pqtTyEu3MFr8_P0uCCCQ-E,1448
|
|
10
10
|
esi/helpers.py,sha256=-lYojtcWYWtlC_olSItWR3O3zJpjMYTQpNvsax81us8,672
|
|
11
11
|
esi/managers.py,sha256=zdri1aSJrSX9W_kwzbXq44CAAhdufikoOViaJntA41A,11443
|
|
12
12
|
esi/managers.pyi,sha256=BxRNX2yOT3domdrxsuGp4G0TrP_bWmf8VVwvM03eHQE,1977
|
|
13
13
|
esi/models.py,sha256=v33dvnWoiDwhcwc5Y4CvNOtAJocNd2qh5JtyNTtu-P8,11483
|
|
14
|
-
esi/openapi_clients.py,sha256=
|
|
14
|
+
esi/openapi_clients.py,sha256=ORYRPjW4pqmmMFmaK6oiIHsCpVlLL-s7LTKcXA3xhSM,36874
|
|
15
15
|
esi/rate_limiting.py,sha256=fUzso1YCHlBes8SVrEAsP58eRWcFNuO2XEkW6RQLhUE,2600
|
|
16
16
|
esi/stubs.py,sha256=UakysEAq5V454oKbxyEUewncr5sCFZCgwHFh0SJvU3Y,30
|
|
17
|
-
esi/stubs.pyi,sha256=
|
|
17
|
+
esi/stubs.pyi,sha256=rmWy-cM_qcZyEIAQcAbNJ2jMtgPU4Ai-SOncFmuBHSA,233649
|
|
18
18
|
esi/tasks.py,sha256=TaE_Q03oLk1ohkPw8KknXpIK-nY47C-oaGUUu4nr8pw,2658
|
|
19
19
|
esi/urls.py,sha256=B4EnmT-MZzs4F8a9ORK1ejAHbpGRN_V4TKks8ww3JGE,151
|
|
20
20
|
esi/views.py,sha256=cq2JkqSAwx-Nqi3amRUA9CKLu3ZLQYHSAH8c8g7xIQ4,3917
|
|
21
|
-
esi/aiopenapi3/plugins.py,sha256=
|
|
21
|
+
esi/aiopenapi3/plugins.py,sha256=1JGDhsca2vO_R_J5Gi4b5_lK0VDQ_AoyMHHyvzYoLrM,4673
|
|
22
22
|
esi/locale/de/LC_MESSAGES/django.mo,sha256=9_Fc_R8oZpT_CojH8gBxdSqj2K84EMEMn4wkvmOr7Dg,820
|
|
23
23
|
esi/locale/de/LC_MESSAGES/django.po,sha256=2NQVGYzLroHPPrWgmACSnb2d3nwlkMBLxA1uWU3K0FA,1503
|
|
24
24
|
esi/locale/en/LC_MESSAGES/django.mo,sha256=N1pb17IfLd0ASiKO8d68-B4ygSpDkhKOCs8YTzMXQo0,380
|
|
25
|
-
esi/locale/en/LC_MESSAGES/django.po,sha256
|
|
25
|
+
esi/locale/en/LC_MESSAGES/django.po,sha256=Ex11J8RaZM4KuP8xGtRi-TrSSAG05jU-KiemYeG84yc,1305
|
|
26
26
|
esi/locale/es/LC_MESSAGES/django.mo,sha256=dtCivRk6vD0mT2Wx9kcBRtMhU41bdqERHkBYPLoI5qg,737
|
|
27
27
|
esi/locale/es/LC_MESSAGES/django.po,sha256=KvCk4FLdPl_SMEcEWL6KAr870ScmsL5jnyCJvpglOB4,1504
|
|
28
28
|
esi/locale/fr_FR/LC_MESSAGES/django.mo,sha256=CG7EL6JGYoSVaAggmIvwerXuzf55b6VWmcOSK_1okik,643
|
|
@@ -34,11 +34,11 @@ esi/locale/ja/LC_MESSAGES/django.po,sha256=uWDpo_f8YyTn6VIH1S87PbGvQnsCiKe_i9LYm
|
|
|
34
34
|
esi/locale/ko_KR/LC_MESSAGES/django.mo,sha256=-GXsBq-bhlghnrxsuNfS2rirCJn9sPQi1whTvRCvGV4,746
|
|
35
35
|
esi/locale/ko_KR/LC_MESSAGES/django.po,sha256=gjPHlrraWxVBS-H4n88y-5a2n7PbwvwZzeaZdP5aquc,1511
|
|
36
36
|
esi/locale/ru/LC_MESSAGES/django.mo,sha256=WbKkLTav0kXvfTadQ6fccwh0T7iI_1wmPVu_LjQaYMo,915
|
|
37
|
-
esi/locale/ru/LC_MESSAGES/django.po,sha256=
|
|
37
|
+
esi/locale/ru/LC_MESSAGES/django.po,sha256=zQm-QOcIIu3vfU60bG2zFXv1sstsEV39EcN0VJErHrs,1812
|
|
38
38
|
esi/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=hPSO7wlU9cN8f32Qo1Dztq6AHUm2hZfL1hHIDW1R1F4,681
|
|
39
39
|
esi/locale/zh_Hans/LC_MESSAGES/django.po,sha256=fZhif8jOUvY22xurl7eBYsHNKoqf7obtkW5L3894hk4,1451
|
|
40
40
|
esi/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
-
esi/management/commands/generate_esi_stubs.py,sha256=
|
|
41
|
+
esi/management/commands/generate_esi_stubs.py,sha256=MlsLe_otphvkRDXs-MwbNLfvIhESKD9tOJxMdqvGunc,10579
|
|
42
42
|
esi/management/commands/migrate_to_ssov2.py,sha256=x9W4xaefrNoG_dNscHIWrWTRk4SuVGIW0s44q2QBN9k,6427
|
|
43
43
|
esi/migrations/0001_initial.py,sha256=ItZOyyCRyfyxUhxCG1P08oylCY355gqOKGF3cJTQmcM,3396
|
|
44
44
|
esi/migrations/0002_scopes_20161208.py,sha256=AG3qVAoEXh8WTgxuvS1pgG8LxLGMzpqr-jqtMjy3qC0,2846
|
|
@@ -73,13 +73,14 @@ esi/tests/test_decorators.py,sha256=I5MhcLKhN5xD4PxgEQqOWQ2kiXquDqQIEve9dbTOsho,
|
|
|
73
73
|
esi/tests/test_management_command.py,sha256=mtxfBtG6CHP1bTy1tJEO-djX4SQwMT3T_mqGnUIM6qs,9863
|
|
74
74
|
esi/tests/test_managers.py,sha256=CEpjXSXyVY6xxgrs0f9FnEh-KY9JPaKjKYiutXLLShE,24309
|
|
75
75
|
esi/tests/test_models.py,sha256=lDj5IcYgXHeOFTHXTsWGg13CSooFaxD0c51kJn_ytAc,13748
|
|
76
|
+
esi/tests/test_openapi.py,sha256=UJB6g8Olpb71OenLmuoQEok4RNWo2F3-37wL-HtV-RI,459
|
|
76
77
|
esi/tests/test_swagger.json,sha256=HOrPgbvwm5N521QNcE3baWcZJkSjmuN_VWrR06wEQoo,17241
|
|
77
78
|
esi/tests/test_swagger_full.json,sha256=JCEAZNMFhkdZhquTx4lDhrqGgCrzzzlYU64HdbEv8E4,2548369
|
|
78
79
|
esi/tests/test_tasks.py,sha256=nIvfXax_8nQCxNQeT-4TJ84i0__t1qWe155z5rnsktQ,4399
|
|
79
80
|
esi/tests/test_templatetags.py,sha256=b68JWE3HvOlr2aUisJHsTsDS4e7IMjDeqTuzMqC7Re4,517
|
|
80
81
|
esi/tests/test_views.py,sha256=Kj_f2yIpmPG0kx-lAX_sfkaHlIpgbkm02ieA1V3o-k4,13073
|
|
81
82
|
esi/tests/threading_pilot.py,sha256=ax_dEdnTNibA-UQHqbZle_2dh_3jcHKRyrYSOKuE_6U,1931
|
|
82
|
-
django_esi-8.0.
|
|
83
|
-
django_esi-8.0.
|
|
84
|
-
django_esi-8.0.
|
|
85
|
-
django_esi-8.0.
|
|
83
|
+
django_esi-8.0.0a3.dist-info/licenses/LICENSE,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
|
|
84
|
+
django_esi-8.0.0a3.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
85
|
+
django_esi-8.0.0a3.dist-info/METADATA,sha256=Q_uxmC2AihrvgYtxiVATgX0MFhM3bmrAk81axnHUyP4,4738
|
|
86
|
+
django_esi-8.0.0a3.dist-info/RECORD,,
|
esi/__init__.py
CHANGED
esi/aiopenapi3/plugins.py
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
from aiopenapi3.plugin import Document
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
class Trim204ContentType(Document):
|
|
5
|
+
"""
|
|
6
|
+
Removes and content-type from responses on a 204 reponses
|
|
7
|
+
A 204 never has content...
|
|
8
|
+
"""
|
|
9
|
+
def parsed(self, ctx: Document.Context) -> Document.Context:
|
|
10
|
+
spec = ctx.document
|
|
11
|
+
# Patch all paths
|
|
12
|
+
for path_item in spec.get("paths", {}).values():
|
|
13
|
+
for method_name in ("get", "post", "put", "delete", "patch", "options", "head"):
|
|
14
|
+
method = path_item.get(method_name)
|
|
15
|
+
if not method:
|
|
16
|
+
continue
|
|
17
|
+
if "204" in method['responses']:
|
|
18
|
+
method['responses']["204"].pop("content", [])
|
|
19
|
+
return ctx
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Add304ContentType(Document):
|
|
23
|
+
"""
|
|
24
|
+
Adds 304 content-type to responses
|
|
25
|
+
A 304 never has content. ESI defualt has application/json
|
|
26
|
+
This is a hack for now
|
|
27
|
+
"""
|
|
28
|
+
def parsed(self, ctx: Document.Context) -> Document.Context:
|
|
29
|
+
spec = ctx.document
|
|
30
|
+
# Patch all paths
|
|
31
|
+
for path_item in spec.get("paths", {}).values():
|
|
32
|
+
for method_name in ("get", "post", "put", "delete", "patch", "options", "head"):
|
|
33
|
+
method = path_item.get(method_name)
|
|
34
|
+
if not method:
|
|
35
|
+
continue
|
|
36
|
+
if "304" not in method['responses']:
|
|
37
|
+
method['responses']["304"]={
|
|
38
|
+
"description": "Not Modified"
|
|
39
|
+
}
|
|
40
|
+
return ctx
|
|
41
|
+
|
|
42
|
+
|
|
4
43
|
class RemoveSecurityParameter(Document):
|
|
5
44
|
"""
|
|
6
45
|
Removes the whole OAuth2 securityScheme
|
esi/app_settings.py
CHANGED
|
@@ -108,5 +108,5 @@ ESI_TOKEN_JWT_AUDIENCE = str(getattr(settings, "ESI_TOKEN_JWT_AUDIENCE", "EVE On
|
|
|
108
108
|
|
|
109
109
|
# list of all official language codes supported by ESI
|
|
110
110
|
ESI_LANGUAGES = getattr(settings, 'ESI_LANGUAGES', [
|
|
111
|
-
'
|
|
111
|
+
'en', 'de', 'fr', 'ja', 'ru', 'zh', 'ko', 'es'
|
|
112
112
|
])
|
esi/exceptions.py
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import dataclasses
|
|
2
|
+
|
|
3
|
+
from aiopenapi3.errors import HTTPServerError as base_HTTPServerError
|
|
4
|
+
from aiopenapi3.errors import HTTPClientError as base_HTTPClientError
|
|
5
|
+
from aiopenapi3.errors import HTTPError
|
|
6
|
+
|
|
1
7
|
class ESIErrorLimitException(Exception):
|
|
2
8
|
"""ESI Global Error Limit Exceeded
|
|
3
9
|
https://developers.eveonline.com/docs/services/esi/best-practices/#error-limit
|
|
@@ -16,3 +22,26 @@ class ESIBucketLimitException(Exception):
|
|
|
16
22
|
self.bucket = bucket
|
|
17
23
|
msg = kwargs.get("message") or f"ESI bucket limit reached for {bucket}."
|
|
18
24
|
super().__init__(msg, *args)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclasses.dataclass(repr=False)
|
|
28
|
+
class HTTPNotModified(HTTPError):
|
|
29
|
+
"""The HTTP Status is 304"""
|
|
30
|
+
|
|
31
|
+
status_code: int
|
|
32
|
+
headers: dict[str, str]
|
|
33
|
+
|
|
34
|
+
def __str__(self):
|
|
35
|
+
return f"""<{self.__class__.__name__} {self.status_code} {self.headers}>"""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@dataclasses.dataclass(repr=False)
|
|
39
|
+
class HTTPClientError(base_HTTPClientError):
|
|
40
|
+
"""response code 4xx"""
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclasses.dataclass(repr=False)
|
|
45
|
+
class HTTPServerError(base_HTTPServerError):
|
|
46
|
+
"""response code 5xx"""
|
|
47
|
+
pass
|
|
@@ -8,7 +8,7 @@ msgid ""
|
|
|
8
8
|
msgstr ""
|
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
|
11
|
-
"POT-Creation-Date: 2025-
|
|
11
|
+
"POT-Creation-Date: 2025-09-04 13:41+1000\n"
|
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -18,11 +18,11 @@ msgstr ""
|
|
|
18
18
|
"Content-Transfer-Encoding: 8bit\n"
|
|
19
19
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
20
20
|
|
|
21
|
-
#: esi/models.py:
|
|
21
|
+
#: esi/models.py:66
|
|
22
22
|
msgid "Character"
|
|
23
23
|
msgstr ""
|
|
24
24
|
|
|
25
|
-
#: esi/models.py:
|
|
25
|
+
#: esi/models.py:67
|
|
26
26
|
msgid "Corporation"
|
|
27
27
|
msgstr ""
|
|
28
28
|
|
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
#
|
|
6
6
|
# Translators:
|
|
7
7
|
# Filipp Chertiev <f@fzfx.ru>, 2023
|
|
8
|
+
# Gnevich <and.vareba81@gmail.com>, 2025
|
|
8
9
|
#
|
|
9
10
|
#, fuzzy
|
|
10
11
|
msgid ""
|
|
11
12
|
msgstr ""
|
|
12
13
|
"Project-Id-Version: PACKAGE VERSION\n"
|
|
13
14
|
"Report-Msgid-Bugs-To: \n"
|
|
14
|
-
"POT-Creation-Date:
|
|
15
|
+
"POT-Creation-Date: 2025-06-30 10:57+1000\n"
|
|
15
16
|
"PO-Revision-Date: 2023-10-25 11:04+0000\n"
|
|
16
|
-
"Last-Translator:
|
|
17
|
+
"Last-Translator: Gnevich <and.vareba81@gmail.com>, 2025\n"
|
|
17
18
|
"Language-Team: Russian (https://app.transifex.com/alliance-auth/teams/107430/ru/)\n"
|
|
18
19
|
"MIME-Version: 1.0\n"
|
|
19
20
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
@@ -21,13 +22,13 @@ msgstr ""
|
|
|
21
22
|
"Language: ru\n"
|
|
22
23
|
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
|
|
23
24
|
|
|
24
|
-
#: esi/models.py:
|
|
25
|
+
#: esi/models.py:73
|
|
25
26
|
msgid "Character"
|
|
26
|
-
msgstr ""
|
|
27
|
+
msgstr "Персонаж"
|
|
27
28
|
|
|
28
|
-
#: esi/models.py:
|
|
29
|
+
#: esi/models.py:74
|
|
29
30
|
msgid "Corporation"
|
|
30
|
-
msgstr ""
|
|
31
|
+
msgstr "Корпорация"
|
|
31
32
|
|
|
32
33
|
#: esi/templates/esi/select_token.html:13
|
|
33
34
|
msgid "ESI Token Selection"
|
|
@@ -49,7 +50,7 @@ msgstr "Новый персонаж"
|
|
|
49
50
|
#: esi/templates/esi/select_token.html:71
|
|
50
51
|
#: esi/templates/esi/select_token.html:107
|
|
51
52
|
msgid "Add Token"
|
|
52
|
-
msgstr ""
|
|
53
|
+
msgstr "Добавить токен"
|
|
53
54
|
|
|
54
55
|
#: esi/templates/esi/select_token.html:88
|
|
55
56
|
#: esi/templates/esi/select_token.html:89
|
|
@@ -102,7 +102,7 @@ class Command(BaseCommand):
|
|
|
102
102
|
f.write("# flake8: noqa=E501\n")
|
|
103
103
|
f.write("# Auto Generated do not edit\n")
|
|
104
104
|
# Python Imports
|
|
105
|
-
f.write("from typing import Any
|
|
105
|
+
f.write("from typing import Any\n\n")
|
|
106
106
|
f.write("from esi.openapi_clients import EsiOperation\n")
|
|
107
107
|
f.write("from esi.models import Token\n\n\n")
|
|
108
108
|
|
|
@@ -114,15 +114,25 @@ class Command(BaseCommand):
|
|
|
114
114
|
# result(), Results(), Results_Localized() etc. all live here
|
|
115
115
|
ops = stub_api._operationindex._tags[tag]
|
|
116
116
|
for nm, op in sorted(ops._operations.items()):
|
|
117
|
+
op_type = op[0]
|
|
117
118
|
op_obj = op[2]
|
|
118
119
|
docstring = (op_obj.description or op_obj.summary or "").replace("\n", " ").strip()
|
|
119
120
|
op_class_name = sanitize_operation_class(nm)
|
|
120
121
|
|
|
121
122
|
response_type = "Any"
|
|
122
123
|
try:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
match op_type:
|
|
125
|
+
case "post":
|
|
126
|
+
resp_201 = op_obj.responses.get("201")
|
|
127
|
+
if resp_201 and "application/json" in resp_201.content:
|
|
128
|
+
response_type = schema_to_type(resp_201.content["application/json"].schema_)
|
|
129
|
+
case "put" | "delete":
|
|
130
|
+
response_type = "None"
|
|
131
|
+
case _:
|
|
132
|
+
resp_200 = op_obj.responses.get("200")
|
|
133
|
+
if resp_200 and "application/json" in resp_200.content:
|
|
134
|
+
response_type = schema_to_type(resp_200.content["application/json"].schema_)
|
|
135
|
+
|
|
126
136
|
except Exception:
|
|
127
137
|
response_type = "Any"
|
|
128
138
|
|
|
@@ -130,22 +140,26 @@ class Command(BaseCommand):
|
|
|
130
140
|
|
|
131
141
|
if op_class_name not in operation_classes:
|
|
132
142
|
f.write(f"class {op_class_name}(EsiOperation):\n")
|
|
133
|
-
|
|
143
|
+
if response_type != "None":
|
|
144
|
+
f.write(" \"\"\"EsiOperation, use result(), results() or results_localized()\"\"\"\n")
|
|
145
|
+
else:
|
|
146
|
+
f.write(" \"\"\"EsiOperation, use result()\"\"\"\n")
|
|
134
147
|
|
|
135
148
|
# result()
|
|
136
149
|
f.write(f" def result(self, etag: str | None = None, return_response: bool = False, use_cache: bool = True, **extra) -> {response_type}:\n") # noqa: E501
|
|
137
150
|
f.write(f" \"\"\"{docstring}\"\"\"\n") if docstring else None
|
|
138
151
|
f.write(" ...\n\n")
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
if response_type != "None":
|
|
153
|
+
# We only need the extra utility functions if its actually an endpoint that returns data
|
|
154
|
+
# results()
|
|
155
|
+
f.write(f" def results(self, etag: str | None = None, return_response: bool = False, use_cache: bool = True, **extra) -> {results_type}:\n") # noqa: E501
|
|
156
|
+
f.write(f" \"\"\"{docstring}\"\"\"\n") if docstring else None
|
|
157
|
+
f.write(" ...\n\n")
|
|
158
|
+
|
|
159
|
+
# results_localized()
|
|
160
|
+
f.write(f" def results_localized(self, languages: list[str] | str | None = None, **extra) -> dict[str, {results_type}]:\n")
|
|
161
|
+
f.write(f" \"\"\"{docstring}\"\"\"\n") if docstring else None
|
|
162
|
+
f.write(" ...\n\n\n")
|
|
149
163
|
|
|
150
164
|
operation_classes[op_class_name] = True
|
|
151
165
|
|
|
@@ -172,6 +186,9 @@ class Command(BaseCommand):
|
|
|
172
186
|
|
|
173
187
|
params = ["self"]
|
|
174
188
|
optional_params = []
|
|
189
|
+
if getattr(op_obj, "requestBody", None):
|
|
190
|
+
params.append(f"body: {schema_to_type(op_obj.requestBody.content['application/json'].schema_)}")
|
|
191
|
+
|
|
175
192
|
for p in getattr(op_obj, "parameters", []):
|
|
176
193
|
required = getattr(p, "required", False)
|
|
177
194
|
schema_type_value = getattr(getattr(p, "schema_", None), "type", None)
|
|
@@ -181,7 +198,7 @@ class Command(BaseCommand):
|
|
|
181
198
|
param_type = "Any"
|
|
182
199
|
default = ""
|
|
183
200
|
if not required:
|
|
184
|
-
param_type = f"
|
|
201
|
+
param_type = f"{param_type} | None"
|
|
185
202
|
default = " = ..."
|
|
186
203
|
param_name = p.name.replace("-", "_")
|
|
187
204
|
if param_name == "authorization" and needs_oauth:
|