@hey-api/openapi-python 0.0.0-next-20260621202931 → 0.0.0-next-20260623210047
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.
- package/README.md +0 -19
- package/bin/run.js +8 -15
- package/dist/clients/aiohttp/__init__.py +3 -0
- package/dist/clients/aiohttp/client.py +128 -0
- package/dist/clients/requests/__init__.py +3 -0
- package/dist/clients/requests/client.py +128 -0
- package/dist/clients/urllib3/__init__.py +3 -0
- package/dist/clients/urllib3/client.py +128 -0
- package/dist/index-Baeurbo3.d.mts +3319 -0
- package/dist/index-Baeurbo3.d.mts.map +1 -0
- package/dist/index.d.mts +2 -3042
- package/dist/index.mjs +2 -2
- package/dist/plugins.d.mts +2 -9
- package/dist/plugins.mjs +8 -2
- package/dist/plugins.mjs.map +1 -1
- package/dist/{chunk-z9aeyW2b.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
- package/dist/run.mjs +12 -47
- package/dist/run.mjs.map +1 -1
- package/dist/{src-DaXm5pxY.mjs → src-D2qiV4Jp.mjs} +57 -14
- package/dist/src-D2qiV4Jp.mjs.map +1 -0
- package/package.json +5 -5
- package/bin/run.cmd +0 -3
- package/dist/index.d.mts.map +0 -1
- package/dist/plugins.d.mts.map +0 -1
- package/dist/src-DaXm5pxY.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as coerce, c as defineConfigTable, d as utils, f as createClient, i as applyNaming, l as definePluginConfig, n as OperationPath, o as defaultPaginationKeywords, p as defaultPlugins, r as OperationStrategy, s as defineConfig, t as Logger, u as toCase } from "./src-
|
|
1
|
+
import { S as PyDsl, _ as reserved, a as coerce, b as PyDslContext, c as defineConfigTable, d as utils, f as createClient, g as KwargPyDsl, h as PythonRenderer, i as applyNaming, l as definePluginConfig, m as $, n as OperationPath, o as defaultPaginationKeywords, p as defaultPlugins, r as OperationStrategy, s as defineConfig, t as Logger, u as toCase, v as keywords, x as ctx, y as regexp } from "./src-D2qiV4Jp.mjs";
|
|
2
2
|
import { t as plugins_exports } from "./plugins.mjs";
|
|
3
|
-
export { Logger, OperationPath, OperationStrategy, applyNaming, coerce, createClient, defaultPaginationKeywords, defaultPlugins, defineConfig, defineConfigTable, definePluginConfig, plugins_exports as plugins, toCase, utils };
|
|
3
|
+
export { $, KwargPyDsl, Logger, OperationPath, OperationStrategy, PyDsl, PyDslContext, PythonRenderer, applyNaming, coerce, createClient, ctx, defaultPaginationKeywords, defaultPlugins, defineConfig, defineConfigTable, definePluginConfig, keywords, plugins_exports as plugins, regexp, reserved, toCase, utils };
|
package/dist/plugins.d.mts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
declare const clientHttpx: any;
|
|
5
|
-
declare const sdk: any;
|
|
6
|
-
declare const pydantic: any;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { clientHttpx, pydantic, sdk, plugins_d_exports as t };
|
|
9
|
-
//# sourceMappingURL=plugins.d.mts.map
|
|
1
|
+
import { I as pydantic, L as sdk, M as clientHttpx, N as clientRequests, P as clientUrllib3, j as clientAiohttp } from "./index-Baeurbo3.mjs";
|
|
2
|
+
export { clientAiohttp, clientHttpx, clientRequests, clientUrllib3, pydantic, sdk };
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { t as __exportAll } from "./
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { pluginHelper } from "@hey-api/shared";
|
|
3
3
|
//#region src/plugins.ts
|
|
4
4
|
var plugins_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
clientAiohttp: () => clientAiohttp,
|
|
5
6
|
clientHttpx: () => clientHttpx,
|
|
7
|
+
clientRequests: () => clientRequests,
|
|
8
|
+
clientUrllib3: () => clientUrllib3,
|
|
6
9
|
pydantic: () => pydantic,
|
|
7
10
|
sdk: () => sdk
|
|
8
11
|
});
|
|
12
|
+
const clientAiohttp = pluginHelper("@hey-api/client-aiohttp");
|
|
9
13
|
const clientHttpx = pluginHelper("@hey-api/client-httpx");
|
|
14
|
+
const clientRequests = pluginHelper("@hey-api/client-requests");
|
|
15
|
+
const clientUrllib3 = pluginHelper("@hey-api/client-urllib3");
|
|
10
16
|
const sdk = pluginHelper("@hey-api/python-sdk");
|
|
11
17
|
const pydantic = pluginHelper("pydantic");
|
|
12
18
|
//#endregion
|
|
13
|
-
export { clientHttpx, pydantic, sdk, plugins_exports as t };
|
|
19
|
+
export { clientAiohttp, clientHttpx, clientRequests, clientUrllib3, pydantic, sdk, plugins_exports as t };
|
|
14
20
|
|
|
15
21
|
//# sourceMappingURL=plugins.mjs.map
|
package/dist/plugins.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.mjs","names":[],"sources":["../src/plugins.ts"],"sourcesContent":["import { pluginHelper } from '@hey-api/shared';\n\n// Hey API\nexport const clientHttpx = pluginHelper('@hey-api/client-httpx');\nexport const sdk = pluginHelper('@hey-api/python-sdk');\n// Other\nexport const pydantic = pluginHelper('pydantic');\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.mjs","names":[],"sources":["../src/plugins.ts"],"sourcesContent":["import { pluginHelper } from '@hey-api/shared';\n\n// Hey API\nexport const clientAiohttp = pluginHelper('@hey-api/client-aiohttp');\nexport const clientHttpx = pluginHelper('@hey-api/client-httpx');\nexport const clientRequests = pluginHelper('@hey-api/client-requests');\nexport const clientUrllib3 = pluginHelper('@hey-api/client-urllib3');\nexport const sdk = pluginHelper('@hey-api/python-sdk');\n// Other\nexport const pydantic = pluginHelper('pydantic');\n"],"mappings":";;;;;;;;;;;AAGA,MAAa,gBAAgB,aAAa,yBAAyB;AACnE,MAAa,cAAc,aAAa,uBAAuB;AAC/D,MAAa,iBAAiB,aAAa,0BAA0B;AACrE,MAAa,gBAAgB,aAAa,yBAAyB;AACnE,MAAa,MAAM,aAAa,qBAAqB;AAErD,MAAa,WAAW,aAAa,UAAU"}
|
|
@@ -10,6 +10,6 @@ var __exportAll = (all, no_symbols) => {
|
|
|
10
10
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
11
|
return target;
|
|
12
12
|
};
|
|
13
|
-
var __require = /*
|
|
13
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
14
14
|
//#endregion
|
|
15
15
|
export { __require as n, __exportAll as t };
|
package/dist/run.mjs
CHANGED
|
@@ -1,54 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { f as createClient } from "./src-
|
|
3
|
-
import {
|
|
4
|
-
import { Command, CommanderError } from "commander";
|
|
2
|
+
import { f as createClient } from "./src-D2qiV4Jp.mjs";
|
|
3
|
+
import { runCli } from "@hey-api/codegen-cli";
|
|
5
4
|
//#region package.json
|
|
6
|
-
var version = "0.0.0-next-
|
|
7
|
-
var bin = { "openapi-python": "./bin/run.js" };
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/cli/adapter.ts
|
|
10
|
-
function cliToConfig(cli) {
|
|
11
|
-
const config = {};
|
|
12
|
-
if (cli.input) config.input = cli.input;
|
|
13
|
-
if (cli.output) config.output = cli.output;
|
|
14
|
-
if (cli.file) config.configFile = cli.file;
|
|
15
|
-
if (cli.dryRun !== void 0) config.dryRun = cli.dryRun;
|
|
16
|
-
const plugins = [];
|
|
17
|
-
if (cli.plugins instanceof Array && cli.plugins.length) plugins.push(...cli.plugins);
|
|
18
|
-
if (plugins.length) config.plugins = plugins;
|
|
19
|
-
if (cli.debug || cli.silent || cli.logs || cli.logFile !== void 0) config.logs = {
|
|
20
|
-
...cli.logs && { path: cli.logs },
|
|
21
|
-
...cli.debug && { level: "debug" },
|
|
22
|
-
...cli.silent && { level: "silent" },
|
|
23
|
-
...cli.logFile !== void 0 && { file: cli.logFile }
|
|
24
|
-
};
|
|
25
|
-
if (cli.watch !== void 0) if (typeof cli.watch === "string") config.watch = Number.parseInt(cli.watch, 10);
|
|
26
|
-
else config.watch = cli.watch;
|
|
27
|
-
return config;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/cli/index.ts
|
|
31
|
-
const binName = Object.keys(bin)[0];
|
|
32
|
-
const program = new Command().name(binName).description("Generate Python code from OpenAPI specifications").version(isEnvironment("development") ? "[DEVELOPMENT]" : version);
|
|
33
|
-
program.option("-i, --input <path...>", "OpenAPI specification (path, URL, or string)").option("-o, --output <path...>", "Output folder(s)").option("-c, --client <name>", "HTTP client to generate").option("-p, --plugins [names...]", "Plugins to use").option("-f, --file <path>", "Path to config file").option("-d, --debug", "Enable debug logging").option("-s, --silent", "Suppress all output").option("-l, --logs <path>", "Logs folder path").option("--no-log-file", "Disable log file output").option("--dry-run", "Skip writing files").option("-w, --watch [interval]", "Watch for changes").action(async (options) => {
|
|
34
|
-
if (!(await createClient(cliToConfig(options)))[0]?.config.input.some((input) => input.watch?.enabled)) process.exit(0);
|
|
35
|
-
});
|
|
36
|
-
async function runCli() {
|
|
37
|
-
try {
|
|
38
|
-
await program.parseAsync(process.argv);
|
|
39
|
-
} catch (error) {
|
|
40
|
-
if (error instanceof CommanderError && "code" in error) {
|
|
41
|
-
if (error.code === "commander.optionMissingArgument") console.error(`\nMissing required argument. Run '${binName} --help' for usage.\n`);
|
|
42
|
-
else if (error.code === "commander.unknownOption") console.error(`\nUnknown option. Run '${binName} --help' for available options.\n`);
|
|
43
|
-
process.exit(error.exitCode);
|
|
44
|
-
}
|
|
45
|
-
console.error("Unexpected error:", error);
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
5
|
+
var version = "0.0.0-next-20260623210047";
|
|
49
6
|
//#endregion
|
|
50
7
|
//#region src/run.ts
|
|
51
|
-
|
|
8
|
+
const binName = Object.keys({ "openapi-python": "./bin/run.js" })[0];
|
|
9
|
+
runCli({
|
|
10
|
+
createClient,
|
|
11
|
+
meta: {
|
|
12
|
+
description: "Generate Python code from OpenAPI specifications",
|
|
13
|
+
name: binName,
|
|
14
|
+
version
|
|
15
|
+
}
|
|
16
|
+
});
|
|
52
17
|
//#endregion
|
|
53
18
|
export {};
|
|
54
19
|
|
package/dist/run.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.mjs","names":["pkg.bin","pkg.version"],"sources":["../package.json","../src/
|
|
1
|
+
{"version":3,"file":"run.mjs","names":["pkg.bin","pkg.version"],"sources":["../package.json","../src/run.ts"],"sourcesContent":["","#!/usr/bin/env node\n\nimport { runCli } from '@hey-api/codegen-cli';\n\nimport pkg from '../package.json';\nimport { createClient } from './index';\n\nconst binName = Object.keys(pkg.bin)[0]!;\n\nrunCli({\n createClient,\n meta: {\n description: 'Generate Python code from OpenAPI specifications',\n name: binName,\n version: pkg.version,\n },\n});\n"],"mappings":";;;;;;;ACOA,MAAM,UAAU,OAAO,KAAKA,mCAAAA,CAAO,CAAC,CAAC;AAErC,OAAO;CACL;CACA,MAAM;EACJ,aAAa;EACb,MAAM;EACGC;CACX;AACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __require } from "./
|
|
1
|
+
import { n as __require } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import "./plugins.mjs";
|
|
3
3
|
import { Logger, Logger as Logger$1, Project, StructureModel, Version, detectInteractiveSession, fromRef, isNode, isRef, isSymbol, loadConfigFile, nodeBrand, ref } from "@hey-api/codegen-core";
|
|
4
4
|
import { ConfigError, ConfigValidationError, Context, InputError, IntentContext, JobError, OperationPath, OperationPath as OperationPath$1, OperationStrategy, OperationStrategy as OperationStrategy$1, SymbolFactory, applyNaming, applyNaming as applyNaming$1, buildGraph, buildSymbolIn, checkNodeVersion, childContext, coerce, coerce as coerce$1, compileInputPath, createSchemaProcessor, createSchemaWalker, deduplicateSchema, defaultPaginationKeywords, defineConfig, defineConfig as defineConfigTable, definePluginConfig, definePluginConfig as definePluginConfig$1, ensureDirSync, escapeComment, getInput, getInputError, getLogs, getParser, getSpec, isEnvironment, logCrashReport, logInputPaths, openGitHubIssueWithCrashReport, operationResponsesMap, outputHeaderToPrefix, parseOpenApiSpec, patchOpenApiSpec, pathToJsonPointer, pathToName, postprocessOutput, printCliIntro, printCrashReport, refToName, resolvePlugins, shouldReportCrash, sourceConfig, toCase, toCase as toCase$1, utils } from "@hey-api/shared";
|
|
@@ -49,20 +49,60 @@ function expandToJobs(configs) {
|
|
|
49
49
|
return jobs;
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
|
+
//#region src/plugins/@hey-api/client-core/config.ts
|
|
53
|
+
const clientDefaultConfig = {
|
|
54
|
+
baseUrl: true,
|
|
55
|
+
bundle: true,
|
|
56
|
+
includeInEntry: false
|
|
57
|
+
};
|
|
58
|
+
const clientDefaultMeta = { tags: ["client"] };
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/plugins/@hey-api/client-aiohttp/config.ts
|
|
61
|
+
const defaultConfig$5 = {
|
|
62
|
+
...clientDefaultMeta,
|
|
63
|
+
config: clientDefaultConfig,
|
|
64
|
+
handler() {},
|
|
65
|
+
name: "@hey-api/client-aiohttp",
|
|
66
|
+
symbolMeta() {
|
|
67
|
+
return { artifact: "client" };
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
definePluginConfig(defaultConfig$5);
|
|
71
|
+
//#endregion
|
|
52
72
|
//#region src/plugins/@hey-api/client-httpx/config.ts
|
|
53
|
-
const defaultConfig$
|
|
54
|
-
|
|
55
|
-
config:
|
|
56
|
-
baseUrl: true,
|
|
57
|
-
bundle: true,
|
|
58
|
-
includeInEntry: false
|
|
59
|
-
},
|
|
73
|
+
const defaultConfig$4 = {
|
|
74
|
+
...clientDefaultMeta,
|
|
75
|
+
config: clientDefaultConfig,
|
|
60
76
|
handler() {},
|
|
61
77
|
name: "@hey-api/client-httpx",
|
|
62
78
|
symbolMeta() {
|
|
63
79
|
return { artifact: "client" };
|
|
64
80
|
}
|
|
65
81
|
};
|
|
82
|
+
definePluginConfig(defaultConfig$4);
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/plugins/@hey-api/client-requests/config.ts
|
|
85
|
+
const defaultConfig$3 = {
|
|
86
|
+
...clientDefaultMeta,
|
|
87
|
+
config: clientDefaultConfig,
|
|
88
|
+
handler() {},
|
|
89
|
+
name: "@hey-api/client-requests",
|
|
90
|
+
symbolMeta() {
|
|
91
|
+
return { artifact: "client" };
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
definePluginConfig(defaultConfig$3);
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/plugins/@hey-api/client-urllib3/config.ts
|
|
97
|
+
const defaultConfig$2 = {
|
|
98
|
+
...clientDefaultMeta,
|
|
99
|
+
config: clientDefaultConfig,
|
|
100
|
+
handler() {},
|
|
101
|
+
name: "@hey-api/client-urllib3",
|
|
102
|
+
symbolMeta() {
|
|
103
|
+
return { artifact: "client" };
|
|
104
|
+
}
|
|
105
|
+
};
|
|
66
106
|
definePluginConfig(defaultConfig$2);
|
|
67
107
|
//#endregion
|
|
68
108
|
//#region src/config/utils.ts
|
|
@@ -2009,7 +2049,7 @@ var StmtPyDsl = class extends Mixed$33 {
|
|
|
2009
2049
|
};
|
|
2010
2050
|
/** Checks whether a Python AST node is a statement. */
|
|
2011
2051
|
function isStatement(node) {
|
|
2012
|
-
return new Set([
|
|
2052
|
+
return (/* @__PURE__ */ new Set([
|
|
2013
2053
|
py.PyNodeKind.Assignment,
|
|
2014
2054
|
py.PyNodeKind.AugmentedAssignment,
|
|
2015
2055
|
py.PyNodeKind.Block,
|
|
@@ -2028,7 +2068,7 @@ function isStatement(node) {
|
|
|
2028
2068
|
py.PyNodeKind.TryStatement,
|
|
2029
2069
|
py.PyNodeKind.WhileStatement,
|
|
2030
2070
|
py.PyNodeKind.WithStatement
|
|
2031
|
-
]).has(node.kind);
|
|
2071
|
+
])).has(node.kind);
|
|
2032
2072
|
}
|
|
2033
2073
|
//#endregion
|
|
2034
2074
|
//#region src/py-dsl/mixins/do.ts
|
|
@@ -3479,7 +3519,7 @@ const printer = py.createPrinter({ indentSize: 4 });
|
|
|
3479
3519
|
function astToString(node) {
|
|
3480
3520
|
return printer.printFile(node);
|
|
3481
3521
|
}
|
|
3482
|
-
const pythonStdlib = new Set([
|
|
3522
|
+
const pythonStdlib = /* @__PURE__ */ new Set([
|
|
3483
3523
|
"abc",
|
|
3484
3524
|
"aifc",
|
|
3485
3525
|
"antigravity",
|
|
@@ -6336,7 +6376,10 @@ definePluginConfig(defaultConfig);
|
|
|
6336
6376
|
*/
|
|
6337
6377
|
const defaultPlugins = ["@hey-api/python-sdk"];
|
|
6338
6378
|
const defaultPluginConfigs = {
|
|
6339
|
-
"@hey-api/client-
|
|
6379
|
+
"@hey-api/client-aiohttp": defaultConfig$5,
|
|
6380
|
+
"@hey-api/client-httpx": defaultConfig$4,
|
|
6381
|
+
"@hey-api/client-requests": defaultConfig$3,
|
|
6382
|
+
"@hey-api/client-urllib3": defaultConfig$2,
|
|
6340
6383
|
"@hey-api/python-sdk": defaultConfig$1,
|
|
6341
6384
|
pydantic: defaultConfig
|
|
6342
6385
|
};
|
|
@@ -6766,6 +6809,6 @@ async function defineConfig$1(config) {
|
|
|
6766
6809
|
return typeof config === "function" ? await config() : config;
|
|
6767
6810
|
}
|
|
6768
6811
|
//#endregion
|
|
6769
|
-
export { coerce$1 as a, defineConfigTable as c, utils as d, createClient as f, applyNaming$1 as i, definePluginConfig$1 as l, OperationPath$1 as n, defaultPaginationKeywords as o, defaultPlugins as p, OperationStrategy$1 as r, defineConfig$1 as s, Logger$1 as t, toCase$1 as u };
|
|
6812
|
+
export { PyDsl as S, reserved as _, coerce$1 as a, PyDslContext as b, defineConfigTable as c, utils as d, createClient as f, KwargPyDsl as g, PythonRenderer as h, applyNaming$1 as i, definePluginConfig$1 as l, $$1 as m, OperationPath$1 as n, defaultPaginationKeywords as o, defaultPlugins as p, OperationStrategy$1 as r, defineConfig$1 as s, Logger$1 as t, toCase$1 as u, keywords as v, ctx as x, regexp as y };
|
|
6770
6813
|
|
|
6771
|
-
//# sourceMappingURL=src-
|
|
6814
|
+
//# sourceMappingURL=src-D2qiV4Jp.mjs.map
|