@hey-api/openapi-ts 0.86.3 → 0.86.5

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.
Files changed (41) hide show
  1. package/bin/run.cmd +3 -0
  2. package/bin/run.js +18 -0
  3. package/dist/clients/angular/utils.ts +9 -8
  4. package/dist/clients/axios/utils.ts +9 -8
  5. package/dist/clients/core/bodySerializer.ts +12 -4
  6. package/dist/clients/fetch/utils.ts +9 -8
  7. package/dist/clients/next/utils.ts +9 -8
  8. package/dist/clients/nuxt/utils.ts +9 -8
  9. package/dist/clients/ofetch/utils.ts +9 -8
  10. package/dist/getSpec-CdBgV-sm.js +24 -0
  11. package/dist/getSpec-CdBgV-sm.js.map +1 -0
  12. package/dist/getSpec-y1q2Fa6c.cjs +24 -0
  13. package/dist/getSpec-y1q2Fa6c.cjs.map +1 -0
  14. package/dist/index.cjs +1 -1318
  15. package/dist/index.d.cts +1217 -11
  16. package/dist/index.d.ts +1219 -11
  17. package/dist/index.js +1 -1310
  18. package/dist/internal.cjs +1 -1
  19. package/dist/internal.d.cts +1 -1
  20. package/dist/internal.d.ts +1 -1
  21. package/dist/internal.js +1 -1
  22. package/dist/run.cjs +3 -0
  23. package/dist/run.cjs.map +1 -0
  24. package/dist/run.d.cts +1 -0
  25. package/dist/run.d.ts +1 -0
  26. package/dist/run.js +3 -0
  27. package/dist/run.js.map +1 -0
  28. package/dist/src-DxujYdu0.cjs +1318 -0
  29. package/dist/src-DxujYdu0.cjs.map +1 -0
  30. package/dist/src-SnUobB4f.js +1310 -0
  31. package/dist/src-SnUobB4f.js.map +1 -0
  32. package/dist/{types-TTJZ61ck.d.ts → types-7_tn_FD9.d.ts} +7674 -8802
  33. package/dist/{types-CBGf9bNY.d.cts → types-ComCm5zo.d.cts} +7674 -8802
  34. package/package.json +3 -3
  35. package/bin/index.cjs +0 -148
  36. package/dist/getSpec-DhkA7wWv.cjs +0 -24
  37. package/dist/getSpec-DhkA7wWv.cjs.map +0 -1
  38. package/dist/getSpec-DzntayfV.js +0 -24
  39. package/dist/getSpec-DzntayfV.js.map +0 -1
  40. package/dist/index.cjs.map +0 -1
  41. package/dist/index.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hey-api/openapi-ts",
3
- "version": "0.86.3",
3
+ "version": "0.86.5",
4
4
  "description": "🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.",
5
5
  "homepage": "https://heyapi.dev/",
6
6
  "repository": {
@@ -66,7 +66,7 @@
66
66
  "./package.json": "./package.json"
67
67
  },
68
68
  "bin": {
69
- "openapi-ts": "bin/index.cjs"
69
+ "openapi-ts": "./bin/run.js"
70
70
  },
71
71
  "files": [
72
72
  "bin",
@@ -99,7 +99,7 @@
99
99
  "@angular/platform-browser": "19.2.15",
100
100
  "@angular/platform-browser-dynamic": "19.2.15",
101
101
  "@angular/router": "19.2.15",
102
- "@types/bun": "1.2.23",
102
+ "@types/bun": "1.3.0",
103
103
  "@types/cross-spawn": "6.0.6",
104
104
  "@types/semver": "7.7.1",
105
105
  "axios": "1.8.2",
package/bin/index.cjs DELETED
@@ -1,148 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- 'use strict';
4
-
5
- const path = require('path');
6
-
7
- const { program } = require('commander');
8
- const pkg = require('../package.json');
9
-
10
- const params = program
11
- .name(Object.keys(pkg.bin)[0])
12
- .usage('[options]')
13
- .version(pkg.version)
14
- .option(
15
- '-c, --client <value>',
16
- 'HTTP client to generate [@hey-api/client-axios, @hey-api/client-fetch, @hey-api/client-next, @hey-api/client-nuxt, legacy/angular, legacy/axios, legacy/fetch, legacy/node, legacy/xhr]',
17
- )
18
- .option('-d, --debug', 'Set log level to debug')
19
- .option('--dry-run [value]', 'Skip writing files to disk?')
20
- .option(
21
- '-e, --experimental-parser [value]',
22
- 'Opt-in to the experimental parser?',
23
- )
24
- .option('-f, --file [value]', 'Path to the config file')
25
- .option(
26
- '-i, --input <value>',
27
- 'OpenAPI specification (path, url, or string content)',
28
- )
29
- .option('-l, --logs [value]', 'Logs folder')
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('-s, --silent', 'Set log level to silent')
37
- .option(
38
- '--no-log-file',
39
- 'Disable writing a log file. Works like --silent but without suppressing console output',
40
- )
41
- .option(
42
- '-w, --watch [value]',
43
- 'Regenerate the client when the input file changes?',
44
- )
45
- .option('--exportCore [value]', 'DEPRECATED. Write core files to disk')
46
- .option('--name <value>', 'DEPRECATED. Custom client class name')
47
- .option('--request <value>', 'DEPRECATED. Path to custom request file')
48
- .option(
49
- '--useOptions [value]',
50
- 'DEPRECATED. Use options instead of arguments?',
51
- )
52
- .parse(process.argv)
53
- .opts();
54
-
55
- const stringToBoolean = (value) => {
56
- if (value === 'true') {
57
- return true;
58
- }
59
- if (value === 'false') {
60
- return false;
61
- }
62
- return value;
63
- };
64
-
65
- const processParams = (obj, booleanKeys) => {
66
- for (const key of booleanKeys) {
67
- const value = obj[key];
68
- if (typeof value === 'string') {
69
- const parsedValue = stringToBoolean(value);
70
- delete obj[key];
71
- obj[key] = parsedValue;
72
- }
73
- }
74
- if (obj.file) {
75
- obj.configFile = obj.file;
76
- }
77
- return obj;
78
- };
79
-
80
- async function start() {
81
- let userConfig;
82
-
83
- try {
84
- const { createClient } = require(
85
- path.resolve(__dirname, '../dist/index.cjs'),
86
- );
87
-
88
- userConfig = processParams(params, [
89
- 'dryRun',
90
- 'logFile',
91
- 'experimentalParser',
92
- 'exportCore',
93
- 'useOptions',
94
- ]);
95
-
96
- if (params.plugins === true) {
97
- userConfig.plugins = [];
98
- } else if (params.plugins) {
99
- userConfig.plugins = params.plugins;
100
- } else if (userConfig.client) {
101
- userConfig.plugins = ['@hey-api/typescript', '@hey-api/sdk'];
102
- }
103
-
104
- if (userConfig.client) {
105
- userConfig.plugins.push(userConfig.client);
106
- delete userConfig.client;
107
- }
108
-
109
- userConfig.logs = userConfig.logs
110
- ? {
111
- path: userConfig.logs,
112
- }
113
- : {};
114
-
115
- if (userConfig.debug || stringToBoolean(process.env.DEBUG)) {
116
- userConfig.logs.level = 'debug';
117
- } else if (userConfig.silent) {
118
- userConfig.logs.level = 'silent';
119
- }
120
-
121
- userConfig.logs.file = userConfig.logFile;
122
- delete userConfig.logFile;
123
-
124
- if (typeof params.watch === 'string') {
125
- userConfig.watch = Number.parseInt(params.watch, 10);
126
- }
127
-
128
- if (!Object.keys(userConfig.logs).length) {
129
- delete userConfig.logs;
130
- }
131
-
132
- const context = await createClient(userConfig);
133
- if (
134
- !context[0] ||
135
- !context[0].config ||
136
- !context[0].config.input ||
137
- !context[0].config.input.some(
138
- (input) => input.watch && input.watch.enabled,
139
- )
140
- ) {
141
- process.exit(0);
142
- }
143
- } catch {
144
- process.exit(1);
145
- }
146
- }
147
-
148
- start();