@hey-api/openapi-ts 0.53.11 → 0.54.0
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 +1 -0
- package/bin/index.cjs +23 -15
- package/dist/index.cjs +189 -187
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1807 -1261
- package/dist/index.d.ts +1807 -1261
- package/dist/index.js +183 -181
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
- supports both JSON and YAML input files
|
|
14
14
|
- generates TypeScript interfaces, REST clients, and JSON Schemas
|
|
15
15
|
- Fetch API, Axios, Angular, Node.js, and XHR clients available
|
|
16
|
+
- plugin ecosystem to reduce third-party boilerplate
|
|
16
17
|
|
|
17
18
|
## Documentation
|
|
18
19
|
|
package/bin/index.cjs
CHANGED
|
@@ -12,29 +12,34 @@ const params = program
|
|
|
12
12
|
.name(Object.keys(pkg.bin)[0])
|
|
13
13
|
.usage('[options]')
|
|
14
14
|
.version(pkg.version)
|
|
15
|
-
.option(
|
|
16
|
-
'--base [value]',
|
|
17
|
-
'Manually set base in OpenAPI config instead of inferring from server value',
|
|
18
|
-
)
|
|
19
15
|
.option(
|
|
20
16
|
'-c, --client <value>',
|
|
21
17
|
'HTTP client to generate [@hey-api/client-axios, @hey-api/client-fetch, legacy/angular, legacy/axios, legacy/fetch, legacy/node, legacy/xhr]',
|
|
22
18
|
)
|
|
23
19
|
.option('-d, --debug', 'Run in debug mode?')
|
|
24
20
|
.option('--dry-run [value]', 'Skip writing files to disk?')
|
|
25
|
-
.option(
|
|
21
|
+
.option(
|
|
22
|
+
'-e, --experimental-parser [value]',
|
|
23
|
+
'Opt-in to the experimental parser?',
|
|
24
|
+
)
|
|
26
25
|
.option('-f, --file [value]', 'Path to the config file')
|
|
27
26
|
.option(
|
|
28
27
|
'-i, --input <value>',
|
|
29
28
|
'OpenAPI specification (path, url, or string content)',
|
|
30
29
|
)
|
|
31
|
-
.option('--
|
|
32
|
-
.option('-
|
|
33
|
-
.option(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.option('--
|
|
30
|
+
.option('-o, --output <value>', 'Output folder')
|
|
31
|
+
.option('-p, --plugins [value...]', "List of plugins you'd like to use")
|
|
32
|
+
.option(
|
|
33
|
+
'--base [value]',
|
|
34
|
+
'DEPRECATED. Manually set base in OpenAPI config instead of inferring from server value',
|
|
35
|
+
)
|
|
36
|
+
.option('--exportCore [value]', 'DEPRECATED. Write core files to disk')
|
|
37
|
+
.option('--name <value>', 'DEPRECATED. Custom client class name')
|
|
38
|
+
.option('--request <value>', 'DEPRECATED. Path to custom request file')
|
|
39
|
+
.option(
|
|
40
|
+
'--useOptions [value]',
|
|
41
|
+
'DEPRECATED. Use options instead of arguments?',
|
|
42
|
+
)
|
|
38
43
|
.parse(process.argv)
|
|
39
44
|
.opts();
|
|
40
45
|
|
|
@@ -69,12 +74,15 @@ async function start() {
|
|
|
69
74
|
const { createClient } = require(resolve(__dirname, '../dist/index.cjs'));
|
|
70
75
|
userConfig = processParams(params, [
|
|
71
76
|
'dryRun',
|
|
77
|
+
'experimentalParser',
|
|
72
78
|
'exportCore',
|
|
73
|
-
'schemas',
|
|
74
|
-
'services',
|
|
75
|
-
'types',
|
|
76
79
|
'useOptions',
|
|
77
80
|
]);
|
|
81
|
+
if (params.plugins === true) {
|
|
82
|
+
userConfig.plugins = [];
|
|
83
|
+
} else if (params.plugins) {
|
|
84
|
+
userConfig.plugins = params.plugins;
|
|
85
|
+
}
|
|
78
86
|
await createClient(userConfig);
|
|
79
87
|
process.exit(0);
|
|
80
88
|
} catch (error) {
|