openapi-client-codegen 0.3.3.dev87__py3-none-any.whl → 0.3.3.dev91__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.
@@ -0,0 +1,13 @@
1
+ {
2
+ "generatorName": "typescript-fetch",
3
+ "globalProperties": {
4
+ "apiTests": false,
5
+ "modelTests": false,
6
+ "modelDocs": false,
7
+ "apiDocs": false
8
+ },
9
+ "additionalProperties": {
10
+ "npmVersion": "0.1.0",
11
+ "disallowAdditionalPropertiesIfNotPresent": false
12
+ }
13
+ }
@@ -81,6 +81,7 @@ def generate_projects_command(
81
81
  names,
82
82
  templates_dir=templates_directory,
83
83
  npm_scope=settings.npm_scope,
84
+ typescript_npm_scope=settings.typescript_npm_scope,
84
85
  license_spdx=settings.license_spdx,
85
86
  repository_url=settings.repository_url,
86
87
  )
@@ -10,6 +10,7 @@ from typing import TYPE_CHECKING
10
10
 
11
11
  from bashrun.bash import bash
12
12
 
13
+ from .npm import write_npm_package_metadata
13
14
  from .resources import CONFIGS_DIR, IGNORE_FILE, OPENAPI_GENERATOR_CLI_VERSION
14
15
  from .unity import write_unity_package_metadata
15
16
 
@@ -27,6 +28,7 @@ def generate_client(
27
28
  templates_dir: Path | None = None,
28
29
  extra_references: list[str] | None = None,
29
30
  npm_scope: str | None = None,
31
+ typescript_npm_scope: str | None = None,
30
32
  license_spdx: str | None = None,
31
33
  repository_url: str | None = None,
32
34
  ) -> None:
@@ -38,6 +40,10 @@ def generate_client(
38
40
 
39
41
  if generator == "csharp":
40
42
  client_config["additionalProperties"]["packageName"] = names.camel
43
+ elif generator == "typescript-fetch":
44
+ client_config["additionalProperties"]["npmName"] = (
45
+ names.dashed if typescript_npm_scope is None else f"@{typescript_npm_scope}/{names.base}"
46
+ )
41
47
  else:
42
48
  client_config["additionalProperties"]["projectName"] = names.dashed
43
49
  client_config["additionalProperties"]["packageName"] = names.underscored
@@ -89,6 +95,13 @@ def generate_client(
89
95
  license_spdx=license_spdx,
90
96
  repository_url=repository_url,
91
97
  )
98
+ elif generator == "typescript-fetch":
99
+ write_npm_package_metadata(
100
+ temporary_directory / "package.json",
101
+ author=typescript_npm_scope,
102
+ license_spdx=license_spdx,
103
+ repository_url=repository_url,
104
+ )
92
105
 
93
106
  print(f"Syncing to {output_dir}...")
94
107
 
@@ -0,0 +1,23 @@
1
+ import json
2
+ from pathlib import Path
3
+
4
+
5
+ def write_npm_package_metadata(
6
+ package_json_path: Path,
7
+ author: str | None = None,
8
+ license_spdx: str | None = None,
9
+ repository_url: str | None = None,
10
+ ) -> None:
11
+ if author is None and license_spdx is None and repository_url is None:
12
+ return
13
+
14
+ package = json.loads(package_json_path.read_text(encoding="utf-8"))
15
+
16
+ if repository_url is not None:
17
+ package["repository"] = {"type": "git", "url": repository_url}
18
+ if author is not None:
19
+ package["author"] = author
20
+ if license_spdx is not None:
21
+ package["license"] = license_spdx
22
+
23
+ package_json_path.write_text(json.dumps(package, indent=2) + "\n", encoding="utf-8")
@@ -21,6 +21,7 @@ class ProjectsConfig(BaseModel):
21
21
  spec_command: str
22
22
  spec_env: dict[str, str] | None = None
23
23
  npm_scope: str | None = None
24
+ typescript_npm_scope: str | None = None
24
25
  license_spdx: str | None = None
25
26
  repository_url: str | None = None
26
27
  requires: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: openapi-client-codegen
3
- Version: 0.3.3.dev87
3
+ Version: 0.3.3.dev91
4
4
  Summary: OpenAPI client-generation wrapper: Litestar spec dump, 3.1->3.0 downgrade, patched openapi-generator templates, Unity package metadata
5
5
  License-File: LICENSE
6
6
  License-File: NOTICE
@@ -1,8 +1,9 @@
1
1
  openapi_client_codegen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- openapi_client_codegen/cli.py,sha256=VxI4wbkaeWwES56Hx3EMygrMRE08OwbUY3PdMszOwx4,3871
3
- openapi_client_codegen/client.py,sha256=hW6RpwJDmnLUo8bN42PQqQGlVanoPFn_46Cdg2L6inE,4773
2
+ openapi_client_codegen/cli.py,sha256=KmladvRnUc2R5nJJ_7aUC941Jd926g4qL5hSAA03Smo,3943
3
+ openapi_client_codegen/client.py,sha256=gEv7EYgNvxewaYYMO0yNqpYDH_EC-lr7Zp9kuIiAiN0,5366
4
4
  openapi_client_codegen/downgrade.py,sha256=7cxQZJRgWR5lNpvyJT-6pg4lVj72LsMRfdYzsNF9DtY,5230
5
- openapi_client_codegen/orchestrator.py,sha256=kX5C4-DbMGGVNc9k6bF7CaKCN3Rx2uJG-M3Qu6uIAAc,1842
5
+ openapi_client_codegen/npm.py,sha256=O4IIV9ihsJcd-cH0GsEkL9l7lWKW-NA0ztryeF6gowI,715
6
+ openapi_client_codegen/orchestrator.py,sha256=oZIIE_-QmklagRQGNFAiQLBRCTG5NARObN747zi26g8,1886
6
7
  openapi_client_codegen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
8
  openapi_client_codegen/resources.py,sha256=Vavy0_zqot1eDrFpDJ_BT4Sbx47vh7zuclPjQtW3QMw,266
8
9
  openapi_client_codegen/templates.py,sha256=ll3NQfdnpVgDOz4WJrEga5lHljEOOItSD1aeVP5Hp80,1198
@@ -10,6 +11,7 @@ openapi_client_codegen/unity.py,sha256=CLFoNjKJNq-InkaXoqUIJ3q293pWoaLdFNn39D-av
10
11
  openapi_client_codegen/_data/openapi-generator-ignore,sha256=NZV6sajtX0ihiLoF8gH58qqEB11r9oHjP3UBN1MU1UU,392
11
12
  openapi_client_codegen/_data/configs/csharp.json,sha256=_uezrromftc2dNmDH6JLhKO3MswWXWIesBYOnv8SqFc,587
12
13
  openapi_client_codegen/_data/configs/python.json,sha256=Phhny76qY4nVTcdPczBRCn0qgTdsR4WRgjHYslRRxp0,534
14
+ openapi_client_codegen/_data/configs/typescript-fetch.json,sha256=1kLsEdIqpgNmBImlwLPPBSdu7KGH1Nj28oDCeLJ-Jhg,278
13
15
  openapi_client_codegen/_data/templates-patches/csharp/0001-csharp-remove-errant-comma.patch,sha256=2AdRZk0L_QXcr08eEzABLBFA-w4er1zGGL_BUbmWojk,952
14
16
  openapi_client_codegen/_data/templates-patches/csharp/0002-csharp-models-required-only-constructors.patch,sha256=FrZ1Z1SA9JS1wlYk7h7zFgHNikUcMCWMr5dLhKshykc,5118
15
17
  openapi_client_codegen/_data/templates-patches/csharp/0003-csharp-httpclient-use-defaultT.patch,sha256=7DHEQ1yOfg12p7a0b5wJSRGush4ChupB6UNoyilrU9o,851
@@ -17,9 +19,9 @@ openapi_client_codegen/_data/templates-patches/csharp/0004-csharp-support-hybrid
17
19
  openapi_client_codegen/_data/templates-patches/csharp/0006-csharp-streaming-download-response.patch,sha256=ma-QkJA94jmN3scbJifaVPMcg_NNZ8klVO2HUrLMz_Y,2417
18
20
  openapi_client_codegen/_data/templates-patches/csharp/0007-csharp-model-default-initializers.patch,sha256=_fIimm7K0Gh1IYE3_fYyhUom_g-Bm4HlN9jLgsP27IE,862
19
21
  openapi_client_codegen/_data/templates-patches/csharp/0008-csharp-redirect-documentation-file.patch,sha256=HQXDgm_CzFYK4oxOoqBkYAz4wrKKPlYpLgTNHI_0IYc,1363
20
- openapi_client_codegen-0.3.3.dev87.dist-info/METADATA,sha256=PJjy9Fc02sJ7BUQ54bd-vE9r6PTvh_mnhZw_qAyBklk,438
21
- openapi_client_codegen-0.3.3.dev87.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
22
- openapi_client_codegen-0.3.3.dev87.dist-info/entry_points.txt,sha256=mw8FL3PBefHSxRjhBJunBk9G1efUKgxNXwAlghbc31E,74
23
- openapi_client_codegen-0.3.3.dev87.dist-info/licenses/LICENSE,sha256=RFhQPdSOiMTguUX7JSoIuTxA7HVzCbj_p8WU36HjUQQ,10947
24
- openapi_client_codegen-0.3.3.dev87.dist-info/licenses/NOTICE,sha256=jvglZza3GCdN7v4_TLuXUqX9C_uABlwAKUkcIeKwk_8,26
25
- openapi_client_codegen-0.3.3.dev87.dist-info/RECORD,,
22
+ openapi_client_codegen-0.3.3.dev91.dist-info/METADATA,sha256=jsYe7xGmpn36qKTJDJl7KLgl463Rmf0O_oO-h9NqVzs,438
23
+ openapi_client_codegen-0.3.3.dev91.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
24
+ openapi_client_codegen-0.3.3.dev91.dist-info/entry_points.txt,sha256=mw8FL3PBefHSxRjhBJunBk9G1efUKgxNXwAlghbc31E,74
25
+ openapi_client_codegen-0.3.3.dev91.dist-info/licenses/LICENSE,sha256=RFhQPdSOiMTguUX7JSoIuTxA7HVzCbj_p8WU36HjUQQ,10947
26
+ openapi_client_codegen-0.3.3.dev91.dist-info/licenses/NOTICE,sha256=jvglZza3GCdN7v4_TLuXUqX9C_uABlwAKUkcIeKwk_8,26
27
+ openapi_client_codegen-0.3.3.dev91.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.32.4
2
+ Generator: hatchling 1.33.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any