@workos/oagen 0.18.2 → 0.19.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/index.mjs +9 -3
- package/dist/cli/index.mjs.map +1 -1
- package/dist/{diff-JU1bdT5_.mjs → diff-BcQbWkj4.mjs} +5 -3
- package/dist/{diff-JU1bdT5_.mjs.map → diff-BcQbWkj4.mjs.map} +1 -1
- package/dist/index.d.mts +16 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/verify/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -4983,6 +4983,7 @@ function buildEmitterContext(spec, options) {
|
|
|
4983
4983
|
overlayLookup: options.overlayLookup,
|
|
4984
4984
|
resolvedOperations: resolveOperations(spec, options.operationHints, options.mountRules),
|
|
4985
4985
|
modelHints: options.modelHints,
|
|
4986
|
+
emitterOptions: options.emitterOptions,
|
|
4986
4987
|
targetDir: options.target,
|
|
4987
4988
|
priorTargetManifestPaths: options.priorTargetManifestPaths
|
|
4988
4989
|
};
|
|
@@ -5421,8 +5422,9 @@ async function removeEmptyParents(startDir, stopDir) {
|
|
|
5421
5422
|
//#endregion
|
|
5422
5423
|
//#region src/engine/orchestrator.ts
|
|
5423
5424
|
async function generate(spec, emitter, options) {
|
|
5425
|
+
const outputPrevManifestForCtx = options.noPrune ? null : await readManifest(options.outputDir);
|
|
5424
5426
|
const targetManifestForCtx = options.target && !options.noPrune ? await readManifest(options.target) : null;
|
|
5425
|
-
const priorTargetManifestPaths = targetManifestForCtx ? new Set(targetManifestForCtx.files) : void 0;
|
|
5427
|
+
const priorTargetManifestPaths = targetManifestForCtx ? new Set(targetManifestForCtx.files) : outputPrevManifestForCtx ? new Set(outputPrevManifestForCtx.files) : void 0;
|
|
5426
5428
|
const { files: withHeaders, header, operations } = generateFiles(spec, emitter, {
|
|
5427
5429
|
...options,
|
|
5428
5430
|
priorTargetManifestPaths
|
|
@@ -5434,7 +5436,7 @@ async function generate(spec, emitter, options) {
|
|
|
5434
5436
|
}
|
|
5435
5437
|
return withHeaders;
|
|
5436
5438
|
}
|
|
5437
|
-
const outputPrevManifest =
|
|
5439
|
+
const outputPrevManifest = outputPrevManifestForCtx;
|
|
5438
5440
|
const writeResult = await writeFiles(withHeaders, options.outputDir, {
|
|
5439
5441
|
language: emitter.language,
|
|
5440
5442
|
header
|
|
@@ -6217,6 +6219,7 @@ async function generateCommand(opts) {
|
|
|
6217
6219
|
operationHints: opts.operationHints,
|
|
6218
6220
|
mountRules: opts.mountRules,
|
|
6219
6221
|
modelHints: opts.modelHints,
|
|
6222
|
+
emitterOptions: opts.emitterOptions,
|
|
6220
6223
|
noPrune: opts.prune === false
|
|
6221
6224
|
});
|
|
6222
6225
|
if (opts.dryRun) for (const f of files) console.log(f.path);
|
|
@@ -9133,6 +9136,7 @@ let configDocUrl;
|
|
|
9133
9136
|
let configOperationHints;
|
|
9134
9137
|
let configMountRules;
|
|
9135
9138
|
let configModelHints;
|
|
9139
|
+
let configEmitterOptions;
|
|
9136
9140
|
let configCompat;
|
|
9137
9141
|
try {
|
|
9138
9142
|
const config = await loadConfig(explicitConfigPath);
|
|
@@ -9146,6 +9150,7 @@ try {
|
|
|
9146
9150
|
configOperationHints = config.operationHints;
|
|
9147
9151
|
configMountRules = config.mountRules;
|
|
9148
9152
|
configModelHints = config.modelHints;
|
|
9153
|
+
configEmitterOptions = config.emitterOptions;
|
|
9149
9154
|
configCompat = config.compat;
|
|
9150
9155
|
}
|
|
9151
9156
|
} catch (err) {
|
|
@@ -9179,7 +9184,8 @@ program.command("generate").description("Run a registered emitter against an Ope
|
|
|
9179
9184
|
docUrl: configDocUrl,
|
|
9180
9185
|
operationHints: configOperationHints,
|
|
9181
9186
|
mountRules: configMountRules,
|
|
9182
|
-
modelHints: configModelHints
|
|
9187
|
+
modelHints: configModelHints,
|
|
9188
|
+
emitterOptions: configEmitterOptions?.[opts.lang]
|
|
9183
9189
|
}).catch(handleError);
|
|
9184
9190
|
});
|
|
9185
9191
|
program.command("diff").description("Compare two OpenAPI specs and output a diff report").requiredOption("--old <path>", "Path to old spec").requiredOption("--new <path>", "Path to new spec").action((opts) => {
|