@codewithagents/openapi-server 1.4.0 → 1.6.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/dist/cli-args.d.ts +2 -13
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +3 -26
- package/dist/cli-args.js.map +1 -1
- package/dist/cli.cjs +1787 -1730
- package/dist/config.d.ts +2 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +27 -105
- package/dist/config.js.map +1 -1
- package/package.json +7 -4
package/dist/cli-args.d.ts
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export type CliAction
|
|
3
|
-
action: 'help';
|
|
4
|
-
} | {
|
|
5
|
-
action: 'version';
|
|
6
|
-
} | {
|
|
7
|
-
action: 'run';
|
|
8
|
-
configFile?: string;
|
|
9
|
-
cwd: string;
|
|
10
|
-
} | {
|
|
11
|
-
action: 'error';
|
|
12
|
-
message: string;
|
|
13
|
-
};
|
|
1
|
+
import { type CliAction } from '@codewithagents/openapi-gen/cli-core';
|
|
2
|
+
export type { CliAction };
|
|
14
3
|
/**
|
|
15
4
|
* Parse raw process.argv into a structured action.
|
|
16
5
|
*
|
package/dist/cli-args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,sCAAsC,CAAA;AAEvF,YAAY,EAAE,SAAS,EAAE,CAAA;AAIzB;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAEnE"}
|
package/dist/cli-args.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseBaseCliArgs } from '@codewithagents/openapi-gen/cli-core';
|
|
2
|
+
const USAGE = 'Usage: openapi-server [--config <path-to-config.json>]';
|
|
2
3
|
/**
|
|
3
4
|
* Parse raw process.argv into a structured action.
|
|
4
5
|
*
|
|
@@ -8,30 +9,6 @@ import { resolve, dirname } from 'node:path';
|
|
|
8
9
|
* @param cwd the working directory to resolve paths against
|
|
9
10
|
*/
|
|
10
11
|
export function parseCliArgs(argv, cwd) {
|
|
11
|
-
|
|
12
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
13
|
-
return { action: 'help' };
|
|
14
|
-
}
|
|
15
|
-
if (args.includes('--version') || args.includes('-v')) {
|
|
16
|
-
return { action: 'version' };
|
|
17
|
-
}
|
|
18
|
-
const configIdx = args.indexOf('--config');
|
|
19
|
-
if (configIdx !== -1) {
|
|
20
|
-
const next = args[configIdx + 1];
|
|
21
|
-
if (next === undefined || next.startsWith('--')) {
|
|
22
|
-
return {
|
|
23
|
-
action: 'error',
|
|
24
|
-
message: [
|
|
25
|
-
'Error: --config requires a file path argument',
|
|
26
|
-
'Usage: openapi-server [--config <path-to-config.json>]',
|
|
27
|
-
].join('\n'),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
const configFile = resolve(cwd, next);
|
|
31
|
-
// Relative paths inside the config resolve from the config file's directory,
|
|
32
|
-
// not from the shell's CWD. This matches how most tooling works.
|
|
33
|
-
return { action: 'run', configFile, cwd: dirname(configFile) };
|
|
34
|
-
}
|
|
35
|
-
return { action: 'run', cwd };
|
|
12
|
+
return parseBaseCliArgs(argv, cwd, USAGE);
|
|
36
13
|
}
|
|
37
14
|
//# sourceMappingURL=cli-args.js.map
|
package/dist/cli-args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAIvF,MAAM,KAAK,GAAG,wDAAwD,CAAA;AAEtE;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,IAAc,EAAE,GAAW;IACtD,OAAO,gBAAgB,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC"}
|