@kubb/agent 5.0.0-alpha.3 → 5.0.0-alpha.5
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 +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +468 -132
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/node_modules/@kubb/fabric-core/dist/{chunk-BVHe6Par.js → chunk-O_arW02_.js} +6 -11
- package/.output/server/node_modules/@kubb/fabric-core/dist/{defaultParser-BD_N68Bo.js → defaultParser-iCpMSYCp.js} +4 -5
- package/.output/server/node_modules/@kubb/fabric-core/dist/{getRelativePath-C4Au07ON.js → getRelativePath-NAm_Y-vp.js} +3 -6
- package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +71 -89
- package/.output/server/node_modules/@kubb/fabric-core/dist/{onProcessExit-CnZym153.js → onProcessExit-Cput7j2c.js} +124 -138
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers/typescript.js +3 -4
- package/.output/server/node_modules/@kubb/fabric-core/dist/parsers.js +4 -5
- package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +6 -12
- package/.output/server/node_modules/@kubb/fabric-core/package.json +2 -2
- package/.output/server/node_modules/@kubb/react-fabric/dist/{chunk-DbZtQ4qb.js → chunk-BGCRLu6H.js} +12 -21
- package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +27 -35
- package/.output/server/node_modules/@kubb/react-fabric/dist/{react-C2cYsofv.js → jsx-runtime-Bl0DfUmV.js} +262 -7
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime.js +3 -5
- package/.output/server/node_modules/@kubb/react-fabric/dist/parsers.js +2 -3
- package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +4 -7
- package/.output/server/node_modules/@kubb/react-fabric/dist/{reactPlugin-DGKBWjiR.js → reactPlugin-QQPrjNuQ.js} +13 -28
- package/.output/server/node_modules/@kubb/react-fabric/package.json +7 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/index.js +1 -0
- package/.output/server/node_modules/@redocly/openapi-core/package.json +1 -1
- package/.output/server/package.json +4 -4
- package/package.json +17 -17
- package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime-CZxrhUx8.js +0 -266
|
@@ -15,7 +15,7 @@ import { Logtail } from '@logtail/node';
|
|
|
15
15
|
import { consola } from 'consola';
|
|
16
16
|
import mod from 'node:module';
|
|
17
17
|
import { access, rm, readFile as readFile$1, readdir as readdir$1, mkdir, writeFile as writeFile$1 } from 'node:fs/promises';
|
|
18
|
-
import { createFabric, createReactFabric,
|
|
18
|
+
import { createFabric, createReactFabric, Fabric, File, Function as Function$1, Const, FunctionParams, Type as Type$2, useFabric } from '@kubb/react-fabric';
|
|
19
19
|
import { typescriptParser } from '@kubb/react-fabric/parsers';
|
|
20
20
|
import { fsPlugin } from '@kubb/react-fabric/plugins';
|
|
21
21
|
import { performance as performance$1 } from 'node:perf_hooks';
|
|
@@ -4521,7 +4521,7 @@ function formatMs$1(ms) {
|
|
|
4521
4521
|
if (ms >= 1e3) return `${(ms / 1e3).toFixed(2)}s`;
|
|
4522
4522
|
return `${Math.round(ms)}ms`;
|
|
4523
4523
|
}
|
|
4524
|
-
function parseHex$
|
|
4524
|
+
function parseHex$2(color) {
|
|
4525
4525
|
const int = Number.parseInt(color.replace("#", ""), 16);
|
|
4526
4526
|
return Number.isNaN(int) ? {
|
|
4527
4527
|
r: 255,
|
|
@@ -4533,18 +4533,18 @@ function parseHex$1(color) {
|
|
|
4533
4533
|
b: int & 255
|
|
4534
4534
|
};
|
|
4535
4535
|
}
|
|
4536
|
-
function hex$
|
|
4537
|
-
const { r, g, b } = parseHex$
|
|
4536
|
+
function hex$2(color) {
|
|
4537
|
+
const { r, g, b } = parseHex$2(color);
|
|
4538
4538
|
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[0m`;
|
|
4539
4539
|
}
|
|
4540
4540
|
({
|
|
4541
|
-
lid: hex$
|
|
4542
|
-
woodTop: hex$
|
|
4543
|
-
woodMid: hex$
|
|
4544
|
-
woodBase: hex$
|
|
4545
|
-
eye: hex$
|
|
4546
|
-
highlight: hex$
|
|
4547
|
-
blush: hex$
|
|
4541
|
+
lid: hex$2("#F55A17"),
|
|
4542
|
+
woodTop: hex$2("#F5A217"),
|
|
4543
|
+
woodMid: hex$2("#F58517"),
|
|
4544
|
+
woodBase: hex$2("#B45309"),
|
|
4545
|
+
eye: hex$2("#FFFFFF"),
|
|
4546
|
+
highlight: hex$2("#adadc6"),
|
|
4547
|
+
blush: hex$2("#FDA4AF")
|
|
4548
4548
|
});
|
|
4549
4549
|
function maskString(value, start = 8, end = 4) {
|
|
4550
4550
|
if (value.length <= start + end) return value;
|
|
@@ -4653,9 +4653,32 @@ async function disconnect({ sessionId, token, studioUrl }) {
|
|
|
4653
4653
|
const visitorDepths = {
|
|
4654
4654
|
deep: "deep"
|
|
4655
4655
|
};
|
|
4656
|
+
function createSchema(props) {
|
|
4657
|
+
if (props["type"] === "object") return {
|
|
4658
|
+
properties: [],
|
|
4659
|
+
...props,
|
|
4660
|
+
kind: "Schema"
|
|
4661
|
+
};
|
|
4662
|
+
return {
|
|
4663
|
+
...props,
|
|
4664
|
+
kind: "Schema"
|
|
4665
|
+
};
|
|
4666
|
+
}
|
|
4667
|
+
function createProperty(props) {
|
|
4668
|
+
return {
|
|
4669
|
+
required: false,
|
|
4670
|
+
...props,
|
|
4671
|
+
kind: "Property"
|
|
4672
|
+
};
|
|
4673
|
+
}
|
|
4656
4674
|
function narrowSchema(node, type) {
|
|
4657
4675
|
return (node == null ? void 0 : node.type) === type ? node : void 0;
|
|
4658
4676
|
}
|
|
4677
|
+
function isKind(kind) {
|
|
4678
|
+
return (node) => node.kind === kind;
|
|
4679
|
+
}
|
|
4680
|
+
const isOperationNode = isKind("Operation");
|
|
4681
|
+
const isSchemaNode = isKind("Schema");
|
|
4659
4682
|
function definePrinter(build) {
|
|
4660
4683
|
return (options) => {
|
|
4661
4684
|
const { name, options: resolvedOptions, nodes } = build(options != null ? options : {});
|
|
@@ -4674,6 +4697,49 @@ function definePrinter(build) {
|
|
|
4674
4697
|
};
|
|
4675
4698
|
};
|
|
4676
4699
|
}
|
|
4700
|
+
function toCamelOrPascal$f(text, pascal) {
|
|
4701
|
+
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
4702
|
+
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
4703
|
+
if (i === 0 && true) return word.charAt(0).toLowerCase() + word.slice(1);
|
|
4704
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
4705
|
+
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
4706
|
+
}
|
|
4707
|
+
function applyToFileParts$f(text, transformPart) {
|
|
4708
|
+
const parts = text.split(".");
|
|
4709
|
+
return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
|
|
4710
|
+
}
|
|
4711
|
+
function camelCase$f(text, { isFile, prefix = "", suffix = "" } = {}) {
|
|
4712
|
+
if (isFile) return applyToFileParts$f(text, (part, isLast) => camelCase$f(part, isLast ? {
|
|
4713
|
+
prefix,
|
|
4714
|
+
suffix
|
|
4715
|
+
} : {}));
|
|
4716
|
+
return toCamelOrPascal$f(`${prefix} ${text} ${suffix}`);
|
|
4717
|
+
}
|
|
4718
|
+
function parseHex$1(color) {
|
|
4719
|
+
const int = Number.parseInt(color.replace("#", ""), 16);
|
|
4720
|
+
return Number.isNaN(int) ? {
|
|
4721
|
+
r: 255,
|
|
4722
|
+
g: 255,
|
|
4723
|
+
b: 255
|
|
4724
|
+
} : {
|
|
4725
|
+
r: int >> 16 & 255,
|
|
4726
|
+
g: int >> 8 & 255,
|
|
4727
|
+
b: int & 255
|
|
4728
|
+
};
|
|
4729
|
+
}
|
|
4730
|
+
function hex$1(color) {
|
|
4731
|
+
const { r, g, b } = parseHex$1(color);
|
|
4732
|
+
return (text) => `\x1B[38;2;${r};${g};${b}m${text}\x1B[0m`;
|
|
4733
|
+
}
|
|
4734
|
+
hex$1("#F55A17"), hex$1("#F5A217"), hex$1("#F58517"), hex$1("#B45309"), hex$1("#FFFFFF"), hex$1("#adadc6"), hex$1("#FDA4AF");
|
|
4735
|
+
function isValidVarName$c(name) {
|
|
4736
|
+
try {
|
|
4737
|
+
new Function(`var ${name}`);
|
|
4738
|
+
} catch {
|
|
4739
|
+
return false;
|
|
4740
|
+
}
|
|
4741
|
+
return true;
|
|
4742
|
+
}
|
|
4677
4743
|
const plainStringTypes = /* @__PURE__ */ new Set([
|
|
4678
4744
|
"string",
|
|
4679
4745
|
"uuid",
|
|
@@ -4688,6 +4754,16 @@ function isPlainStringType(node) {
|
|
|
4688
4754
|
if (temporal) return temporal.representation !== "date";
|
|
4689
4755
|
return false;
|
|
4690
4756
|
}
|
|
4757
|
+
function applyParamsCasing$1(params, casing) {
|
|
4758
|
+
if (!casing) return params;
|
|
4759
|
+
return params.map((param) => {
|
|
4760
|
+
const transformed = casing === "camelcase" || !isValidVarName$c(param.name) ? camelCase$f(param.name) : param.name;
|
|
4761
|
+
return {
|
|
4762
|
+
...param,
|
|
4763
|
+
name: transformed
|
|
4764
|
+
};
|
|
4765
|
+
});
|
|
4766
|
+
}
|
|
4691
4767
|
function createLimit(concurrency) {
|
|
4692
4768
|
let active = 0;
|
|
4693
4769
|
const queue = [];
|
|
@@ -5880,7 +5956,7 @@ const fsStorage = defineStorage(() => ({
|
|
|
5880
5956
|
await clean(resolve(base));
|
|
5881
5957
|
}
|
|
5882
5958
|
}));
|
|
5883
|
-
var version$1 = "5.0.0-alpha.
|
|
5959
|
+
var version$1 = "5.0.0-alpha.5";
|
|
5884
5960
|
function getDiagnosticInfo() {
|
|
5885
5961
|
return {
|
|
5886
5962
|
nodeVersion: version$2,
|
|
@@ -6168,6 +6244,34 @@ function inputToAdapterSource(config) {
|
|
|
6168
6244
|
path: resolve(config.root, config.input.path)
|
|
6169
6245
|
};
|
|
6170
6246
|
}
|
|
6247
|
+
function defineGenerator(generator) {
|
|
6248
|
+
if (generator.type === "react") return {
|
|
6249
|
+
version: "2",
|
|
6250
|
+
Operations() {
|
|
6251
|
+
return null;
|
|
6252
|
+
},
|
|
6253
|
+
Operation() {
|
|
6254
|
+
return null;
|
|
6255
|
+
},
|
|
6256
|
+
Schema() {
|
|
6257
|
+
return null;
|
|
6258
|
+
},
|
|
6259
|
+
...generator
|
|
6260
|
+
};
|
|
6261
|
+
return {
|
|
6262
|
+
version: "2",
|
|
6263
|
+
async operations() {
|
|
6264
|
+
return [];
|
|
6265
|
+
},
|
|
6266
|
+
async operation() {
|
|
6267
|
+
return [];
|
|
6268
|
+
},
|
|
6269
|
+
async schema() {
|
|
6270
|
+
return [];
|
|
6271
|
+
},
|
|
6272
|
+
...generator
|
|
6273
|
+
};
|
|
6274
|
+
}
|
|
6171
6275
|
function definePlugin(build2) {
|
|
6172
6276
|
return (options) => build2(options != null ? options : {});
|
|
6173
6277
|
}
|
|
@@ -6614,8 +6718,55 @@ async function detectLinter() {
|
|
|
6614
6718
|
"eslint"
|
|
6615
6719
|
]) if (await isLinterAvailable(linter)) return linter;
|
|
6616
6720
|
}
|
|
6721
|
+
function matchesOperationPattern(node, type, pattern) {
|
|
6722
|
+
switch (type) {
|
|
6723
|
+
case "tag":
|
|
6724
|
+
return node.tags.some((tag) => !!tag.match(pattern));
|
|
6725
|
+
case "operationId":
|
|
6726
|
+
return !!node.operationId.match(pattern);
|
|
6727
|
+
case "path":
|
|
6728
|
+
return !!node.path.match(pattern);
|
|
6729
|
+
case "method":
|
|
6730
|
+
return !!node.method.toLowerCase().match(pattern);
|
|
6731
|
+
default:
|
|
6732
|
+
return false;
|
|
6733
|
+
}
|
|
6734
|
+
}
|
|
6735
|
+
function matchesSchemaPattern(node, type, pattern) {
|
|
6736
|
+
switch (type) {
|
|
6737
|
+
case "schemaName":
|
|
6738
|
+
return node.name ? !!node.name.match(pattern) : false;
|
|
6739
|
+
default:
|
|
6740
|
+
return null;
|
|
6741
|
+
}
|
|
6742
|
+
}
|
|
6743
|
+
function resolveOptions(node, { options, exclude = [], include, override = [] }) {
|
|
6744
|
+
var _a2, _b2;
|
|
6745
|
+
if (isOperationNode(node)) {
|
|
6746
|
+
if (exclude.some(({ type, pattern }) => matchesOperationPattern(node, type, pattern))) return null;
|
|
6747
|
+
if (include && !include.some(({ type, pattern }) => matchesOperationPattern(node, type, pattern))) return null;
|
|
6748
|
+
const overrideOptions = (_a2 = override.find(({ type, pattern }) => matchesOperationPattern(node, type, pattern))) == null ? void 0 : _a2.options;
|
|
6749
|
+
return {
|
|
6750
|
+
...options,
|
|
6751
|
+
...overrideOptions
|
|
6752
|
+
};
|
|
6753
|
+
}
|
|
6754
|
+
if (isSchemaNode(node)) {
|
|
6755
|
+
if (exclude.some(({ type, pattern }) => matchesSchemaPattern(node, type, pattern) === true)) return null;
|
|
6756
|
+
if (include) {
|
|
6757
|
+
const applicable = include.map(({ type, pattern }) => matchesSchemaPattern(node, type, pattern)).filter((r) => r !== null);
|
|
6758
|
+
if (applicable.length > 0 && !applicable.includes(true)) return null;
|
|
6759
|
+
}
|
|
6760
|
+
const overrideOptions = (_b2 = override.find(({ type, pattern }) => matchesSchemaPattern(node, type, pattern) === true)) == null ? void 0 : _b2.options;
|
|
6761
|
+
return {
|
|
6762
|
+
...options,
|
|
6763
|
+
...overrideOptions
|
|
6764
|
+
};
|
|
6765
|
+
}
|
|
6766
|
+
return options;
|
|
6767
|
+
}
|
|
6617
6768
|
|
|
6618
|
-
var version = "5.0.0-alpha.
|
|
6769
|
+
var version = "5.0.0-alpha.5";
|
|
6619
6770
|
|
|
6620
6771
|
function isCommandMessage(msg) {
|
|
6621
6772
|
return msg.type === "command";
|
|
@@ -7827,7 +7978,7 @@ async function buildOperations(operationsOrNodes, options) {
|
|
|
7827
7978
|
if (isBuildOperationsV1Options(options)) {
|
|
7828
7979
|
const { generator, Component } = options;
|
|
7829
7980
|
const { pluginManager, oas, mode } = generator.context;
|
|
7830
|
-
await fabricChild.render(/* @__PURE__ */ jsx(
|
|
7981
|
+
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
7831
7982
|
meta: {
|
|
7832
7983
|
pluginManager,
|
|
7833
7984
|
plugin,
|
|
@@ -7843,17 +7994,17 @@ async function buildOperations(operationsOrNodes, options) {
|
|
|
7843
7994
|
}));
|
|
7844
7995
|
} else {
|
|
7845
7996
|
const { Component, adapter } = options;
|
|
7846
|
-
await fabricChild.render(/* @__PURE__ */ jsx(
|
|
7997
|
+
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
7847
7998
|
meta: { plugin },
|
|
7848
7999
|
children: /* @__PURE__ */ jsx(Component, {
|
|
7849
8000
|
config,
|
|
7850
8001
|
adapter,
|
|
7851
8002
|
nodes: operationsOrNodes,
|
|
7852
|
-
options:
|
|
8003
|
+
options: options.options
|
|
7853
8004
|
})
|
|
7854
8005
|
}));
|
|
7855
8006
|
}
|
|
7856
|
-
|
|
8007
|
+
fabric.context.fileManager.upsert(...fabricChild.files);
|
|
7857
8008
|
fabricChild.unmount();
|
|
7858
8009
|
}
|
|
7859
8010
|
function isBuildOperationV1Options(options) {
|
|
@@ -7867,7 +8018,7 @@ async function buildOperation(operationOrNode, options) {
|
|
|
7867
8018
|
if (isBuildOperationV1Options(options)) {
|
|
7868
8019
|
const { generator, Component } = options;
|
|
7869
8020
|
const { pluginManager, oas, mode } = generator.context;
|
|
7870
|
-
await fabricChild.render(/* @__PURE__ */ jsx(
|
|
8021
|
+
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
7871
8022
|
meta: {
|
|
7872
8023
|
pluginManager,
|
|
7873
8024
|
plugin,
|
|
@@ -7883,7 +8034,7 @@ async function buildOperation(operationOrNode, options) {
|
|
|
7883
8034
|
}));
|
|
7884
8035
|
} else {
|
|
7885
8036
|
const { Component, adapter, pluginManager, mode } = options;
|
|
7886
|
-
await fabricChild.render(/* @__PURE__ */ jsx(
|
|
8037
|
+
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
7887
8038
|
meta: {
|
|
7888
8039
|
plugin,
|
|
7889
8040
|
pluginManager,
|
|
@@ -7893,11 +8044,11 @@ async function buildOperation(operationOrNode, options) {
|
|
|
7893
8044
|
config,
|
|
7894
8045
|
adapter,
|
|
7895
8046
|
node: operationOrNode,
|
|
7896
|
-
options:
|
|
8047
|
+
options: options.options
|
|
7897
8048
|
})
|
|
7898
8049
|
}));
|
|
7899
8050
|
}
|
|
7900
|
-
|
|
8051
|
+
fabric.context.fileManager.upsert(...fabricChild.files);
|
|
7901
8052
|
fabricChild.unmount();
|
|
7902
8053
|
}
|
|
7903
8054
|
function isBuildSchemaV1Options(options) {
|
|
@@ -7911,7 +8062,7 @@ async function buildSchema(schema, options) {
|
|
|
7911
8062
|
if (isBuildSchemaV1Options(options)) {
|
|
7912
8063
|
const { generator, Component } = options;
|
|
7913
8064
|
const { pluginManager, oas, mode } = generator.context;
|
|
7914
|
-
await fabricChild.render(/* @__PURE__ */ jsx(
|
|
8065
|
+
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
7915
8066
|
meta: {
|
|
7916
8067
|
pluginManager,
|
|
7917
8068
|
plugin,
|
|
@@ -7927,7 +8078,7 @@ async function buildSchema(schema, options) {
|
|
|
7927
8078
|
}));
|
|
7928
8079
|
} else {
|
|
7929
8080
|
const { Component, adapter, pluginManager, mode } = options;
|
|
7930
|
-
await fabricChild.render(/* @__PURE__ */ jsx(
|
|
8081
|
+
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
7931
8082
|
meta: {
|
|
7932
8083
|
plugin,
|
|
7933
8084
|
pluginManager,
|
|
@@ -7937,11 +8088,11 @@ async function buildSchema(schema, options) {
|
|
|
7937
8088
|
config,
|
|
7938
8089
|
adapter,
|
|
7939
8090
|
node: schema,
|
|
7940
|
-
options:
|
|
8091
|
+
options: options.options
|
|
7941
8092
|
})
|
|
7942
8093
|
}));
|
|
7943
8094
|
}
|
|
7944
|
-
|
|
8095
|
+
fabric.context.fileManager.upsert(...fabricChild.files);
|
|
7945
8096
|
fabricChild.unmount();
|
|
7946
8097
|
}
|
|
7947
8098
|
const GENERATOR_CONCURRENCY = 3;
|
|
@@ -9750,10 +9901,9 @@ ${operations.map(({ operation, name: methodName, typeSchemas, zodSchemas }) => g
|
|
|
9750
9901
|
StaticClassClient.getParams = Client.getParams;
|
|
9751
9902
|
|
|
9752
9903
|
function createGenerator(generator) {
|
|
9753
|
-
var _a;
|
|
9754
9904
|
return {
|
|
9755
9905
|
type: "core",
|
|
9756
|
-
version:
|
|
9906
|
+
version: "1",
|
|
9757
9907
|
async operations() {
|
|
9758
9908
|
return [];
|
|
9759
9909
|
},
|
|
@@ -9767,10 +9917,9 @@ function createGenerator(generator) {
|
|
|
9767
9917
|
};
|
|
9768
9918
|
}
|
|
9769
9919
|
function createReactGenerator(generator) {
|
|
9770
|
-
var _a;
|
|
9771
9920
|
return {
|
|
9772
9921
|
type: "react",
|
|
9773
|
-
version:
|
|
9922
|
+
version: "1",
|
|
9774
9923
|
Operations() {
|
|
9775
9924
|
return null;
|
|
9776
9925
|
},
|
|
@@ -209050,8 +209199,9 @@ const keywordTypeNodes = {
|
|
|
209050
209199
|
never: factory.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword)
|
|
209051
209200
|
};
|
|
209052
209201
|
function createUrlTemplateType(path) {
|
|
209053
|
-
|
|
209054
|
-
|
|
209202
|
+
const normalized = path.replace(/:([^/]+)/g, "{$1}");
|
|
209203
|
+
if (!normalized.includes("{")) return factory.createLiteralTypeNode(factory.createStringLiteral(normalized));
|
|
209204
|
+
const segments = normalized.split(/(\{[^}]+\})/);
|
|
209055
209205
|
const parts = [];
|
|
209056
209206
|
const parameterIndices = [];
|
|
209057
209207
|
segments.forEach((segment) => {
|
|
@@ -209460,32 +209610,42 @@ function Type$1({ name, typedName, tree, keysToOmit, schema, optionalType, array
|
|
|
209460
209610
|
}
|
|
209461
209611
|
|
|
209462
209612
|
function useKubb() {
|
|
209463
|
-
const { meta } =
|
|
209613
|
+
const { meta } = useFabric();
|
|
209614
|
+
const defaultPluginName = meta.plugin.name;
|
|
209464
209615
|
return {
|
|
209465
209616
|
plugin: meta.plugin,
|
|
209466
209617
|
mode: meta.mode,
|
|
209467
209618
|
config: meta.pluginManager.config,
|
|
209468
|
-
getPluginByName: meta.pluginManager.getPluginByName.
|
|
209469
|
-
getFile: meta.pluginManager.getFile.
|
|
209470
|
-
|
|
209471
|
-
|
|
209619
|
+
getPluginByName: (pluginName = defaultPluginName) => meta.pluginManager.getPluginByName.call(meta.pluginManager, pluginName),
|
|
209620
|
+
getFile: ({ pluginName = defaultPluginName, ...rest }) => meta.pluginManager.getFile.call(meta.pluginManager, {
|
|
209621
|
+
pluginName,
|
|
209622
|
+
...rest
|
|
209623
|
+
}),
|
|
209624
|
+
resolveName: ({ pluginName = defaultPluginName, ...rest }) => meta.pluginManager.resolveName.call(meta.pluginManager, {
|
|
209625
|
+
pluginName,
|
|
209626
|
+
...rest
|
|
209627
|
+
}),
|
|
209628
|
+
resolvePath: ({ pluginName = defaultPluginName, ...rest }) => meta.pluginManager.resolvePath.call(meta.pluginManager, {
|
|
209629
|
+
pluginName,
|
|
209630
|
+
...rest
|
|
209631
|
+
})
|
|
209472
209632
|
};
|
|
209473
209633
|
}
|
|
209474
209634
|
function useMode() {
|
|
209475
|
-
const { meta } =
|
|
209635
|
+
const { meta } = useFabric();
|
|
209476
209636
|
return meta.mode;
|
|
209477
209637
|
}
|
|
209478
209638
|
function usePlugin() {
|
|
209479
|
-
const { meta } =
|
|
209639
|
+
const { meta } = useFabric();
|
|
209480
209640
|
return meta.plugin;
|
|
209481
209641
|
}
|
|
209482
209642
|
function usePluginManager() {
|
|
209483
|
-
const { meta } =
|
|
209643
|
+
const { meta } = useFabric();
|
|
209484
209644
|
return meta.pluginManager;
|
|
209485
209645
|
}
|
|
209486
209646
|
|
|
209487
209647
|
function useOas() {
|
|
209488
|
-
const { meta } =
|
|
209648
|
+
const { meta } = useFabric();
|
|
209489
209649
|
return meta.oas;
|
|
209490
209650
|
}
|
|
209491
209651
|
function useOperationManager(generator) {
|
|
@@ -209826,7 +209986,6 @@ function printResponseSchema({ baseName, schemas, pluginManager, unknownType })
|
|
|
209826
209986
|
}
|
|
209827
209987
|
const typeGenerator$1 = createReactGenerator({
|
|
209828
209988
|
name: "typescript",
|
|
209829
|
-
version: "1",
|
|
209830
209989
|
Operation({ operation, generator, plugin }) {
|
|
209831
209990
|
const { options, options: { mapper, enumType, enumKeyCasing, syntaxType, optionalType, arrayType, unknownType, paramsCasing } } = plugin;
|
|
209832
209991
|
const mode = useMode();
|
|
@@ -210069,13 +210228,17 @@ const printerTs = definePrinter((options) => ({
|
|
|
210069
210228
|
any: () => keywordTypeNodes.any,
|
|
210070
210229
|
unknown: () => keywordTypeNodes.unknown,
|
|
210071
210230
|
void: () => keywordTypeNodes.void,
|
|
210231
|
+
never: () => keywordTypeNodes.never,
|
|
210072
210232
|
boolean: () => keywordTypeNodes.boolean,
|
|
210073
210233
|
null: () => keywordTypeNodes.null,
|
|
210074
210234
|
blob: () => createTypeReferenceNode("Blob", []),
|
|
210075
210235
|
string: () => keywordTypeNodes.string,
|
|
210076
210236
|
uuid: () => keywordTypeNodes.string,
|
|
210077
210237
|
email: () => keywordTypeNodes.string,
|
|
210078
|
-
url: () =>
|
|
210238
|
+
url: (node) => {
|
|
210239
|
+
if (node.path) return createUrlTemplateType(node.path);
|
|
210240
|
+
return keywordTypeNodes.string;
|
|
210241
|
+
},
|
|
210079
210242
|
datetime: () => keywordTypeNodes.string,
|
|
210080
210243
|
number: () => keywordTypeNodes.number,
|
|
210081
210244
|
integer: () => keywordTypeNodes.number,
|
|
@@ -210137,6 +210300,7 @@ const printerTs = definePrinter((options) => ({
|
|
|
210137
210300
|
const { print } = this;
|
|
210138
210301
|
const propertyNodes = node.properties.map((prop) => {
|
|
210139
210302
|
var _a;
|
|
210303
|
+
if (this.options.mapper && Object.hasOwn(this.options.mapper, prop.name)) return this.options.mapper[prop.name];
|
|
210140
210304
|
const baseType = (_a = print(prop.schema)) != null ? _a : keywordTypeNodes.unknown;
|
|
210141
210305
|
const type = buildPropertyType(prop.schema, baseType, this.options.optionalType);
|
|
210142
210306
|
return appendJSDocToNode({
|
|
@@ -210155,7 +210319,7 @@ const printerTs = definePrinter((options) => ({
|
|
|
210155
210319
|
}
|
|
210156
210320
|
}
|
|
210157
210321
|
}));
|
|
210158
|
-
function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, syntaxType, enumType, enumKeyCasing, ...rest }) {
|
|
210322
|
+
function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, syntaxType, enumType, enumKeyCasing, mapper, ...rest }) {
|
|
210159
210323
|
const typeNodes = [];
|
|
210160
210324
|
const description = rest.description || (node == null ? void 0 : node.description);
|
|
210161
210325
|
const enumSchemaNodes = collect(node, { schema(n) {
|
|
@@ -210164,7 +210328,8 @@ function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, synt
|
|
|
210164
210328
|
let type = printerTs({
|
|
210165
210329
|
optionalType,
|
|
210166
210330
|
arrayType,
|
|
210167
|
-
enumType
|
|
210331
|
+
enumType,
|
|
210332
|
+
mapper
|
|
210168
210333
|
}).print(node);
|
|
210169
210334
|
if (!type) return;
|
|
210170
210335
|
if (["asConst", "asPascalConst"].includes(enumType) && enumSchemaNodes.length > 0) {
|
|
@@ -210254,28 +210419,144 @@ function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, synt
|
|
|
210254
210419
|
children: safePrint(...typeNodes)
|
|
210255
210420
|
})] });
|
|
210256
210421
|
}
|
|
210257
|
-
|
|
210422
|
+
function buildParamsSchema({ params, operationId, resolveName }) {
|
|
210423
|
+
return createSchema({
|
|
210424
|
+
type: "object",
|
|
210425
|
+
properties: params.map((param) => createProperty({
|
|
210426
|
+
name: param.name,
|
|
210427
|
+
schema: createSchema({
|
|
210428
|
+
type: "ref",
|
|
210429
|
+
name: resolveName({
|
|
210430
|
+
name: `${operationId} ${param.name}`,
|
|
210431
|
+
type: "function"
|
|
210432
|
+
}),
|
|
210433
|
+
optional: !param.required
|
|
210434
|
+
})
|
|
210435
|
+
}))
|
|
210436
|
+
});
|
|
210437
|
+
}
|
|
210438
|
+
function buildDataSchemaNode({ node, resolveName }) {
|
|
210439
|
+
const pathParams = node.parameters.filter((p) => p.in === "path");
|
|
210440
|
+
const queryParams = node.parameters.filter((p) => p.in === "query");
|
|
210441
|
+
const headerParams = node.parameters.filter((p) => p.in === "header");
|
|
210442
|
+
return createSchema({
|
|
210443
|
+
type: "object",
|
|
210444
|
+
properties: [
|
|
210445
|
+
createProperty({
|
|
210446
|
+
name: "data",
|
|
210447
|
+
schema: node.requestBody ? createSchema({
|
|
210448
|
+
type: "ref",
|
|
210449
|
+
name: resolveName({
|
|
210450
|
+
name: `${node.operationId} MutationRequest`,
|
|
210451
|
+
type: "function"
|
|
210452
|
+
}),
|
|
210453
|
+
optional: true
|
|
210454
|
+
}) : createSchema({
|
|
210455
|
+
type: "never",
|
|
210456
|
+
optional: true
|
|
210457
|
+
})
|
|
210458
|
+
}),
|
|
210459
|
+
createProperty({
|
|
210460
|
+
name: "pathParams",
|
|
210461
|
+
schema: pathParams.length > 0 ? buildParamsSchema({
|
|
210462
|
+
params: pathParams,
|
|
210463
|
+
operationId: node.operationId,
|
|
210464
|
+
resolveName
|
|
210465
|
+
}) : createSchema({
|
|
210466
|
+
type: "never",
|
|
210467
|
+
optional: true
|
|
210468
|
+
})
|
|
210469
|
+
}),
|
|
210470
|
+
createProperty({
|
|
210471
|
+
name: "queryParams",
|
|
210472
|
+
schema: queryParams.length > 0 ? createSchema({
|
|
210473
|
+
...buildParamsSchema({
|
|
210474
|
+
params: queryParams,
|
|
210475
|
+
operationId: node.operationId,
|
|
210476
|
+
resolveName
|
|
210477
|
+
}),
|
|
210478
|
+
optional: true
|
|
210479
|
+
}) : createSchema({
|
|
210480
|
+
type: "never",
|
|
210481
|
+
optional: true
|
|
210482
|
+
})
|
|
210483
|
+
}),
|
|
210484
|
+
createProperty({
|
|
210485
|
+
name: "headerParams",
|
|
210486
|
+
schema: headerParams.length > 0 ? createSchema({
|
|
210487
|
+
...buildParamsSchema({
|
|
210488
|
+
params: headerParams,
|
|
210489
|
+
operationId: node.operationId,
|
|
210490
|
+
resolveName
|
|
210491
|
+
}),
|
|
210492
|
+
optional: true
|
|
210493
|
+
}) : createSchema({
|
|
210494
|
+
type: "never",
|
|
210495
|
+
optional: true
|
|
210496
|
+
})
|
|
210497
|
+
}),
|
|
210498
|
+
createProperty({
|
|
210499
|
+
name: "url",
|
|
210500
|
+
schema: createSchema({
|
|
210501
|
+
type: "url",
|
|
210502
|
+
path: node.path
|
|
210503
|
+
})
|
|
210504
|
+
})
|
|
210505
|
+
]
|
|
210506
|
+
});
|
|
210507
|
+
}
|
|
210508
|
+
function buildResponsesSchemaNode({ node, resolveName }) {
|
|
210509
|
+
const responsesWithSchema = node.responses.filter((res) => res.schema);
|
|
210510
|
+
if (responsesWithSchema.length === 0) return null;
|
|
210511
|
+
return createSchema({
|
|
210512
|
+
type: "object",
|
|
210513
|
+
properties: responsesWithSchema.map((res) => createProperty({
|
|
210514
|
+
name: String(res.statusCode),
|
|
210515
|
+
schema: createSchema({
|
|
210516
|
+
type: "ref",
|
|
210517
|
+
name: resolveName({
|
|
210518
|
+
name: `${node.operationId} ${res.statusCode}`,
|
|
210519
|
+
type: "function"
|
|
210520
|
+
})
|
|
210521
|
+
})
|
|
210522
|
+
}))
|
|
210523
|
+
});
|
|
210524
|
+
}
|
|
210525
|
+
function buildResponseUnionSchemaNode({ node, resolveName }) {
|
|
210526
|
+
const responsesWithSchema = node.responses.filter((res) => res.schema);
|
|
210527
|
+
if (responsesWithSchema.length === 0) return null;
|
|
210528
|
+
return createSchema({
|
|
210529
|
+
type: "union",
|
|
210530
|
+
members: responsesWithSchema.map((res) => createSchema({
|
|
210531
|
+
type: "ref",
|
|
210532
|
+
name: resolveName({
|
|
210533
|
+
name: `${node.operationId} ${res.statusCode}`,
|
|
210534
|
+
type: "function"
|
|
210535
|
+
})
|
|
210536
|
+
}))
|
|
210537
|
+
});
|
|
210538
|
+
}
|
|
210539
|
+
const typeGenerator = defineGenerator({
|
|
210258
210540
|
name: "typescript",
|
|
210259
|
-
|
|
210541
|
+
type: "react",
|
|
210260
210542
|
Operation({ node, adapter, options }) {
|
|
210261
|
-
const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType } = options;
|
|
210262
|
-
const {
|
|
210543
|
+
const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, mapper } = options;
|
|
210544
|
+
const { mode, getFile, resolveName } = useKubb();
|
|
210263
210545
|
const file = getFile({
|
|
210264
210546
|
name: node.operationId,
|
|
210265
|
-
pluginName: plugin.name,
|
|
210266
210547
|
extname: ".ts",
|
|
210267
210548
|
mode
|
|
210268
210549
|
});
|
|
210550
|
+
const params = applyParamsCasing$1(node.parameters, paramsCasing);
|
|
210269
210551
|
function renderSchemaType({ node: schemaNode, name, typedName, description }) {
|
|
210552
|
+
if (!schemaNode) return null;
|
|
210270
210553
|
const imports = adapter.getImports(schemaNode, (schemaName) => ({
|
|
210271
210554
|
name: resolveName({
|
|
210272
210555
|
name: schemaName,
|
|
210273
|
-
pluginName: plugin.name,
|
|
210274
210556
|
type: "type"
|
|
210275
210557
|
}),
|
|
210276
210558
|
path: getFile({
|
|
210277
210559
|
name: schemaName,
|
|
210278
|
-
pluginName: plugin.name,
|
|
210279
210560
|
extname: ".ts",
|
|
210280
210561
|
mode
|
|
210281
210562
|
}).path
|
|
@@ -210298,63 +210579,90 @@ const typeGenerator = createReactGenerator({
|
|
|
210298
210579
|
enumKeyCasing,
|
|
210299
210580
|
optionalType,
|
|
210300
210581
|
arrayType,
|
|
210301
|
-
syntaxType
|
|
210582
|
+
syntaxType,
|
|
210583
|
+
mapper
|
|
210302
210584
|
})] });
|
|
210303
210585
|
}
|
|
210304
|
-
const paramTypes =
|
|
210305
|
-
|
|
210586
|
+
const paramTypes = params.map((param) => renderSchemaType({
|
|
210587
|
+
node: param.schema,
|
|
210588
|
+
name: resolveName({
|
|
210306
210589
|
name: `${node.operationId} ${param.name}`,
|
|
210307
|
-
pluginName: plugin.name,
|
|
210308
210590
|
type: "function"
|
|
210309
|
-
})
|
|
210310
|
-
|
|
210591
|
+
}),
|
|
210592
|
+
typedName: resolveName({
|
|
210311
210593
|
name: `${node.operationId} ${param.name}`,
|
|
210312
|
-
pluginName: plugin.name,
|
|
210313
210594
|
type: "type"
|
|
210314
|
-
})
|
|
210315
|
-
|
|
210316
|
-
|
|
210317
|
-
|
|
210318
|
-
|
|
210319
|
-
|
|
210595
|
+
})
|
|
210596
|
+
}));
|
|
210597
|
+
const responseTypes = node.responses.filter((res) => res.schema).map((res) => renderSchemaType({
|
|
210598
|
+
node: res.schema,
|
|
210599
|
+
name: resolveName({
|
|
210600
|
+
name: `${node.operationId} ${res.statusCode}`,
|
|
210601
|
+
type: "function"
|
|
210602
|
+
}),
|
|
210603
|
+
typedName: resolveName({
|
|
210604
|
+
name: `${node.operationId} ${res.statusCode}`,
|
|
210605
|
+
type: "type"
|
|
210606
|
+
}),
|
|
210607
|
+
description: res.description
|
|
210608
|
+
}));
|
|
210609
|
+
const requestType = node.requestBody ? renderSchemaType({
|
|
210610
|
+
node: node.requestBody,
|
|
210611
|
+
name: resolveName({
|
|
210612
|
+
name: `${node.operationId} MutationRequest`,
|
|
210613
|
+
type: "function"
|
|
210614
|
+
}),
|
|
210615
|
+
typedName: resolveName({
|
|
210616
|
+
name: `${node.operationId} MutationRequest`,
|
|
210617
|
+
type: "type"
|
|
210618
|
+
}),
|
|
210619
|
+
description: node.requestBody.description
|
|
210620
|
+
}) : null;
|
|
210621
|
+
const dataType = renderSchemaType({
|
|
210622
|
+
node: buildDataSchemaNode({
|
|
210623
|
+
node: {
|
|
210624
|
+
...node,
|
|
210625
|
+
parameters: params
|
|
210626
|
+
},
|
|
210627
|
+
resolveName
|
|
210628
|
+
}),
|
|
210629
|
+
name: resolveName({
|
|
210630
|
+
name: `${node.operationId} Data`,
|
|
210631
|
+
type: "function"
|
|
210632
|
+
}),
|
|
210633
|
+
typedName: resolveName({
|
|
210634
|
+
name: `${node.operationId} Data`,
|
|
210635
|
+
type: "type"
|
|
210636
|
+
})
|
|
210320
210637
|
});
|
|
210321
|
-
const
|
|
210322
|
-
|
|
210323
|
-
|
|
210324
|
-
|
|
210325
|
-
|
|
210326
|
-
|
|
210327
|
-
|
|
210328
|
-
|
|
210329
|
-
|
|
210330
|
-
|
|
210331
|
-
|
|
210332
|
-
|
|
210333
|
-
|
|
210334
|
-
type: "type"
|
|
210335
|
-
}),
|
|
210336
|
-
description: res.description
|
|
210337
|
-
});
|
|
210638
|
+
const responsesType = renderSchemaType({
|
|
210639
|
+
node: buildResponsesSchemaNode({
|
|
210640
|
+
node,
|
|
210641
|
+
resolveName
|
|
210642
|
+
}),
|
|
210643
|
+
name: resolveName({
|
|
210644
|
+
name: `${node.operationId} Responses`,
|
|
210645
|
+
type: "function"
|
|
210646
|
+
}),
|
|
210647
|
+
typedName: resolveName({
|
|
210648
|
+
name: `${node.operationId} Responses`,
|
|
210649
|
+
type: "type"
|
|
210650
|
+
})
|
|
210338
210651
|
});
|
|
210339
|
-
const
|
|
210340
|
-
|
|
210341
|
-
|
|
210342
|
-
|
|
210343
|
-
|
|
210652
|
+
const responseType = renderSchemaType({
|
|
210653
|
+
node: buildResponseUnionSchemaNode({
|
|
210654
|
+
node,
|
|
210655
|
+
resolveName
|
|
210656
|
+
}),
|
|
210657
|
+
name: resolveName({
|
|
210658
|
+
name: `${node.operationId} Response`,
|
|
210344
210659
|
type: "function"
|
|
210345
|
-
})
|
|
210346
|
-
|
|
210347
|
-
name:
|
|
210348
|
-
pluginName: plugin.name,
|
|
210660
|
+
}),
|
|
210661
|
+
typedName: resolveName({
|
|
210662
|
+
name: `${node.operationId} Response`,
|
|
210349
210663
|
type: "type"
|
|
210350
|
-
})
|
|
210351
|
-
|
|
210352
|
-
node: node.requestBody,
|
|
210353
|
-
name: resolvedName,
|
|
210354
|
-
typedName,
|
|
210355
|
-
description: node.requestBody.description
|
|
210356
|
-
});
|
|
210357
|
-
})() : null;
|
|
210664
|
+
})
|
|
210665
|
+
});
|
|
210358
210666
|
return /* @__PURE__ */ jsxs(File, {
|
|
210359
210667
|
baseName: file.baseName,
|
|
210360
210668
|
path: file.path,
|
|
@@ -210362,23 +210670,24 @@ const typeGenerator = createReactGenerator({
|
|
|
210362
210670
|
children: [
|
|
210363
210671
|
paramTypes,
|
|
210364
210672
|
responseTypes,
|
|
210365
|
-
requestType
|
|
210673
|
+
requestType,
|
|
210674
|
+
dataType,
|
|
210675
|
+
responsesType,
|
|
210676
|
+
responseType
|
|
210366
210677
|
]
|
|
210367
210678
|
});
|
|
210368
210679
|
},
|
|
210369
210680
|
Schema({ node, adapter, options }) {
|
|
210370
|
-
const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType } = options;
|
|
210371
|
-
const {
|
|
210681
|
+
const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, mapper } = options;
|
|
210682
|
+
const { mode, resolveName, getFile } = useKubb();
|
|
210372
210683
|
if (!node.name) return;
|
|
210373
210684
|
const imports = adapter.getImports(node, (schemaName) => ({
|
|
210374
210685
|
name: resolveName({
|
|
210375
210686
|
name: schemaName,
|
|
210376
|
-
pluginName: plugin.name,
|
|
210377
210687
|
type: "type"
|
|
210378
210688
|
}),
|
|
210379
210689
|
path: getFile({
|
|
210380
210690
|
name: schemaName,
|
|
210381
|
-
pluginName: plugin.name,
|
|
210382
210691
|
extname: ".ts",
|
|
210383
210692
|
mode
|
|
210384
210693
|
}).path
|
|
@@ -210386,20 +210695,17 @@ const typeGenerator = createReactGenerator({
|
|
|
210386
210695
|
const isEnumSchema = node.type === "enum";
|
|
210387
210696
|
let typedName = resolveName({
|
|
210388
210697
|
name: node.name,
|
|
210389
|
-
pluginName: plugin.name,
|
|
210390
210698
|
type: "type"
|
|
210391
210699
|
});
|
|
210392
|
-
if (["asConst", "asPascalConst"].includes(enumType) && isEnumSchema) typedName
|
|
210700
|
+
if (["asConst", "asPascalConst"].includes(enumType) && isEnumSchema) typedName += "Key";
|
|
210393
210701
|
const type = {
|
|
210394
210702
|
name: resolveName({
|
|
210395
210703
|
name: node.name,
|
|
210396
|
-
pluginName: plugin.name,
|
|
210397
210704
|
type: "function"
|
|
210398
210705
|
}),
|
|
210399
210706
|
typedName,
|
|
210400
210707
|
file: getFile({
|
|
210401
210708
|
name: node.name,
|
|
210402
|
-
pluginName: plugin.name,
|
|
210403
210709
|
extname: ".ts",
|
|
210404
210710
|
mode
|
|
210405
210711
|
})
|
|
@@ -210425,7 +210731,8 @@ const typeGenerator = createReactGenerator({
|
|
|
210425
210731
|
enumKeyCasing,
|
|
210426
210732
|
optionalType,
|
|
210427
210733
|
arrayType,
|
|
210428
|
-
syntaxType
|
|
210734
|
+
syntaxType,
|
|
210735
|
+
mapper
|
|
210429
210736
|
})]
|
|
210430
210737
|
});
|
|
210431
210738
|
}
|
|
@@ -210479,7 +210786,7 @@ const pluginTs = definePlugin((options) => {
|
|
|
210479
210786
|
return resolvedName;
|
|
210480
210787
|
},
|
|
210481
210788
|
async install() {
|
|
210482
|
-
var _a;
|
|
210789
|
+
var _a, _b;
|
|
210483
210790
|
const { config, fabric, plugin, adapter, rootNode, pluginManager, openInStudio } = this;
|
|
210484
210791
|
const root = path$2.resolve(config.root, config.output.path);
|
|
210485
210792
|
const mode = getMode(path$2.resolve(root, output.path));
|
|
@@ -210487,34 +210794,63 @@ const pluginTs = definePlugin((options) => {
|
|
|
210487
210794
|
await openInStudio({ ast: true });
|
|
210488
210795
|
await walk(rootNode, {
|
|
210489
210796
|
async schema(schemaNode) {
|
|
210490
|
-
|
|
210491
|
-
if (generator.type === "react" && generator.version === "2")
|
|
210492
|
-
|
|
210493
|
-
|
|
210494
|
-
|
|
210495
|
-
|
|
210496
|
-
|
|
210497
|
-
|
|
210498
|
-
|
|
210499
|
-
|
|
210500
|
-
|
|
210797
|
+
const writeTasks = generators.map(async (generator) => {
|
|
210798
|
+
if (generator.type === "react" && generator.version === "2") {
|
|
210799
|
+
const options2 = resolveOptions(schemaNode, {
|
|
210800
|
+
options: plugin.options,
|
|
210801
|
+
exclude,
|
|
210802
|
+
include,
|
|
210803
|
+
override
|
|
210804
|
+
});
|
|
210805
|
+
if (options2 === null) return;
|
|
210806
|
+
await buildSchema(schemaNode, {
|
|
210807
|
+
options: options2,
|
|
210808
|
+
adapter,
|
|
210809
|
+
config,
|
|
210810
|
+
fabric,
|
|
210811
|
+
Component: generator.Schema,
|
|
210812
|
+
plugin,
|
|
210813
|
+
pluginManager,
|
|
210814
|
+
mode,
|
|
210815
|
+
version: generator.version
|
|
210816
|
+
});
|
|
210817
|
+
}
|
|
210501
210818
|
});
|
|
210819
|
+
await Promise.all(writeTasks);
|
|
210502
210820
|
},
|
|
210503
210821
|
async operation(operationNode) {
|
|
210504
|
-
|
|
210505
|
-
if (generator.type === "react" && generator.version === "2")
|
|
210506
|
-
|
|
210507
|
-
|
|
210508
|
-
|
|
210509
|
-
|
|
210510
|
-
|
|
210511
|
-
|
|
210512
|
-
|
|
210513
|
-
|
|
210514
|
-
|
|
210822
|
+
const writeTasks = generators.map(async (generator) => {
|
|
210823
|
+
if (generator.type === "react" && generator.version === "2") {
|
|
210824
|
+
const options2 = resolveOptions(operationNode, {
|
|
210825
|
+
options: plugin.options,
|
|
210826
|
+
exclude,
|
|
210827
|
+
include,
|
|
210828
|
+
override
|
|
210829
|
+
});
|
|
210830
|
+
if (options2 === null) return;
|
|
210831
|
+
await buildOperation(operationNode, {
|
|
210832
|
+
options: options2,
|
|
210833
|
+
adapter,
|
|
210834
|
+
config,
|
|
210835
|
+
fabric,
|
|
210836
|
+
Component: generator.Operation,
|
|
210837
|
+
plugin,
|
|
210838
|
+
pluginManager,
|
|
210839
|
+
mode,
|
|
210840
|
+
version: generator.version
|
|
210841
|
+
});
|
|
210842
|
+
}
|
|
210515
210843
|
});
|
|
210844
|
+
await Promise.all(writeTasks);
|
|
210516
210845
|
}
|
|
210517
210846
|
}, { depth: "shallow" });
|
|
210847
|
+
const barrelFiles2 = await getBarrelFiles(this.fabric.files, {
|
|
210848
|
+
type: (_a = output.barrelType) != null ? _a : "named",
|
|
210849
|
+
root,
|
|
210850
|
+
output,
|
|
210851
|
+
meta: { pluginName: this.plugin.name }
|
|
210852
|
+
});
|
|
210853
|
+
await this.upsertFile(...barrelFiles2);
|
|
210518
210854
|
return;
|
|
210519
210855
|
}
|
|
210520
210856
|
const oas = await this.getOas();
|
|
@@ -210546,7 +210882,7 @@ const pluginTs = definePlugin((options) => {
|
|
|
210546
210882
|
}).build(...generators);
|
|
210547
210883
|
await this.upsertFile(...operationFiles);
|
|
210548
210884
|
const barrelFiles = await getBarrelFiles(this.fabric.files, {
|
|
210549
|
-
type: (
|
|
210885
|
+
type: (_b = output.barrelType) != null ? _b : "named",
|
|
210550
210886
|
root,
|
|
210551
210887
|
output,
|
|
210552
210888
|
meta: { pluginName: this.plugin.name }
|