@kubb/agent 5.0.0-beta.3 → 5.0.0-beta.4
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
|
@@ -5362,8 +5362,8 @@ function buildDefaultBanner({ title, description, version, config }) {
|
|
|
5362
5362
|
if (Array.isArray(config.input)) {
|
|
5363
5363
|
const first = config.input[0];
|
|
5364
5364
|
if (first && "path" in first) source = path$1.basename(first.path);
|
|
5365
|
-
} else if ("path" in config.input) source = path$1.basename(config.input.path);
|
|
5366
|
-
else if ("data" in config.input) source = "text content";
|
|
5365
|
+
} else if (config.input && "path" in config.input) source = path$1.basename(config.input.path);
|
|
5366
|
+
else if (config.input && "data" in config.input) source = "text content";
|
|
5367
5367
|
let banner = "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n";
|
|
5368
5368
|
if (config.output.defaultBanner === "simple") {
|
|
5369
5369
|
banner += "*/\n";
|
|
@@ -6464,7 +6464,7 @@ const fsStorage = createStorage(() => ({
|
|
|
6464
6464
|
await clean(resolve(base));
|
|
6465
6465
|
}
|
|
6466
6466
|
}));
|
|
6467
|
-
var version$1 = "5.0.0-beta.
|
|
6467
|
+
var version$1 = "5.0.0-beta.4";
|
|
6468
6468
|
function getDiagnosticInfo() {
|
|
6469
6469
|
return {
|
|
6470
6470
|
nodeVersion: version$2,
|
|
@@ -6513,7 +6513,6 @@ async function setup(userConfig, options = {}) {
|
|
|
6513
6513
|
throw new Error(`Cannot read file/URL defined in \`input.path\` or set with \`kubb generate PATH\` in the CLI of your Kubb config ${userConfig.input.path}`, { cause: error });
|
|
6514
6514
|
}
|
|
6515
6515
|
}
|
|
6516
|
-
if (!userConfig.adapter) throw new Error("Adapter should be defined");
|
|
6517
6516
|
const config = {
|
|
6518
6517
|
...userConfig,
|
|
6519
6518
|
root: userConfig.root || process.cwd(),
|
|
@@ -6547,23 +6546,23 @@ async function setup(userConfig, options = {}) {
|
|
|
6547
6546
|
if (handler) hooks.on(event, handler);
|
|
6548
6547
|
}
|
|
6549
6548
|
for (const middleware of (_i = config.middleware) != null ? _i : []) for (const event of Object.keys(middleware.hooks)) registerMiddlewareHook(event, middleware.hooks);
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
}
|
|
6549
|
+
if (config.adapter) {
|
|
6550
|
+
const source = inputToAdapterSource(config);
|
|
6551
|
+
await hooks.emit("kubb:debug", {
|
|
6552
|
+
date: /* @__PURE__ */ new Date(),
|
|
6553
|
+
logs: [`Running adapter: ${config.adapter.name}`]
|
|
6554
|
+
});
|
|
6555
|
+
driver.adapter = config.adapter;
|
|
6556
|
+
driver.inputNode = await config.adapter.parse(source);
|
|
6557
|
+
await hooks.emit("kubb:debug", {
|
|
6558
|
+
date: /* @__PURE__ */ new Date(),
|
|
6559
|
+
logs: [
|
|
6560
|
+
`\u2713 Adapter '${config.adapter.name}' resolved InputNode`,
|
|
6561
|
+
` \u2022 Schemas: ${driver.inputNode.schemas.length}`,
|
|
6562
|
+
` \u2022 Operations: ${driver.inputNode.operations.length}`
|
|
6563
|
+
]
|
|
6564
|
+
});
|
|
6565
|
+
}
|
|
6567
6566
|
return {
|
|
6568
6567
|
config,
|
|
6569
6568
|
hooks,
|
|
@@ -6820,21 +6819,23 @@ async function build(setupResult) {
|
|
|
6820
6819
|
};
|
|
6821
6820
|
}
|
|
6822
6821
|
function inputToAdapterSource(config) {
|
|
6823
|
-
|
|
6822
|
+
const input = config.input;
|
|
6823
|
+
if (!input) throw new Error("[kubb] input is required when using an adapter. Provide input.path or input.data in your config.");
|
|
6824
|
+
if (Array.isArray(input)) return {
|
|
6824
6825
|
type: "paths",
|
|
6825
|
-
paths:
|
|
6826
|
+
paths: input.map((i) => new URLPath(i.path).isURL ? i.path : resolve(config.root, i.path))
|
|
6826
6827
|
};
|
|
6827
|
-
if ("data" in
|
|
6828
|
+
if ("data" in input) return {
|
|
6828
6829
|
type: "data",
|
|
6829
|
-
data:
|
|
6830
|
+
data: input.data
|
|
6830
6831
|
};
|
|
6831
|
-
if (new URLPath(
|
|
6832
|
+
if (new URLPath(input.path).isURL) return {
|
|
6832
6833
|
type: "path",
|
|
6833
|
-
path:
|
|
6834
|
+
path: input.path
|
|
6834
6835
|
};
|
|
6835
6836
|
return {
|
|
6836
6837
|
type: "path",
|
|
6837
|
-
path: resolve(config.root,
|
|
6838
|
+
path: resolve(config.root, input.path)
|
|
6838
6839
|
};
|
|
6839
6840
|
}
|
|
6840
6841
|
function createKubb(userConfig, options = {}) {
|
|
@@ -6900,7 +6901,7 @@ const memoryStorage = createStorage(() => {
|
|
|
6900
6901
|
};
|
|
6901
6902
|
});
|
|
6902
6903
|
|
|
6903
|
-
var version = "5.0.0-beta.
|
|
6904
|
+
var version = "5.0.0-beta.4";
|
|
6904
6905
|
|
|
6905
6906
|
function isCommandMessage(msg) {
|
|
6906
6907
|
return msg.type === "command";
|
|
@@ -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.4/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.4_rolldown@1.0.0-rc.17/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.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/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.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/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.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules-utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/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.4/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.4_rolldown@1.0.0-rc.17/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.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/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.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/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.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules-utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/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-Wi34Pegx.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.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/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","path","exports","_b","extname","__privateAdd","__privateMethod","__privateGet","__privateSet","__publicField","readFile","writeFile","build","walk","readdir","version","_c","_d","_e","files","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,31,57,58,59,60]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/agent",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.4",
|
|
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
|
"unrun": "^0.2.37",
|
|
44
44
|
"unstorage": "^1.17.5",
|
|
45
45
|
"ws": "^8.20.0",
|
|
46
|
-
"@kubb/ast": "5.0.0-beta.
|
|
47
|
-
"@kubb/core": "5.0.0-beta.
|
|
46
|
+
"@kubb/ast": "5.0.0-beta.4",
|
|
47
|
+
"@kubb/core": "5.0.0-beta.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/ws": "^8.18.1",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"nitropack": "^2.13.4",
|
|
53
53
|
"vite": "^8.0.10",
|
|
54
54
|
"@internals/utils": "0.0.0",
|
|
55
|
-
"@kubb/adapter-oas": "5.0.0-beta.
|
|
56
|
-
"@kubb/parser-ts": "5.0.0-beta.
|
|
55
|
+
"@kubb/adapter-oas": "5.0.0-beta.4",
|
|
56
|
+
"@kubb/parser-ts": "5.0.0-beta.4"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=22"
|