@kubb/agent 5.0.0-alpha.52 → 5.0.0-alpha.54
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/.output/nitro.json
CHANGED
|
@@ -4894,7 +4894,7 @@ function createLimit(concurrency) {
|
|
|
4894
4894
|
};
|
|
4895
4895
|
}
|
|
4896
4896
|
function getChildren(node, recurse) {
|
|
4897
|
-
var _a;
|
|
4897
|
+
var _a, _b, _c;
|
|
4898
4898
|
switch (node.kind) {
|
|
4899
4899
|
case "Input":
|
|
4900
4900
|
return [...node.schemas, ...node.operations];
|
|
@@ -4903,7 +4903,7 @@ function getChildren(node, recurse) {
|
|
|
4903
4903
|
case "Operation":
|
|
4904
4904
|
return [
|
|
4905
4905
|
...node.parameters,
|
|
4906
|
-
...((_a = node.requestBody) == null ? void 0 : _a.
|
|
4906
|
+
...(_c = (_b = (_a = node.requestBody) == null ? void 0 : _a.content) == null ? void 0 : _b.flatMap((c) => c.schema ? [c.schema] : [])) != null ? _c : [],
|
|
4907
4907
|
...node.responses
|
|
4908
4908
|
];
|
|
4909
4909
|
case "Schema": {
|
|
@@ -4983,7 +4983,7 @@ async function _walk(node, visitor, recurse, limit, parent) {
|
|
|
4983
4983
|
for (const child of children) await _walk(child, visitor, recurse, limit, node);
|
|
4984
4984
|
}
|
|
4985
4985
|
function transform(node, options) {
|
|
4986
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
4986
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
4987
4987
|
const { depth, parent, ...visitor } = options;
|
|
4988
4988
|
const recurse = (depth != null ? depth : visitorDepths.deep) === visitorDepths.deep;
|
|
4989
4989
|
switch (node.kind) {
|
|
@@ -5021,10 +5021,13 @@ function transform(node, options) {
|
|
|
5021
5021
|
})),
|
|
5022
5022
|
requestBody: op.requestBody ? {
|
|
5023
5023
|
...op.requestBody,
|
|
5024
|
-
|
|
5025
|
-
...
|
|
5026
|
-
|
|
5027
|
-
|
|
5024
|
+
content: (_d = op.requestBody.content) == null ? void 0 : _d.map((c) => ({
|
|
5025
|
+
...c,
|
|
5026
|
+
schema: c.schema ? transform(c.schema, {
|
|
5027
|
+
...options,
|
|
5028
|
+
parent: op
|
|
5029
|
+
}) : void 0
|
|
5030
|
+
}))
|
|
5028
5031
|
} : void 0,
|
|
5029
5032
|
responses: op.responses.map((r) => transform(r, {
|
|
5030
5033
|
...options,
|
|
@@ -5034,7 +5037,7 @@ function transform(node, options) {
|
|
|
5034
5037
|
}
|
|
5035
5038
|
case "Schema": {
|
|
5036
5039
|
let schema = node;
|
|
5037
|
-
const replaced = (
|
|
5040
|
+
const replaced = (_e = visitor.schema) == null ? void 0 : _e.call(visitor, schema, { parent });
|
|
5038
5041
|
if (replaced) schema = replaced;
|
|
5039
5042
|
const childOptions = {
|
|
5040
5043
|
...options,
|
|
@@ -5043,14 +5046,14 @@ function transform(node, options) {
|
|
|
5043
5046
|
return {
|
|
5044
5047
|
...schema,
|
|
5045
5048
|
..."properties" in schema && recurse ? { properties: schema.properties.map((p) => transform(p, childOptions)) } : {},
|
|
5046
|
-
..."items" in schema && recurse ? { items: (
|
|
5047
|
-
..."members" in schema && recurse ? { members: (
|
|
5049
|
+
..."items" in schema && recurse ? { items: (_f = schema.items) == null ? void 0 : _f.map((i) => transform(i, childOptions)) } : {},
|
|
5050
|
+
..."members" in schema && recurse ? { members: (_g = schema.members) == null ? void 0 : _g.map((m) => transform(m, childOptions)) } : {},
|
|
5048
5051
|
..."additionalProperties" in schema && recurse && schema.additionalProperties && schema.additionalProperties !== true ? { additionalProperties: transform(schema.additionalProperties, childOptions) } : {}
|
|
5049
5052
|
};
|
|
5050
5053
|
}
|
|
5051
5054
|
case "Property": {
|
|
5052
5055
|
let prop = node;
|
|
5053
|
-
const replaced = (
|
|
5056
|
+
const replaced = (_h = visitor.property) == null ? void 0 : _h.call(visitor, prop, { parent });
|
|
5054
5057
|
if (replaced) prop = replaced;
|
|
5055
5058
|
return createProperty({
|
|
5056
5059
|
...prop,
|
|
@@ -5062,7 +5065,7 @@ function transform(node, options) {
|
|
|
5062
5065
|
}
|
|
5063
5066
|
case "Parameter": {
|
|
5064
5067
|
let param = node;
|
|
5065
|
-
const replaced = (
|
|
5068
|
+
const replaced = (_i = visitor.parameter) == null ? void 0 : _i.call(visitor, param, { parent });
|
|
5066
5069
|
if (replaced) param = replaced;
|
|
5067
5070
|
return createParameter({
|
|
5068
5071
|
...param,
|
|
@@ -5074,7 +5077,7 @@ function transform(node, options) {
|
|
|
5074
5077
|
}
|
|
5075
5078
|
case "Response": {
|
|
5076
5079
|
let response = node;
|
|
5077
|
-
const replaced = (
|
|
5080
|
+
const replaced = (_j = visitor.response) == null ? void 0 : _j.call(visitor, response, { parent });
|
|
5078
5081
|
if (replaced) response = replaced;
|
|
5079
5082
|
return {
|
|
5080
5083
|
...response,
|
|
@@ -5154,7 +5157,7 @@ function testPattern(value, pattern) {
|
|
|
5154
5157
|
return value.match(pattern) !== null;
|
|
5155
5158
|
}
|
|
5156
5159
|
function matchesOperationPattern(node, type, pattern) {
|
|
5157
|
-
var _a2;
|
|
5160
|
+
var _a2, _b2, _c;
|
|
5158
5161
|
switch (type) {
|
|
5159
5162
|
case "tag":
|
|
5160
5163
|
return node.tags.some((tag) => testPattern(tag, pattern));
|
|
@@ -5165,7 +5168,7 @@ function matchesOperationPattern(node, type, pattern) {
|
|
|
5165
5168
|
case "method":
|
|
5166
5169
|
return testPattern(node.method.toLowerCase(), pattern);
|
|
5167
5170
|
case "contentType":
|
|
5168
|
-
return ((_a2 = node.requestBody) == null ? void 0 : _a2.
|
|
5171
|
+
return (_c = (_b2 = (_a2 = node.requestBody) == null ? void 0 : _a2.content) == null ? void 0 : _b2.some((c) => testPattern(c.contentType, pattern))) != null ? _c : false;
|
|
5169
5172
|
default:
|
|
5170
5173
|
return false;
|
|
5171
5174
|
}
|
|
@@ -5690,13 +5693,13 @@ var PluginDriver = (_b$1 = class {
|
|
|
5690
5693
|
return plugin.transformer;
|
|
5691
5694
|
},
|
|
5692
5695
|
warn(message) {
|
|
5693
|
-
driver.hooks.emit("kubb:warn", message);
|
|
5696
|
+
driver.hooks.emit("kubb:warn", { message });
|
|
5694
5697
|
},
|
|
5695
5698
|
error(error) {
|
|
5696
|
-
driver.hooks.emit("kubb:error", typeof error === "string" ? new Error(error) : error);
|
|
5699
|
+
driver.hooks.emit("kubb:error", { error: typeof error === "string" ? new Error(error) : error });
|
|
5697
5700
|
},
|
|
5698
5701
|
info(message) {
|
|
5699
|
-
driver.hooks.emit("kubb:info", message);
|
|
5702
|
+
driver.hooks.emit("kubb:info", { message });
|
|
5700
5703
|
},
|
|
5701
5704
|
openInStudio(options) {
|
|
5702
5705
|
var _a2, _b2;
|
|
@@ -6297,7 +6300,7 @@ const fsStorage = createStorage(() => ({
|
|
|
6297
6300
|
await clean(resolve(base));
|
|
6298
6301
|
}
|
|
6299
6302
|
}));
|
|
6300
|
-
var version$1 = "5.0.0-alpha.
|
|
6303
|
+
var version$1 = "5.0.0-alpha.54";
|
|
6301
6304
|
function getDiagnosticInfo() {
|
|
6302
6305
|
return {
|
|
6303
6306
|
nodeVersion: version$2,
|
|
@@ -6533,7 +6536,7 @@ async function setup(userConfig, options = {}) {
|
|
|
6533
6536
|
const hooks = (_a2 = options.hooks) != null ? _a2 : new AsyncEventEmitter();
|
|
6534
6537
|
const sources = /* @__PURE__ */ new Map();
|
|
6535
6538
|
const diagnosticInfo = getDiagnosticInfo();
|
|
6536
|
-
if (Array.isArray(userConfig.input)) await hooks.emit("kubb:warn", "This feature is still under development \u2014 use with caution");
|
|
6539
|
+
if (Array.isArray(userConfig.input)) await hooks.emit("kubb:warn", { message: "This feature is still under development \u2014 use with caution" });
|
|
6537
6540
|
await hooks.emit("kubb:debug", {
|
|
6538
6541
|
date: /* @__PURE__ */ new Date(),
|
|
6539
6542
|
logs: [
|
|
@@ -6708,7 +6711,7 @@ async function safeBuild(setupResult) {
|
|
|
6708
6711
|
const root = resolve(config.root, config.output.path);
|
|
6709
6712
|
try {
|
|
6710
6713
|
const timestamp = /* @__PURE__ */ new Date();
|
|
6711
|
-
await hooks.emit("kubb:plugin:start", plugin);
|
|
6714
|
+
await hooks.emit("kubb:plugin:start", { plugin });
|
|
6712
6715
|
await hooks.emit("kubb:debug", {
|
|
6713
6716
|
date: timestamp,
|
|
6714
6717
|
logs: ["Starting plugin...", ` \u2022 Plugin Name: ${plugin.name}`]
|
|
@@ -6725,7 +6728,8 @@ async function safeBuild(setupResult) {
|
|
|
6725
6728
|
}
|
|
6726
6729
|
const duration = getElapsedMs(hrStart);
|
|
6727
6730
|
pluginTimings.set(plugin.name, duration);
|
|
6728
|
-
await hooks.emit("kubb:plugin:end",
|
|
6731
|
+
await hooks.emit("kubb:plugin:end", {
|
|
6732
|
+
plugin,
|
|
6729
6733
|
duration,
|
|
6730
6734
|
success: true
|
|
6731
6735
|
});
|
|
@@ -6737,7 +6741,8 @@ async function safeBuild(setupResult) {
|
|
|
6737
6741
|
const error = caughtError;
|
|
6738
6742
|
const errorTimestamp = /* @__PURE__ */ new Date();
|
|
6739
6743
|
const duration = getElapsedMs(hrStart);
|
|
6740
|
-
await hooks.emit("kubb:plugin:end",
|
|
6744
|
+
await hooks.emit("kubb:plugin:end", {
|
|
6745
|
+
plugin,
|
|
6741
6746
|
duration,
|
|
6742
6747
|
success: false,
|
|
6743
6748
|
error
|
|
@@ -6809,7 +6814,7 @@ async function safeBuild(setupResult) {
|
|
|
6809
6814
|
parsers: parsersMap,
|
|
6810
6815
|
extension: config.output.extension,
|
|
6811
6816
|
onStart: async (processingFiles) => {
|
|
6812
|
-
await hooks.emit("kubb:files:processing:start", processingFiles);
|
|
6817
|
+
await hooks.emit("kubb:files:processing:start", { files: processingFiles });
|
|
6813
6818
|
},
|
|
6814
6819
|
onUpdate: async ({ file, source, processed, total, percentage }) => {
|
|
6815
6820
|
await hooks.emit("kubb:file:processing:update", {
|
|
@@ -6826,7 +6831,7 @@ async function safeBuild(setupResult) {
|
|
|
6826
6831
|
}
|
|
6827
6832
|
},
|
|
6828
6833
|
onEnd: async (processedFiles) => {
|
|
6829
|
-
await hooks.emit("kubb:files:processing:end", processedFiles);
|
|
6834
|
+
await hooks.emit("kubb:files:processing:end", { files: processedFiles });
|
|
6830
6835
|
await hooks.emit("kubb:debug", {
|
|
6831
6836
|
date: /* @__PURE__ */ new Date(),
|
|
6832
6837
|
logs: [`\u2713 File write process completed for ${processedFiles.length} files`]
|
|
@@ -6977,7 +6982,7 @@ const memoryStorage = createStorage(() => {
|
|
|
6977
6982
|
};
|
|
6978
6983
|
});
|
|
6979
6984
|
|
|
6980
|
-
var version = "5.0.0-alpha.
|
|
6985
|
+
var version = "5.0.0-alpha.54";
|
|
6981
6986
|
|
|
6982
6987
|
function isCommandMessage(msg) {
|
|
6983
6988
|
return msg.type === "command";
|
|
@@ -7019,23 +7024,23 @@ async function executeHooks({ configHooks, hooks }) {
|
|
|
7019
7024
|
}
|
|
7020
7025
|
const hookId = createHash("sha256").update(command).digest("hex");
|
|
7021
7026
|
await hooks.emit("kubb:hook:start", { id: hookId, command: cmd, args });
|
|
7022
|
-
await hooks.onOnce("kubb:hook:end", async (
|
|
7023
|
-
if (!success) {
|
|
7024
|
-
throw error;
|
|
7027
|
+
await hooks.onOnce("kubb:hook:end", async (ctx) => {
|
|
7028
|
+
if (!ctx.success) {
|
|
7029
|
+
throw ctx.error;
|
|
7025
7030
|
}
|
|
7026
|
-
await hooks.emit("kubb:success", `${command} successfully executed`);
|
|
7031
|
+
await hooks.emit("kubb:success", { message: `${command} successfully executed` });
|
|
7027
7032
|
});
|
|
7028
7033
|
}
|
|
7029
7034
|
}
|
|
7030
7035
|
|
|
7031
7036
|
async function generate({ config, hooks }) {
|
|
7032
|
-
await hooks.emit("kubb:generation:start", config);
|
|
7033
|
-
await hooks.emit("kubb:info", config.name ? `Setup generation ${config.name}` : "Setup generation");
|
|
7037
|
+
await hooks.emit("kubb:generation:start", { config });
|
|
7038
|
+
await hooks.emit("kubb:info", { message: config.name ? `Setup generation ${config.name}` : "Setup generation" });
|
|
7034
7039
|
const kubb = createKubb(config, { hooks });
|
|
7035
7040
|
await kubb.setup();
|
|
7036
|
-
await hooks.emit("kubb:info", config.name ? `Build generation ${config.name}` : "Build generation");
|
|
7041
|
+
await hooks.emit("kubb:info", { message: config.name ? `Build generation ${config.name}` : "Build generation" });
|
|
7037
7042
|
const { files, failedPlugins, error } = await kubb.safeBuild();
|
|
7038
|
-
await hooks.emit("kubb:info", "Load summary");
|
|
7043
|
+
await hooks.emit("kubb:info", { message: "Load summary" });
|
|
7039
7044
|
const hasFailures = failedPlugins.size > 0 || error;
|
|
7040
7045
|
if (hasFailures) {
|
|
7041
7046
|
const allErrors = [
|
|
@@ -7043,23 +7048,23 @@ async function generate({ config, hooks }) {
|
|
|
7043
7048
|
...Array.from(failedPlugins).filter((it) => it.error).map((it) => it.error)
|
|
7044
7049
|
].filter(Boolean);
|
|
7045
7050
|
allErrors.forEach((err) => {
|
|
7046
|
-
hooks.emit("kubb:error", err);
|
|
7051
|
+
hooks.emit("kubb:error", { error: err });
|
|
7047
7052
|
});
|
|
7048
|
-
await hooks.emit("kubb:generation:end", config, files, kubb.sources);
|
|
7053
|
+
await hooks.emit("kubb:generation:end", { config, files, sources: kubb.sources });
|
|
7049
7054
|
throw new Error("Generation failed");
|
|
7050
7055
|
}
|
|
7051
|
-
await hooks.emit("kubb:success", "Generation successfully");
|
|
7052
|
-
await hooks.emit("kubb:generation:end", config, files, kubb.sources);
|
|
7056
|
+
await hooks.emit("kubb:success", { message: "Generation successfully" });
|
|
7057
|
+
await hooks.emit("kubb:generation:end", { config, files, sources: kubb.sources });
|
|
7053
7058
|
if (config.output.format) {
|
|
7054
7059
|
await hooks.emit("kubb:format:start");
|
|
7055
7060
|
let formatter = config.output.format;
|
|
7056
7061
|
if (formatter === "auto") {
|
|
7057
7062
|
const detectedFormatter = await detectFormatter();
|
|
7058
7063
|
if (!detectedFormatter) {
|
|
7059
|
-
await hooks.emit("kubb:warn", "No formatter found (oxfmt, biome, or prettier). Skipping formatting.");
|
|
7064
|
+
await hooks.emit("kubb:warn", { message: "No formatter found (oxfmt, biome, or prettier). Skipping formatting." });
|
|
7060
7065
|
} else {
|
|
7061
7066
|
formatter = detectedFormatter;
|
|
7062
|
-
await hooks.emit("kubb:info", `Auto-detected formatter: ${formatter}`);
|
|
7067
|
+
await hooks.emit("kubb:info", { message: `Auto-detected formatter: ${formatter}` });
|
|
7063
7068
|
}
|
|
7064
7069
|
}
|
|
7065
7070
|
if (formatter && formatter !== "auto" && formatter in formatters) {
|
|
@@ -7072,14 +7077,14 @@ async function generate({ config, hooks }) {
|
|
|
7072
7077
|
command: formatterConfig.command,
|
|
7073
7078
|
args: formatterConfig.args(outputPath)
|
|
7074
7079
|
});
|
|
7075
|
-
await hooks.onOnce("kubb:hook:end", async (
|
|
7076
|
-
if (!success) throw
|
|
7077
|
-
await hooks.emit("kubb:success", `Formatting with ${formatter} successfully`);
|
|
7080
|
+
await hooks.onOnce("kubb:hook:end", async (ctx) => {
|
|
7081
|
+
if (!ctx.success) throw ctx.error;
|
|
7082
|
+
await hooks.emit("kubb:success", { message: `Formatting with ${formatter} successfully` });
|
|
7078
7083
|
});
|
|
7079
7084
|
} catch (caughtError) {
|
|
7080
7085
|
const error2 = new Error(formatterConfig.errorMessage);
|
|
7081
7086
|
error2.cause = caughtError;
|
|
7082
|
-
await hooks.emit("kubb:error", error2);
|
|
7087
|
+
await hooks.emit("kubb:error", { error: error2 });
|
|
7083
7088
|
}
|
|
7084
7089
|
}
|
|
7085
7090
|
await hooks.emit("kubb:format:end");
|
|
@@ -7090,10 +7095,10 @@ async function generate({ config, hooks }) {
|
|
|
7090
7095
|
if (linter === "auto") {
|
|
7091
7096
|
const detectedLinter = await detectLinter();
|
|
7092
7097
|
if (!detectedLinter) {
|
|
7093
|
-
await hooks.emit("kubb:warn", "No linter found (oxlint, biome, or eslint). Skipping linting.");
|
|
7098
|
+
await hooks.emit("kubb:warn", { message: "No linter found (oxlint, biome, or eslint). Skipping linting." });
|
|
7094
7099
|
} else {
|
|
7095
7100
|
linter = detectedLinter;
|
|
7096
|
-
await hooks.emit("kubb:info", `Auto-detected linter: ${styleText("dim", linter)}`);
|
|
7101
|
+
await hooks.emit("kubb:info", { message: `Auto-detected linter: ${styleText("dim", linter)}` });
|
|
7097
7102
|
}
|
|
7098
7103
|
}
|
|
7099
7104
|
if (linter && linter !== "auto" && linter in linters) {
|
|
@@ -7106,13 +7111,13 @@ async function generate({ config, hooks }) {
|
|
|
7106
7111
|
command: linterConfig.command,
|
|
7107
7112
|
args: linterConfig.args(outputPath)
|
|
7108
7113
|
});
|
|
7109
|
-
await hooks.onOnce("kubb:hook:end", async (
|
|
7110
|
-
if (!success) throw
|
|
7114
|
+
await hooks.onOnce("kubb:hook:end", async (ctx) => {
|
|
7115
|
+
if (!ctx.success) throw ctx.error;
|
|
7111
7116
|
});
|
|
7112
7117
|
} catch (caughtError) {
|
|
7113
7118
|
const error2 = new Error(linterConfig.errorMessage);
|
|
7114
7119
|
error2.cause = caughtError;
|
|
7115
|
-
await hooks.emit("kubb:error", error2);
|
|
7120
|
+
await hooks.emit("kubb:error", { error: error2 });
|
|
7116
7121
|
}
|
|
7117
7122
|
}
|
|
7118
7123
|
await hooks.emit("kubb:lint:end");
|
|
@@ -7231,7 +7236,7 @@ async function publish({ command, outputPath, root, hooks }) {
|
|
|
7231
7236
|
throw new Error(`[plugin-publish] Invalid publish command: "${command}"`);
|
|
7232
7237
|
}
|
|
7233
7238
|
const commandWithArgs = args.length ? `${cmd} ${args.join(" ")}` : cmd;
|
|
7234
|
-
await hooks.emit("kubb:info", `[publish] Running "${commandWithArgs}" in "${resolvedOutputPath}"`);
|
|
7239
|
+
await hooks.emit("kubb:info", { message: `[publish] Running "${commandWithArgs}" in "${resolvedOutputPath}"` });
|
|
7235
7240
|
const startTime = Date.now();
|
|
7236
7241
|
let exitCode = null;
|
|
7237
7242
|
try {
|
|
@@ -7240,7 +7245,7 @@ async function publish({ command, outputPath, root, hooks }) {
|
|
|
7240
7245
|
});
|
|
7241
7246
|
for await (const line of proc) {
|
|
7242
7247
|
if (line.trim()) {
|
|
7243
|
-
await hooks.emit("kubb:info", line.trim());
|
|
7248
|
+
await hooks.emit("kubb:info", { message: line.trim() });
|
|
7244
7249
|
}
|
|
7245
7250
|
}
|
|
7246
7251
|
const result = await proc;
|
|
@@ -7249,20 +7254,21 @@ async function publish({ command, outputPath, root, hooks }) {
|
|
|
7249
7254
|
const message = (_d = (_c = (_b = err == null ? void 0 : err.stderr) == null ? void 0 : _b.trim()) != null ? _c : err == null ? void 0 : err.message) != null ? _d : String(err);
|
|
7250
7255
|
const error = new Error(`[publish] Failed to run "${commandWithArgs}": ${message}`);
|
|
7251
7256
|
error.cause = err;
|
|
7252
|
-
await hooks.emit("kubb:error", error);
|
|
7257
|
+
await hooks.emit("kubb:error", { error });
|
|
7253
7258
|
throw error;
|
|
7254
7259
|
}
|
|
7255
7260
|
if (exitCode !== 0) {
|
|
7256
7261
|
const error = new Error(`[publish] "${commandWithArgs}" exited with code ${exitCode}`);
|
|
7257
|
-
await hooks.emit("kubb:error", error);
|
|
7262
|
+
await hooks.emit("kubb:error", { error });
|
|
7258
7263
|
throw error;
|
|
7259
7264
|
}
|
|
7260
7265
|
const duration = Date.now() - startTime;
|
|
7261
|
-
await hooks.emit("kubb:success", `[publish] Published successfully in ${duration}ms`);
|
|
7266
|
+
await hooks.emit("kubb:success", { message: `[publish] Published successfully in ${duration}ms` });
|
|
7262
7267
|
}
|
|
7263
7268
|
|
|
7264
7269
|
function setupHookListener(hooks, root) {
|
|
7265
|
-
hooks.on("kubb:hook:start", async (
|
|
7270
|
+
hooks.on("kubb:hook:start", async (ctx) => {
|
|
7271
|
+
const { id, command, args } = ctx;
|
|
7266
7272
|
if (!id) {
|
|
7267
7273
|
return;
|
|
7268
7274
|
}
|
|
@@ -7289,7 +7295,7 @@ function setupHookListener(hooks, root) {
|
|
|
7289
7295
|
success: false,
|
|
7290
7296
|
error: errorMessage
|
|
7291
7297
|
});
|
|
7292
|
-
await hooks.emit("kubb:error", errorMessage);
|
|
7298
|
+
await hooks.emit("kubb:error", { error: errorMessage });
|
|
7293
7299
|
}
|
|
7294
7300
|
});
|
|
7295
7301
|
}
|
|
@@ -7337,70 +7343,70 @@ function setupEventsStream(ws, hooks, getSource) {
|
|
|
7337
7343
|
payload: { ...payload, source: getSource == null ? void 0 : getSource() }
|
|
7338
7344
|
});
|
|
7339
7345
|
}
|
|
7340
|
-
hooks.on("kubb:plugin:start", (
|
|
7346
|
+
hooks.on("kubb:plugin:start", (ctx) => {
|
|
7341
7347
|
sendDataMessage({
|
|
7342
7348
|
type: "kubb:plugin:start",
|
|
7343
|
-
data: [plugin],
|
|
7349
|
+
data: [ctx.plugin],
|
|
7344
7350
|
timestamp: Date.now()
|
|
7345
7351
|
});
|
|
7346
7352
|
});
|
|
7347
|
-
hooks.on("kubb:plugin:end", (
|
|
7353
|
+
hooks.on("kubb:plugin:end", (ctx) => {
|
|
7348
7354
|
sendDataMessage({
|
|
7349
7355
|
type: "kubb:plugin:end",
|
|
7350
|
-
data: [plugin,
|
|
7356
|
+
data: [ctx.plugin, { duration: ctx.duration, success: ctx.success }],
|
|
7351
7357
|
timestamp: Date.now()
|
|
7352
7358
|
});
|
|
7353
7359
|
});
|
|
7354
|
-
hooks.on("kubb:files:processing:start", (files) => {
|
|
7360
|
+
hooks.on("kubb:files:processing:start", ({ files }) => {
|
|
7355
7361
|
sendDataMessage({
|
|
7356
7362
|
type: "kubb:files:processing:start",
|
|
7357
7363
|
data: [{ total: files.length }],
|
|
7358
7364
|
timestamp: Date.now()
|
|
7359
7365
|
});
|
|
7360
7366
|
});
|
|
7361
|
-
hooks.on("kubb:file:processing:update", (
|
|
7367
|
+
hooks.on("kubb:file:processing:update", (ctx) => {
|
|
7362
7368
|
sendDataMessage({
|
|
7363
7369
|
type: "kubb:file:processing:update",
|
|
7364
7370
|
data: [
|
|
7365
7371
|
{
|
|
7366
|
-
file:
|
|
7367
|
-
processed:
|
|
7368
|
-
total:
|
|
7369
|
-
percentage:
|
|
7372
|
+
file: ctx.file.path,
|
|
7373
|
+
processed: ctx.processed,
|
|
7374
|
+
total: ctx.total,
|
|
7375
|
+
percentage: ctx.percentage
|
|
7370
7376
|
}
|
|
7371
7377
|
],
|
|
7372
7378
|
timestamp: Date.now()
|
|
7373
7379
|
});
|
|
7374
7380
|
});
|
|
7375
|
-
hooks.on("kubb:files:processing:end", (files) => {
|
|
7381
|
+
hooks.on("kubb:files:processing:end", ({ files }) => {
|
|
7376
7382
|
sendDataMessage({
|
|
7377
7383
|
type: "kubb:files:processing:end",
|
|
7378
7384
|
data: [{ total: files.length }],
|
|
7379
7385
|
timestamp: Date.now()
|
|
7380
7386
|
});
|
|
7381
7387
|
});
|
|
7382
|
-
hooks.on("kubb:info", (message, info) => {
|
|
7388
|
+
hooks.on("kubb:info", ({ message, info }) => {
|
|
7383
7389
|
sendDataMessage({
|
|
7384
7390
|
type: "kubb:info",
|
|
7385
7391
|
data: [message, info],
|
|
7386
7392
|
timestamp: Date.now()
|
|
7387
7393
|
});
|
|
7388
7394
|
});
|
|
7389
|
-
hooks.on("kubb:success", (message, info) => {
|
|
7395
|
+
hooks.on("kubb:success", ({ message, info }) => {
|
|
7390
7396
|
sendDataMessage({
|
|
7391
7397
|
type: "kubb:success",
|
|
7392
7398
|
data: [message, info],
|
|
7393
7399
|
timestamp: Date.now()
|
|
7394
7400
|
});
|
|
7395
7401
|
});
|
|
7396
|
-
hooks.on("kubb:warn", (message, info) => {
|
|
7402
|
+
hooks.on("kubb:warn", ({ message, info }) => {
|
|
7397
7403
|
sendDataMessage({
|
|
7398
7404
|
type: "kubb:warn",
|
|
7399
7405
|
data: [message, info],
|
|
7400
7406
|
timestamp: Date.now()
|
|
7401
7407
|
});
|
|
7402
7408
|
});
|
|
7403
|
-
hooks.on("kubb:generation:start", (config) => {
|
|
7409
|
+
hooks.on("kubb:generation:start", ({ config }) => {
|
|
7404
7410
|
sendDataMessage({
|
|
7405
7411
|
type: "kubb:generation:start",
|
|
7406
7412
|
data: [
|
|
@@ -7412,7 +7418,7 @@ function setupEventsStream(ws, hooks, getSource) {
|
|
|
7412
7418
|
timestamp: Date.now()
|
|
7413
7419
|
});
|
|
7414
7420
|
});
|
|
7415
|
-
hooks.on("kubb:generation:end", (config, files, sources) => {
|
|
7421
|
+
hooks.on("kubb:generation:end", ({ config, files, sources }) => {
|
|
7416
7422
|
const sourcesRecord = {};
|
|
7417
7423
|
sources.forEach((value, key) => {
|
|
7418
7424
|
sourcesRecord[key] = value;
|
|
@@ -7423,7 +7429,7 @@ function setupEventsStream(ws, hooks, getSource) {
|
|
|
7423
7429
|
timestamp: Date.now()
|
|
7424
7430
|
});
|
|
7425
7431
|
});
|
|
7426
|
-
hooks.on("kubb:error", (error) => {
|
|
7432
|
+
hooks.on("kubb:error", ({ error }) => {
|
|
7427
7433
|
sendDataMessage({
|
|
7428
7434
|
type: "kubb:error",
|
|
7429
7435
|
data: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.11/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../../internals/utils/dist/index.js","../../../../server/plugins/heartbeat.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/chunk--u3MIqq1.js","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-
|
|
1
|
+
{"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.11/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../../internals/utils/dist/index.js","../../../../server/plugins/heartbeat.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/chunk--u3MIqq1.js","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-BU7faPiI.js","../../../../../core/dist/index.js","../../../../server/types/agent.ts","../../../../server/utils/agentCache.ts","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/loadConfig.ts","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/mergePlugins.ts","../../../../server/utils/publish.ts","../../../../server/utils/setupHookListener.ts","../../../../server/constants.ts","../../../../server/utils/ws.ts","../../../../server/utils/connectStudio.ts","../../../../server/utils/runtimeConfig.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.16/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","createStorage","fsPromises","PATH_TRAVERSE_RE","fsp","_inlineAppConfig","createRadixRouter","formatMs","resolve","_a","process","__defProp","trimExtName","path","exports","_b","extname","__privateAdd","__privateGet","__privateSet","__publicField","__privateMethod","readFile","writeFile","build","walk","readdir","version","item","_c","_d","_e","_f","error","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,56,57,58,59]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/agent",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.54",
|
|
4
4
|
"description": "Agent server for Kubb, enabling HTTP-based access to code generation capabilities.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"tinyexec": "^1.1.1",
|
|
44
44
|
"unstorage": "^1.17.5",
|
|
45
45
|
"ws": "^8.20.0",
|
|
46
|
-
"@kubb/ast": "5.0.0-alpha.
|
|
47
|
-
"@kubb/core": "5.0.0-alpha.
|
|
46
|
+
"@kubb/ast": "5.0.0-alpha.54",
|
|
47
|
+
"@kubb/core": "5.0.0-alpha.54"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/ws": "^8.18.1",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"nitropack": "^2.13.3",
|
|
53
53
|
"vite": "^8.0.9",
|
|
54
54
|
"@internals/utils": "0.0.0",
|
|
55
|
-
"@kubb/adapter-oas": "5.0.0-alpha.
|
|
56
|
-
"@kubb/parser-ts": "5.0.0-alpha.
|
|
55
|
+
"@kubb/adapter-oas": "5.0.0-alpha.54",
|
|
56
|
+
"@kubb/parser-ts": "5.0.0-alpha.54"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=22"
|