@hey-api/openapi-python 0.0.23

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,172 @@
1
+ import { a as PydanticPlugin, c as HeyApiClientHttpxPlugin, n as plugins_d_exports, o as PydanticResolvers, s as HeyApiSdkPlugin } from "./plugins-BDUY2dP5.mjs";
2
+ import { Logger, Logger as Logger$1, Version } from "@hey-api/codegen-core";
3
+ import { AnyPluginName, BaseUserConfig, BaseUserOutput, Coercer, CoercerMap, ConfigTable, Context, DefinePlugin, IR, OpenApi, OpenApiMetaObject, OpenApiOperationObject, OpenApiParameterObject, OpenApiRequestBodyObject, OpenApiResponseObject, OpenApiSchemaObject, OperationPath, OperationStrategy, Plugin, Plugin as Plugin$1, PluginConfigMap, PluginContext, PluginInstance, PluginNames, SymbolFactory, TableDirectives, UserPostProcessor, applyNaming, coerce, defaultPaginationKeywords, defineConfig as defineConfigTable, definePluginConfig, toCase, utils } from "@hey-api/shared";
4
+ import { AnyString, LazyOrAsync, MaybeArray } from "@hey-api/types";
5
+
6
+ //#region src/config/output/postprocess.d.ts
7
+ declare const postProcessors: {
8
+ readonly autopep8: {
9
+ readonly args: readonly ["--in-place", "{{path}}"];
10
+ readonly command: "autopep8";
11
+ readonly name: "autopep8";
12
+ };
13
+ readonly black: {
14
+ readonly args: readonly ["{{path}}"];
15
+ readonly command: "black";
16
+ readonly name: "Black";
17
+ };
18
+ readonly isort: {
19
+ readonly args: readonly ["{{path}}"];
20
+ readonly command: "isort";
21
+ readonly name: "isort";
22
+ };
23
+ readonly 'ruff:format': {
24
+ readonly args: readonly ["format", "{{path}}"];
25
+ readonly command: "ruff";
26
+ readonly name: "Ruff (Format)";
27
+ };
28
+ readonly 'ruff:lint': {
29
+ readonly args: readonly ["check", "--fix", "{{path}}"];
30
+ readonly command: "ruff";
31
+ readonly name: "Ruff (Lint)";
32
+ };
33
+ readonly yapf: {
34
+ readonly args: readonly ["-i", "{{path}}"];
35
+ readonly command: "yapf";
36
+ readonly name: "YAPF";
37
+ };
38
+ };
39
+ type PostProcessorPreset = keyof typeof postProcessors;
40
+ //#endregion
41
+ //#region src/config/output/types.d.ts
42
+ type PythonVersion = '3.9' | '3.10' | '3.11' | '3.12' | '3.13' | '3.14';
43
+ type UserOutput = BaseUserOutput<'.py'> & {
44
+ /**
45
+ * Post-processing commands to run on the output folder, executed in order.
46
+ *
47
+ * Use preset strings for common tools, or provide custom configurations.
48
+ *
49
+ * @example ['ruff:lint', 'ruff:format']
50
+ * @example [{ command: 'flake8', args: ['{{path}}'] }]
51
+ *
52
+ * @default []
53
+ */
54
+ postProcess?: ReadonlyArray<PostProcessorPreset | UserPostProcessor>;
55
+ /**
56
+ * Whether `export * from 'module'` should be used when possible
57
+ * instead of named exports.
58
+ *
59
+ * @default false
60
+ */
61
+ preferExportAll?: boolean;
62
+ /**
63
+ * Minimum Python version to target.
64
+ *
65
+ * @default '3.9'
66
+ */
67
+ pythonVersion?: PythonVersion;
68
+ };
69
+ //#endregion
70
+ //#region src/config/types.d.ts
71
+ type UserConfig = BaseUserConfig<UserOutput> & {
72
+ /**
73
+ * Plugins generate artifacts from `input`. By default, we generate SDK
74
+ * functions and TypeScript interfaces. If you manually define `plugins`,
75
+ * you need to include the default plugins if you wish to use them.
76
+ *
77
+ * @default ['@hey-api/python-sdk']
78
+ */
79
+ plugins?: ReadonlyArray<PluginNames | { [K in PluginNames]: PluginConfigMap[K]['config'] & {
80
+ name: K;
81
+ } }[PluginNames]>;
82
+ };
83
+ //#endregion
84
+ //#region src/symbols/enum.d.ts
85
+ declare function ENUM(factory: SymbolFactory): {
86
+ Enum: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
87
+ IntEnum: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
88
+ StrEnum: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
89
+ };
90
+ type EnumSymbols = ReturnType<typeof ENUM>;
91
+ //#endregion
92
+ //#region src/symbols/typing.d.ts
93
+ declare function TYPING(factory: SymbolFactory): {
94
+ Annotated: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
95
+ Any: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
96
+ Literal: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
97
+ NoReturn: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
98
+ Optional: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
99
+ Tuple: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
100
+ TypeAlias: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
101
+ Union: import("@hey-api/codegen-core").Symbol<import("@hey-api/codegen-core").Node<unknown, import("@hey-api/codegen-core").Language>>;
102
+ };
103
+ type TypingSymbols = ReturnType<typeof TYPING>;
104
+ //#endregion
105
+ //#region src/generate.d.ts
106
+ /**
107
+ * Generate a client from the provided configuration.
108
+ *
109
+ * @param userConfig User provided {@link UserConfig} configuration(s).
110
+ */
111
+ declare function createClient(userConfig?: LazyOrAsync<MaybeArray<UserConfig>>, logger?: Logger$1): Promise<ReadonlyArray<Context>>;
112
+ //#endregion
113
+ //#region src/plugins/config.d.ts
114
+ /**
115
+ * Default plugins used to generate artifacts if plugins aren't specified.
116
+ */
117
+ declare const defaultPlugins: readonly ["@hey-api/python-sdk"];
118
+ //#endregion
119
+ //#region src/index.d.ts
120
+ declare module '@hey-api/codegen-core' {
121
+ interface ProjectMeta {
122
+ python: {
123
+ Version: Version<PythonVersion>;
124
+ symbols: {
125
+ enum: EnumSymbols;
126
+ typing: TypingSymbols;
127
+ };
128
+ version: PythonVersion;
129
+ };
130
+ }
131
+ interface SymbolMeta {
132
+ artifact?: 'pydantic' | 'sdk' | AnyString;
133
+ category?: 'client' | 'external' | 'hook' | 'schema' | 'sdk' | 'transform' | 'type' | 'utility' | AnyString;
134
+ /** Path to the resource this symbol represents. */
135
+ path?: ReadonlyArray<string | number>;
136
+ /** Name of the plugin that registered this symbol. */
137
+ plugin?: string;
138
+ resource?: 'client' | 'definition' | 'operation' | 'webhook' | AnyString;
139
+ resourceId?: string;
140
+ role?: 'data' | 'error' | 'errors' | 'options' | 'response' | 'responses' | AnyString;
141
+ /** Tags associated with this symbol. */
142
+ tags?: ReadonlyArray<string>;
143
+ variant?: 'container' | AnyString;
144
+ }
145
+ }
146
+ declare module '@hey-api/shared' {
147
+ interface PluginConfigMap {
148
+ '@hey-api/client-httpx': Plugins.HeyApiClientHttpx.Types['Types'];
149
+ '@hey-api/python-sdk': Plugins.HeyApiSdk.Types['Types'];
150
+ pydantic: Plugins.Pydantic.Types['Types'];
151
+ }
152
+ }
153
+ /**
154
+ * Type helper for configuration object, returns {@link MaybeArray<UserConfig>} object(s)
155
+ */
156
+ declare function defineConfig(config: LazyOrAsync<ReadonlyArray<UserConfig>>): Promise<ReadonlyArray<UserConfig>>;
157
+ declare function defineConfig(config: LazyOrAsync<UserConfig>): Promise<UserConfig>;
158
+ declare namespace Plugins {
159
+ namespace HeyApiClientHttpx {
160
+ type Types = HeyApiClientHttpxPlugin;
161
+ }
162
+ namespace HeyApiSdk {
163
+ type Types = HeyApiSdkPlugin;
164
+ }
165
+ namespace Pydantic {
166
+ type Resolvers = Required<PydanticResolvers>['$resolvers'];
167
+ type Types = PydanticPlugin;
168
+ }
169
+ }
170
+ //#endregion
171
+ export { type AnyPluginName, type Coercer, type CoercerMap, type ConfigTable, type DefinePlugin, type IR, Logger, type OpenApi, type OpenApiMetaObject, type OpenApiOperationObject, type OpenApiParameterObject, type OpenApiRequestBodyObject, type OpenApiResponseObject, type OpenApiSchemaObject, OperationPath, OperationStrategy, type Plugin, type PluginContext, type PluginInstance, Plugins, type TableDirectives, type UserConfig, applyNaming, coerce, createClient, defaultPaginationKeywords, defaultPlugins, defineConfig, defineConfigTable, definePluginConfig, plugins_d_exports as plugins, toCase, utils };
172
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/config/output/postprocess.ts","../src/config/output/types.ts","../src/config/types.ts","../src/symbols/enum.ts","../src/symbols/typing.ts","../src/generate.ts","../src/plugins/config.ts","../src/index.ts"],"mappings":";;;;;;cAEa,cAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCD,mBAAA,gBAAmC,cAAc;;;KC/BjD,aAAA;AAAA,KAEA,UAAA,GAAa,cAAA;;;ADJzB;;;;;;;;ECeE,WAAA,GAAc,aAAA,CAAc,mBAAA,GAAsB,iBAAA;;;;;;;EAOlD,eAAA;;;;;;EAMA,aAAA,GAAgB,aAAA;AAAA;;;KCpBN,UAAA,GAAa,cAAA,CAAe,UAAA;;;;AFRxC;;;;EEgBE,OAAA,GAAU,aAAA,CACN,WAAA,WAEQ,WAAA,GAAc,eAAA,CAAgB,CAAA;IAClC,IAAA,EAAM,CAAA;EAAA,IAER,WAAA;AAAA;;;iBCtBQ,IAAA,CAAK,OAAA,EAAS,aAAa;;;;;KAQ/B,WAAA,GAAc,UAAU,QAAQ,IAAA;;;iBCR5B,MAAA,CAAO,OAAA,EAAS,aAAa;;;;;;;;;;KAajC,aAAA,GAAgB,UAAU,QAAQ,MAAA;;;;;AJb9C;;;iBK8BsB,YAAA,CACpB,UAAA,GAAa,WAAA,CAAY,UAAA,CAAW,UAAA,IACpC,MAAA,GAAM,QAAA,GACL,OAAA,CAAQ,aAAA,CAAc,OAAA;;;;;;cC1BZ,cAAA;;;;YCFD,WAAA;IACR,MAAA;MACE,OAAA,EAAS,OAAA,CAAQ,aAAA;MACjB,OAAA;QACE,IAAA,EAAM,WAAA;QACN,MAAA,EAAQ,aAAA;MAAA;MAEV,OAAA,EAAS,aAAA;IAAA;EAAA;EAAA,UAIH,UAAA;IACR,QAAA,wBAAgC,SAAA;IAChC,QAAA,0FASI,SAAA;;IAEJ,IAAA,GAAO,aAAA;;IAEP,MAAA;IACA,QAAA,uDAA+D,SAAA;IAC/D,UAAA;IACA,IAAA,wEAA4E,SAAA;;IAE5E,IAAA,GAAO,aAAA;IACP,OAAA,iBAAwB,SAAA;EAAA;AAAA;AAAA;EAAA,UAKhB,eAAA;IACR,uBAAA,EAAyB,OAAA,CAAQ,iBAAA,CAAkB,KAAA;IACnD,qBAAA,EAAuB,OAAA,CAAQ,SAAA,CAAU,KAAA;IACzC,QAAA,EAAU,OAAA,CAAQ,QAAA,CAAS,KAAA;EAAA;AAAA;;;;iBA0Bf,YAAA,CACd,MAAA,EAAQ,WAAA,CAAY,aAAA,CAAc,UAAA,KACjC,OAAA,CAAQ,aAAA,CAAc,UAAA;AAAA,iBACT,YAAA,CAAa,MAAA,EAAQ,WAAA,CAAY,UAAA,IAAc,OAAA,CAAQ,UAAA;AAAA,kBA0CtD,OAAA;EAAA,UACE,iBAAA;IAAA,KACH,KAAA,GAAQ,uBAAA;EAAA;EAAA,UAGL,SAAA;IAAA,KACH,KAAA,GAAQ,eAAA;EAAA;EAAA,UAGL,QAAA;IAAA,KACH,SAAA,GAAY,QAAA,CAAS,iBAAA;IAAA,KACrB,KAAA,GAAQ,cAAA;EAAA;AAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +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-DaXm5pxY.mjs";
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 };