Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mock-backend
dist
# dist
.rpt2_cache

### macOS ###
Expand Down
1 change: 1 addition & 0 deletions dist/bin/orval.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/usr/bin/env node
96 changes: 96 additions & 0 deletions dist/bin/orval.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/usr/bin/env node
'use strict';
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
('use strict');
var _chunkHZNVPLTOjs = require('../chunk-HZNVPLTO.js');
_chunkHZNVPLTOjs.b.call(void 0);
var _cac = require('cac');
var _chalk = require('chalk');
var _chalk2 = _interopRequireDefault(_chalk);
var o = _cac.cac.call(void 0, 'orval');
_chunkHZNVPLTOjs.e.call(void 0, {
name: _chunkHZNVPLTOjs.a.name,
version: _chunkHZNVPLTOjs.a.version,
description: _chunkHZNVPLTOjs.a.description,
});
o.version(_chunkHZNVPLTOjs.a.version);
o.command(
'[config]',
'generate client with appropriate type-signatures from OpenAPI specs',
{ ignoreOptionDefaultValue: !0 },
)
.option('-o, --output <path>', 'output file destination')
.option('-i, --input <path>', 'input file (yaml or json openapi specs)')
.option('-c, --config <path>', 'override flags by a config file')
.option('-p, --project <name>', 'focus a project of the config')
.option('-m, --mode <name>', 'default mode that will be used')
.option('-c, --client <name>', 'default client that will be used')
.option('--mock', 'activate the mock')
.option(
'-w, --watch [path]',
'Watch mode, if path is not specified, it watches the input target',
)
.option('--clean [path]', 'Clean output directory')
.option('--prettier [path]', 'Prettier generated files')
.option('--tslint [path]', 'tslint generated files')
.option('--tsconfig [path]', 'path to your tsconfig file')
.action(async (m, t) => {
if (
_chunkHZNVPLTOjs.c.call(void 0, t.input) &&
_chunkHZNVPLTOjs.c.call(void 0, t.output)
) {
let i = await _chunkHZNVPLTOjs.H.call(void 0, {
input: t.input,
output: {
target: t.output,
clean: t.clean,
prettier: t.prettier,
tslint: t.tslint,
mock: t.mock,
client: t.client,
mode: t.mode,
tsconfig: t.tsconfig,
},
});
if (t.watch)
_chunkHZNVPLTOjs.K.call(
void 0,
t.watch,
async () => {
try {
await _chunkHZNVPLTOjs.L.call(void 0, process.cwd(), i);
} catch (n) {
_chunkHZNVPLTOjs.d.call(
void 0,
_chalk2.default.red(`\u{1F6D1} ${n}`),
);
}
},
i.input.target,
);
else
try {
await _chunkHZNVPLTOjs.L.call(void 0, process.cwd(), i);
} catch (n) {
_chunkHZNVPLTOjs.d.call(
void 0,
_chalk2.default.red(`\u{1F6D1} ${n}`),
);
}
} else
await _chunkHZNVPLTOjs.M.call(void 0, t.config, {
projectName: t.project,
watch: t.watch,
clean: t.clean,
prettier: t.prettier,
tslint: t.tslint,
mock: t.mock,
client: t.client,
mode: t.mode,
tsconfig: t.tsconfig,
});
});
o.help();
o.parse(process.argv);
Loading