@kubb/plugin-ts 5.0.0-alpha.4 → 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/dist/{components-CRjwjdyE.js → components-Cwn1rflQ.js} +9 -3
- package/dist/components-Cwn1rflQ.js.map +1 -0
- package/dist/{components-DI0aTIBg.cjs → components-CxTvawXI.cjs} +9 -3
- package/dist/components-CxTvawXI.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +2 -3
- package/dist/generators.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{plugin-Bgm8TNUt.js → plugin-kdQ5D2cW.js} +255 -70
- package/dist/plugin-kdQ5D2cW.js.map +1 -0
- package/dist/{plugin-DvK-Uhvv.cjs → plugin-meWNDVe7.cjs} +252 -67
- package/dist/plugin-meWNDVe7.cjs.map +1 -0
- package/dist/{types-aotMcdUB.d.ts → types-eWhVEVgF.d.ts} +11 -1
- package/package.json +8 -8
- package/src/components/v2/Type.tsx +15 -2
- package/src/factory.ts +12 -16
- package/src/generators/v2/typeGenerator.tsx +74 -107
- package/src/generators/v2/utils.ts +145 -0
- package/src/plugin.ts +11 -0
- package/src/printer.ts +15 -1
- package/src/types.ts +10 -0
- package/dist/components-CRjwjdyE.js.map +0 -1
- package/dist/components-DI0aTIBg.cjs.map +0 -1
- package/dist/plugin-Bgm8TNUt.js.map +0 -1
- package/dist/plugin-DvK-Uhvv.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_components = require("./components-
|
|
1
|
+
const require_components = require("./components-CxTvawXI.cjs");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_components.__toESM(node_path);
|
|
4
4
|
let _kubb_ast = require("@kubb/ast");
|
|
@@ -465,13 +465,17 @@ const printerTs = (0, _kubb_core.definePrinter)((options) => ({
|
|
|
465
465
|
any: () => require_components.keywordTypeNodes.any,
|
|
466
466
|
unknown: () => require_components.keywordTypeNodes.unknown,
|
|
467
467
|
void: () => require_components.keywordTypeNodes.void,
|
|
468
|
+
never: () => require_components.keywordTypeNodes.never,
|
|
468
469
|
boolean: () => require_components.keywordTypeNodes.boolean,
|
|
469
470
|
null: () => require_components.keywordTypeNodes.null,
|
|
470
471
|
blob: () => require_components.createTypeReferenceNode("Blob", []),
|
|
471
472
|
string: () => require_components.keywordTypeNodes.string,
|
|
472
473
|
uuid: () => require_components.keywordTypeNodes.string,
|
|
473
474
|
email: () => require_components.keywordTypeNodes.string,
|
|
474
|
-
url: () =>
|
|
475
|
+
url: (node) => {
|
|
476
|
+
if (node.path) return require_components.createUrlTemplateType(node.path);
|
|
477
|
+
return require_components.keywordTypeNodes.string;
|
|
478
|
+
},
|
|
475
479
|
datetime: () => require_components.keywordTypeNodes.string,
|
|
476
480
|
number: () => require_components.keywordTypeNodes.number,
|
|
477
481
|
integer: () => require_components.keywordTypeNodes.number,
|
|
@@ -536,6 +540,7 @@ const printerTs = (0, _kubb_core.definePrinter)((options) => ({
|
|
|
536
540
|
const addsQuestionToken = ["questionToken", "questionTokenAndUndefined"].includes(this.options.optionalType);
|
|
537
541
|
const { print } = this;
|
|
538
542
|
const propertyNodes = node.properties.map((prop) => {
|
|
543
|
+
if (this.options.mapper && Object.hasOwn(this.options.mapper, prop.name)) return this.options.mapper[prop.name];
|
|
539
544
|
const baseType = print(prop.schema) ?? require_components.keywordTypeNodes.unknown;
|
|
540
545
|
const type = buildPropertyType(prop.schema, baseType, this.options.optionalType);
|
|
541
546
|
const propertyNode = require_components.createPropertySignature({
|
|
@@ -557,7 +562,7 @@ const printerTs = (0, _kubb_core.definePrinter)((options) => ({
|
|
|
557
562
|
}));
|
|
558
563
|
//#endregion
|
|
559
564
|
//#region src/components/v2/Type.tsx
|
|
560
|
-
function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, syntaxType, enumType, enumKeyCasing, ...rest }) {
|
|
565
|
+
function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, syntaxType, enumType, enumKeyCasing, mapper, ...rest }) {
|
|
561
566
|
const typeNodes = [];
|
|
562
567
|
const description = rest.description || node?.description;
|
|
563
568
|
const enumSchemaNodes = (0, _kubb_ast.collect)(node, { schema(n) {
|
|
@@ -566,7 +571,8 @@ function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, synt
|
|
|
566
571
|
let type = printerTs({
|
|
567
572
|
optionalType,
|
|
568
573
|
arrayType,
|
|
569
|
-
enumType
|
|
574
|
+
enumType,
|
|
575
|
+
mapper
|
|
570
576
|
}).print(node);
|
|
571
577
|
if (!type) return;
|
|
572
578
|
if (["asConst", "asPascalConst"].includes(enumType) && enumSchemaNodes.length > 0) {
|
|
@@ -657,29 +663,175 @@ function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, synt
|
|
|
657
663
|
})] });
|
|
658
664
|
}
|
|
659
665
|
//#endregion
|
|
666
|
+
//#region src/generators/v2/utils.ts
|
|
667
|
+
/**
|
|
668
|
+
* Builds an `ObjectSchemaNode` for a group of parameters (path/query/header).
|
|
669
|
+
* Each property is a `ref` schema pointing to the individually-resolved parameter type.
|
|
670
|
+
*/
|
|
671
|
+
function buildParamsSchema({ params, operationId, resolveName }) {
|
|
672
|
+
return (0, _kubb_ast.createSchema)({
|
|
673
|
+
type: "object",
|
|
674
|
+
properties: params.map((param) => (0, _kubb_ast.createProperty)({
|
|
675
|
+
name: param.name,
|
|
676
|
+
schema: (0, _kubb_ast.createSchema)({
|
|
677
|
+
type: "ref",
|
|
678
|
+
name: resolveName({
|
|
679
|
+
name: `${operationId} ${param.name}`,
|
|
680
|
+
type: "function"
|
|
681
|
+
}),
|
|
682
|
+
optional: !param.required
|
|
683
|
+
})
|
|
684
|
+
}))
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Builds an `ObjectSchemaNode` representing the `<OperationId>Data` type:
|
|
689
|
+
* - `data` → request body ref (optional) or `never`
|
|
690
|
+
* - `pathParams` → inline object of path param refs, or `never`
|
|
691
|
+
* - `queryParams` → inline object of query param refs (optional), or `never`
|
|
692
|
+
* - `headerParams` → inline object of header param refs (optional), or `never`
|
|
693
|
+
* - `url` → Express-style template literal (plugin-ts extension, handled by printer)
|
|
694
|
+
*/
|
|
695
|
+
function buildDataSchemaNode({ node, resolveName }) {
|
|
696
|
+
const pathParams = node.parameters.filter((p) => p.in === "path");
|
|
697
|
+
const queryParams = node.parameters.filter((p) => p.in === "query");
|
|
698
|
+
const headerParams = node.parameters.filter((p) => p.in === "header");
|
|
699
|
+
return (0, _kubb_ast.createSchema)({
|
|
700
|
+
type: "object",
|
|
701
|
+
properties: [
|
|
702
|
+
(0, _kubb_ast.createProperty)({
|
|
703
|
+
name: "data",
|
|
704
|
+
schema: node.requestBody ? (0, _kubb_ast.createSchema)({
|
|
705
|
+
type: "ref",
|
|
706
|
+
name: resolveName({
|
|
707
|
+
name: `${node.operationId} MutationRequest`,
|
|
708
|
+
type: "function"
|
|
709
|
+
}),
|
|
710
|
+
optional: true
|
|
711
|
+
}) : (0, _kubb_ast.createSchema)({
|
|
712
|
+
type: "never",
|
|
713
|
+
optional: true
|
|
714
|
+
})
|
|
715
|
+
}),
|
|
716
|
+
(0, _kubb_ast.createProperty)({
|
|
717
|
+
name: "pathParams",
|
|
718
|
+
schema: pathParams.length > 0 ? buildParamsSchema({
|
|
719
|
+
params: pathParams,
|
|
720
|
+
operationId: node.operationId,
|
|
721
|
+
resolveName
|
|
722
|
+
}) : (0, _kubb_ast.createSchema)({
|
|
723
|
+
type: "never",
|
|
724
|
+
optional: true
|
|
725
|
+
})
|
|
726
|
+
}),
|
|
727
|
+
(0, _kubb_ast.createProperty)({
|
|
728
|
+
name: "queryParams",
|
|
729
|
+
schema: queryParams.length > 0 ? (0, _kubb_ast.createSchema)({
|
|
730
|
+
...buildParamsSchema({
|
|
731
|
+
params: queryParams,
|
|
732
|
+
operationId: node.operationId,
|
|
733
|
+
resolveName
|
|
734
|
+
}),
|
|
735
|
+
optional: true
|
|
736
|
+
}) : (0, _kubb_ast.createSchema)({
|
|
737
|
+
type: "never",
|
|
738
|
+
optional: true
|
|
739
|
+
})
|
|
740
|
+
}),
|
|
741
|
+
(0, _kubb_ast.createProperty)({
|
|
742
|
+
name: "headerParams",
|
|
743
|
+
schema: headerParams.length > 0 ? (0, _kubb_ast.createSchema)({
|
|
744
|
+
...buildParamsSchema({
|
|
745
|
+
params: headerParams,
|
|
746
|
+
operationId: node.operationId,
|
|
747
|
+
resolveName
|
|
748
|
+
}),
|
|
749
|
+
optional: true
|
|
750
|
+
}) : (0, _kubb_ast.createSchema)({
|
|
751
|
+
type: "never",
|
|
752
|
+
optional: true
|
|
753
|
+
})
|
|
754
|
+
}),
|
|
755
|
+
(0, _kubb_ast.createProperty)({
|
|
756
|
+
name: "url",
|
|
757
|
+
schema: (0, _kubb_ast.createSchema)({
|
|
758
|
+
type: "url",
|
|
759
|
+
path: node.path
|
|
760
|
+
})
|
|
761
|
+
})
|
|
762
|
+
]
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Builds an `ObjectSchemaNode` representing `<OperationId>Responses` — keyed by HTTP status code.
|
|
767
|
+
*
|
|
768
|
+
* Example output:
|
|
769
|
+
* ```ts
|
|
770
|
+
* export type PlaceOrderPatchResponses = { 200: PlaceOrderPatch200; 405: PlaceOrderPatch405 }
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
function buildResponsesSchemaNode({ node, resolveName }) {
|
|
774
|
+
const responsesWithSchema = node.responses.filter((res) => res.schema);
|
|
775
|
+
if (responsesWithSchema.length === 0) return null;
|
|
776
|
+
return (0, _kubb_ast.createSchema)({
|
|
777
|
+
type: "object",
|
|
778
|
+
properties: responsesWithSchema.map((res) => (0, _kubb_ast.createProperty)({
|
|
779
|
+
name: String(res.statusCode),
|
|
780
|
+
schema: (0, _kubb_ast.createSchema)({
|
|
781
|
+
type: "ref",
|
|
782
|
+
name: resolveName({
|
|
783
|
+
name: `${node.operationId} ${res.statusCode}`,
|
|
784
|
+
type: "function"
|
|
785
|
+
})
|
|
786
|
+
})
|
|
787
|
+
}))
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Builds a `UnionSchemaNode` representing `<OperationId>Response` — all response types in union format.
|
|
792
|
+
*
|
|
793
|
+
* Example output:
|
|
794
|
+
* ```ts
|
|
795
|
+
* export type PlaceOrderPatchResponse = PlaceOrderPatch200 | PlaceOrderPatch405
|
|
796
|
+
* ```
|
|
797
|
+
*/
|
|
798
|
+
function buildResponseUnionSchemaNode({ node, resolveName }) {
|
|
799
|
+
const responsesWithSchema = node.responses.filter((res) => res.schema);
|
|
800
|
+
if (responsesWithSchema.length === 0) return null;
|
|
801
|
+
return (0, _kubb_ast.createSchema)({
|
|
802
|
+
type: "union",
|
|
803
|
+
members: responsesWithSchema.map((res) => (0, _kubb_ast.createSchema)({
|
|
804
|
+
type: "ref",
|
|
805
|
+
name: resolveName({
|
|
806
|
+
name: `${node.operationId} ${res.statusCode}`,
|
|
807
|
+
type: "function"
|
|
808
|
+
})
|
|
809
|
+
}))
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
//#endregion
|
|
660
813
|
//#region src/generators/v2/typeGenerator.tsx
|
|
661
814
|
const typeGenerator = (0, _kubb_core.defineGenerator)({
|
|
662
815
|
name: "typescript",
|
|
663
816
|
type: "react",
|
|
664
817
|
Operation({ node, adapter, options }) {
|
|
665
|
-
const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType } = options;
|
|
666
|
-
const {
|
|
818
|
+
const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, mapper } = options;
|
|
819
|
+
const { mode, getFile, resolveName } = (0, _kubb_core_hooks.useKubb)();
|
|
667
820
|
const file = getFile({
|
|
668
821
|
name: node.operationId,
|
|
669
|
-
pluginName: plugin.name,
|
|
670
822
|
extname: ".ts",
|
|
671
823
|
mode
|
|
672
824
|
});
|
|
825
|
+
const params = (0, _kubb_ast.applyParamsCasing)(node.parameters, paramsCasing);
|
|
673
826
|
function renderSchemaType({ node: schemaNode, name, typedName, description }) {
|
|
827
|
+
if (!schemaNode) return null;
|
|
674
828
|
const imports = adapter.getImports(schemaNode, (schemaName) => ({
|
|
675
829
|
name: resolveName({
|
|
676
830
|
name: schemaName,
|
|
677
|
-
pluginName: plugin.name,
|
|
678
831
|
type: "type"
|
|
679
832
|
}),
|
|
680
833
|
path: getFile({
|
|
681
834
|
name: schemaName,
|
|
682
|
-
pluginName: plugin.name,
|
|
683
835
|
extname: ".ts",
|
|
684
836
|
mode
|
|
685
837
|
}).path
|
|
@@ -702,63 +854,90 @@ const typeGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
702
854
|
enumKeyCasing,
|
|
703
855
|
optionalType,
|
|
704
856
|
arrayType,
|
|
705
|
-
syntaxType
|
|
857
|
+
syntaxType,
|
|
858
|
+
mapper
|
|
706
859
|
})] });
|
|
707
860
|
}
|
|
708
|
-
const paramTypes =
|
|
709
|
-
|
|
861
|
+
const paramTypes = params.map((param) => renderSchemaType({
|
|
862
|
+
node: param.schema,
|
|
863
|
+
name: resolveName({
|
|
710
864
|
name: `${node.operationId} ${param.name}`,
|
|
711
|
-
pluginName: plugin.name,
|
|
712
865
|
type: "function"
|
|
713
|
-
})
|
|
714
|
-
|
|
866
|
+
}),
|
|
867
|
+
typedName: resolveName({
|
|
715
868
|
name: `${node.operationId} ${param.name}`,
|
|
716
|
-
pluginName: plugin.name,
|
|
717
869
|
type: "type"
|
|
718
|
-
})
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
870
|
+
})
|
|
871
|
+
}));
|
|
872
|
+
const responseTypes = node.responses.filter((res) => res.schema).map((res) => renderSchemaType({
|
|
873
|
+
node: res.schema,
|
|
874
|
+
name: resolveName({
|
|
875
|
+
name: `${node.operationId} ${res.statusCode}`,
|
|
876
|
+
type: "function"
|
|
877
|
+
}),
|
|
878
|
+
typedName: resolveName({
|
|
879
|
+
name: `${node.operationId} ${res.statusCode}`,
|
|
880
|
+
type: "type"
|
|
881
|
+
}),
|
|
882
|
+
description: res.description
|
|
883
|
+
}));
|
|
884
|
+
const requestType = node.requestBody ? renderSchemaType({
|
|
885
|
+
node: node.requestBody,
|
|
886
|
+
name: resolveName({
|
|
887
|
+
name: `${node.operationId} MutationRequest`,
|
|
888
|
+
type: "function"
|
|
889
|
+
}),
|
|
890
|
+
typedName: resolveName({
|
|
891
|
+
name: `${node.operationId} MutationRequest`,
|
|
892
|
+
type: "type"
|
|
893
|
+
}),
|
|
894
|
+
description: node.requestBody.description
|
|
895
|
+
}) : null;
|
|
896
|
+
const dataType = renderSchemaType({
|
|
897
|
+
node: buildDataSchemaNode({
|
|
898
|
+
node: {
|
|
899
|
+
...node,
|
|
900
|
+
parameters: params
|
|
901
|
+
},
|
|
902
|
+
resolveName
|
|
903
|
+
}),
|
|
904
|
+
name: resolveName({
|
|
905
|
+
name: `${node.operationId} Data`,
|
|
906
|
+
type: "function"
|
|
907
|
+
}),
|
|
908
|
+
typedName: resolveName({
|
|
909
|
+
name: `${node.operationId} Data`,
|
|
910
|
+
type: "type"
|
|
911
|
+
})
|
|
724
912
|
});
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
type: "type"
|
|
739
|
-
}),
|
|
740
|
-
description: res.description
|
|
741
|
-
});
|
|
913
|
+
const responsesType = renderSchemaType({
|
|
914
|
+
node: buildResponsesSchemaNode({
|
|
915
|
+
node,
|
|
916
|
+
resolveName
|
|
917
|
+
}),
|
|
918
|
+
name: resolveName({
|
|
919
|
+
name: `${node.operationId} Responses`,
|
|
920
|
+
type: "function"
|
|
921
|
+
}),
|
|
922
|
+
typedName: resolveName({
|
|
923
|
+
name: `${node.operationId} Responses`,
|
|
924
|
+
type: "type"
|
|
925
|
+
})
|
|
742
926
|
});
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
927
|
+
const responseType = renderSchemaType({
|
|
928
|
+
node: buildResponseUnionSchemaNode({
|
|
929
|
+
node,
|
|
930
|
+
resolveName
|
|
931
|
+
}),
|
|
932
|
+
name: resolveName({
|
|
933
|
+
name: `${node.operationId} Response`,
|
|
748
934
|
type: "function"
|
|
749
|
-
})
|
|
750
|
-
|
|
751
|
-
name:
|
|
752
|
-
pluginName: plugin.name,
|
|
935
|
+
}),
|
|
936
|
+
typedName: resolveName({
|
|
937
|
+
name: `${node.operationId} Response`,
|
|
753
938
|
type: "type"
|
|
754
|
-
})
|
|
755
|
-
|
|
756
|
-
node: node.requestBody,
|
|
757
|
-
name: resolvedName,
|
|
758
|
-
typedName,
|
|
759
|
-
description: node.requestBody.description
|
|
760
|
-
});
|
|
761
|
-
})() : null;
|
|
939
|
+
})
|
|
940
|
+
});
|
|
762
941
|
return /* @__PURE__ */ (0, _kubb_react_fabric_jsx_runtime.jsxs)(_kubb_react_fabric.File, {
|
|
763
942
|
baseName: file.baseName,
|
|
764
943
|
path: file.path,
|
|
@@ -766,23 +945,24 @@ const typeGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
766
945
|
children: [
|
|
767
946
|
paramTypes,
|
|
768
947
|
responseTypes,
|
|
769
|
-
requestType
|
|
948
|
+
requestType,
|
|
949
|
+
dataType,
|
|
950
|
+
responsesType,
|
|
951
|
+
responseType
|
|
770
952
|
]
|
|
771
953
|
});
|
|
772
954
|
},
|
|
773
955
|
Schema({ node, adapter, options }) {
|
|
774
|
-
const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType } = options;
|
|
775
|
-
const {
|
|
956
|
+
const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, mapper } = options;
|
|
957
|
+
const { mode, resolveName, getFile } = (0, _kubb_core_hooks.useKubb)();
|
|
776
958
|
if (!node.name) return;
|
|
777
959
|
const imports = adapter.getImports(node, (schemaName) => ({
|
|
778
960
|
name: resolveName({
|
|
779
961
|
name: schemaName,
|
|
780
|
-
pluginName: plugin.name,
|
|
781
962
|
type: "type"
|
|
782
963
|
}),
|
|
783
964
|
path: getFile({
|
|
784
965
|
name: schemaName,
|
|
785
|
-
pluginName: plugin.name,
|
|
786
966
|
extname: ".ts",
|
|
787
967
|
mode
|
|
788
968
|
}).path
|
|
@@ -790,20 +970,17 @@ const typeGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
790
970
|
const isEnumSchema = node.type === "enum";
|
|
791
971
|
let typedName = resolveName({
|
|
792
972
|
name: node.name,
|
|
793
|
-
pluginName: plugin.name,
|
|
794
973
|
type: "type"
|
|
795
974
|
});
|
|
796
|
-
if (["asConst", "asPascalConst"].includes(enumType) && isEnumSchema) typedName
|
|
975
|
+
if (["asConst", "asPascalConst"].includes(enumType) && isEnumSchema) typedName += "Key";
|
|
797
976
|
const type = {
|
|
798
977
|
name: resolveName({
|
|
799
978
|
name: node.name,
|
|
800
|
-
pluginName: plugin.name,
|
|
801
979
|
type: "function"
|
|
802
980
|
}),
|
|
803
981
|
typedName,
|
|
804
982
|
file: getFile({
|
|
805
983
|
name: node.name,
|
|
806
|
-
pluginName: plugin.name,
|
|
807
984
|
extname: ".ts",
|
|
808
985
|
mode
|
|
809
986
|
})
|
|
@@ -829,7 +1006,8 @@ const typeGenerator = (0, _kubb_core.defineGenerator)({
|
|
|
829
1006
|
enumKeyCasing,
|
|
830
1007
|
optionalType,
|
|
831
1008
|
arrayType,
|
|
832
|
-
syntaxType
|
|
1009
|
+
syntaxType,
|
|
1010
|
+
mapper
|
|
833
1011
|
})]
|
|
834
1012
|
});
|
|
835
1013
|
}
|
|
@@ -944,6 +1122,13 @@ const pluginTs = (0, _kubb_core.definePlugin)((options) => {
|
|
|
944
1122
|
await Promise.all(writeTasks);
|
|
945
1123
|
}
|
|
946
1124
|
}, { depth: "shallow" });
|
|
1125
|
+
const barrelFiles = await (0, _kubb_core.getBarrelFiles)(this.fabric.files, {
|
|
1126
|
+
type: output.barrelType ?? "named",
|
|
1127
|
+
root,
|
|
1128
|
+
output,
|
|
1129
|
+
meta: { pluginName: this.plugin.name }
|
|
1130
|
+
});
|
|
1131
|
+
await this.upsertFile(...barrelFiles);
|
|
947
1132
|
return;
|
|
948
1133
|
}
|
|
949
1134
|
const oas = await this.getOas();
|
|
@@ -1010,4 +1195,4 @@ Object.defineProperty(exports, "typeGenerator$1", {
|
|
|
1010
1195
|
}
|
|
1011
1196
|
});
|
|
1012
1197
|
|
|
1013
|
-
//# sourceMappingURL=plugin-
|
|
1198
|
+
//# sourceMappingURL=plugin-meWNDVe7.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-meWNDVe7.cjs","names":["trimQuotes","pascalCase","keywordTypeNodes","createUrlTemplateType","ts","getUnknownType","typeGenerator","SchemaGenerator","File","Type","schemaKeywords","jsStringEscape","jsStringEscape","pascalCase","camelCase","trimQuotes","File","File","typeGenerator","typeGeneratorV2","pluginOasName","path","camelCase","pascalCase","SchemaGenerator","OperationGenerator"],"sources":["../../../internals/utils/src/object.ts","../src/generators/typeGenerator.tsx","../src/printer.ts","../src/components/v2/Type.tsx","../src/generators/v2/utils.ts","../src/generators/v2/typeGenerator.tsx","../src/plugin.ts"],"sourcesContent":["import { trimQuotes } from './string.ts'\n\n/**\n * Serializes a primitive value to a JSON string literal, stripping any surrounding quote characters first.\n *\n * @example\n * stringify('hello') // '\"hello\"'\n * stringify('\"hello\"') // '\"hello\"'\n */\nexport function stringify(value: string | number | boolean | undefined): string {\n if (value === undefined || value === null) return '\"\"'\n return JSON.stringify(trimQuotes(value.toString()))\n}\n\n/**\n * Converts a plain object into a multiline key-value string suitable for embedding in generated code.\n * Nested objects are recursively stringified with indentation.\n *\n * @example\n * stringifyObject({ foo: 'bar', nested: { a: 1 } })\n * // 'foo: bar,\\nnested: {\\n a: 1\\n }'\n */\nexport function stringifyObject(value: Record<string, unknown>): string {\n const items = Object.entries(value)\n .map(([key, val]) => {\n if (val !== null && typeof val === 'object') {\n return `${key}: {\\n ${stringifyObject(val as Record<string, unknown>)}\\n }`\n }\n return `${key}: ${val}`\n })\n .filter(Boolean)\n return items.join(',\\n')\n}\n\n/**\n * Serializes plugin options for safe JSON transport.\n * Strips functions, symbols, and `undefined` values recursively.\n */\nexport function serializePluginOptions<TOptions extends object>(options: TOptions): TOptions {\n if (options === null || options === undefined) return {} as TOptions\n if (typeof options !== 'object') return options\n if (Array.isArray(options)) return options.map(serializePluginOptions) as unknown as TOptions\n\n const serialized: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(options)) {\n if (typeof value === 'function' || typeof value === 'symbol' || value === undefined) continue\n serialized[key] = value !== null && typeof value === 'object' ? serializePluginOptions(value as object) : value\n }\n return serialized as TOptions\n}\n\n/**\n * Converts a dot-notation path or string array into an optional-chaining accessor expression.\n *\n * @example\n * getNestedAccessor('pagination.next.id', 'lastPage')\n * // → \"lastPage?.['pagination']?.['next']?.['id']\"\n */\nexport function getNestedAccessor(param: string | string[], accessor: string): string | undefined {\n const parts = Array.isArray(param) ? param : param.split('.')\n if (parts.length === 0 || (parts.length === 1 && parts[0] === '')) return undefined\n return `${accessor}?.['${`${parts.join(\"']?.['\")}']`}`\n}\n","import { pascalCase } from '@internals/utils'\nimport type { PluginManager } from '@kubb/core'\nimport { useMode, usePluginManager } from '@kubb/core/hooks'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\nimport type { Operation } from '@kubb/oas'\nimport { isKeyword, type OperationSchemas, type OperationSchema as OperationSchemaType, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'\nimport { applyParamsCasing, getBanner, getFooter, getImports, isParameterSchema } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport ts from 'typescript'\nimport { Type } from '../components'\nimport * as factory from '../factory.ts'\nimport { createUrlTemplateType, getUnknownType, keywordTypeNodes } from '../factory.ts'\nimport { pluginTsName } from '../plugin.ts'\nimport type { PluginTs } from '../types'\n\nfunction printCombinedSchema({ name, schemas, pluginManager }: { name: string; schemas: OperationSchemas; pluginManager: PluginManager }): string {\n const properties: Record<string, ts.TypeNode> = {}\n\n if (schemas.response) {\n properties['response'] = factory.createUnionDeclaration({\n nodes: schemas.responses.map((res) => {\n const identifier = pluginManager.resolveName({\n name: res.name,\n pluginName: pluginTsName,\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginName: pluginTsName,\n type: 'function',\n })\n properties['request'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginName: pluginTsName,\n type: 'function',\n })\n properties['pathParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginName: pluginTsName,\n type: 'function',\n })\n properties['queryParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginName: pluginTsName,\n type: 'function',\n })\n properties['headerParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }\n\n if (schemas.errors) {\n properties['errors'] = factory.createUnionDeclaration({\n nodes: schemas.errors.map((error) => {\n const identifier = pluginManager.resolveName({\n name: error.name,\n pluginName: pluginTsName,\n type: 'function',\n })\n\n return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)\n }),\n })!\n }\n\n const namespaceNode = factory.createTypeAliasDeclaration({\n name,\n type: factory.createTypeLiteralNode(\n Object.keys(properties)\n .map((key) => {\n const type = properties[key]\n if (!type) {\n return undefined\n }\n\n return factory.createPropertySignature({\n name: pascalCase(key),\n type,\n })\n })\n .filter(Boolean),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n return safePrint(namespaceNode)\n}\n\nfunction printRequestSchema({\n baseName,\n operation,\n schemas,\n pluginManager,\n}: {\n baseName: string\n operation: Operation\n schemas: OperationSchemas\n pluginManager: PluginManager\n}): string {\n const name = pluginManager.resolveName({\n name: `${baseName} Request`,\n pluginName: pluginTsName,\n type: 'type',\n })\n\n const results: string[] = []\n\n // Generate DataRequest type\n const dataRequestProperties: ts.PropertySignature[] = []\n\n if (schemas.request) {\n const identifier = pluginManager.resolveName({\n name: schemas.request.name,\n pluginName: pluginTsName,\n type: 'type',\n })\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'data',\n questionToken: true,\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n }),\n )\n } else {\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'data',\n questionToken: true,\n type: keywordTypeNodes.never,\n }),\n )\n }\n\n // Add pathParams property\n if (schemas.pathParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.pathParams.name,\n pluginName: pluginTsName,\n type: 'type',\n })\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'pathParams',\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n }),\n )\n } else {\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'pathParams',\n questionToken: true,\n type: keywordTypeNodes.never,\n }),\n )\n }\n\n // Add queryParams property\n if (schemas.queryParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.queryParams.name,\n pluginName: pluginTsName,\n type: 'type',\n })\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'queryParams',\n questionToken: true,\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n }),\n )\n } else {\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'queryParams',\n questionToken: true,\n type: keywordTypeNodes.never,\n }),\n )\n }\n\n // Add headerParams property\n if (schemas.headerParams) {\n const identifier = pluginManager.resolveName({\n name: schemas.headerParams.name,\n pluginName: pluginTsName,\n type: 'type',\n })\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'headerParams',\n questionToken: true,\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n }),\n )\n } else {\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'headerParams',\n questionToken: true,\n type: keywordTypeNodes.never,\n }),\n )\n }\n\n // Add url property with template literal type\n dataRequestProperties.push(\n factory.createPropertySignature({\n name: 'url',\n type: createUrlTemplateType(operation.path),\n }),\n )\n\n const dataRequestNode = factory.createTypeAliasDeclaration({\n name,\n type: factory.createTypeLiteralNode(dataRequestProperties),\n modifiers: [factory.modifiers.export],\n })\n\n results.push(safePrint(dataRequestNode))\n\n return results.join('\\n\\n')\n}\n\nfunction printResponseSchema({\n baseName,\n schemas,\n pluginManager,\n unknownType,\n}: {\n baseName: string\n schemas: OperationSchemas\n pluginManager: PluginManager\n unknownType: PluginTs['resolvedOptions']['unknownType']\n}): string {\n const results: string[] = []\n\n const name = pluginManager.resolveName({\n name: `${baseName} ResponseData`,\n pluginName: pluginTsName,\n type: 'type',\n })\n\n // Generate Responses type (mapping status codes to response types)\n if (schemas.responses && schemas.responses.length > 0) {\n const responsesProperties: ts.PropertySignature[] = schemas.responses.map((res) => {\n const identifier = pluginManager.resolveName({\n name: res.name,\n pluginName: pluginTsName,\n type: 'type',\n })\n\n return factory.createPropertySignature({\n name: res.statusCode?.toString() ?? 'default',\n type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),\n })\n })\n\n const responsesNode = factory.createTypeAliasDeclaration({\n name: `${baseName}Responses`,\n type: factory.createTypeLiteralNode(responsesProperties),\n modifiers: [factory.modifiers.export],\n })\n\n results.push(safePrint(responsesNode))\n\n // Generate Response type (union via indexed access)\n const responseNode = factory.createTypeAliasDeclaration({\n name,\n type: factory.createIndexedAccessTypeNode(\n factory.createTypeReferenceNode(factory.createIdentifier(`${baseName}Responses`), undefined),\n factory.createTypeOperatorNode(\n ts.SyntaxKind.KeyOfKeyword,\n factory.createTypeReferenceNode(factory.createIdentifier(`${baseName}Responses`), undefined),\n ),\n ),\n modifiers: [factory.modifiers.export],\n })\n\n results.push(safePrint(responseNode))\n } else {\n const responseNode = factory.createTypeAliasDeclaration({\n name,\n modifiers: [factory.modifiers.export],\n type: getUnknownType(unknownType),\n })\n\n results.push(safePrint(responseNode))\n }\n\n return results.join('\\n\\n')\n}\n\nexport const typeGenerator = createReactGenerator<PluginTs>({\n name: 'typescript',\n Operation({ operation, generator, plugin }) {\n const {\n options,\n options: { mapper, enumType, enumKeyCasing, syntaxType, optionalType, arrayType, unknownType, paramsCasing },\n } = plugin\n\n const mode = useMode()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getFile, getName, getGroup } = useOperationManager(generator)\n const schemaManager = useSchemaManager()\n\n const name = getName(operation, { type: 'type', pluginName: pluginTsName })\n\n const file = getFile(operation)\n const schemas = getSchemas(operation)\n const schemaGenerator = new SchemaGenerator(options, {\n fabric: generator.context.fabric,\n oas,\n events: generator.context.events,\n plugin,\n pluginManager,\n mode,\n override: options.override,\n })\n\n const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response]\n .flat()\n .filter(Boolean)\n\n const mapOperationSchema = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType) => {\n // Apply paramsCasing transformation to pathParams, queryParams, and headerParams (not response)\n const shouldTransform = paramsCasing && isParameterSchema(name)\n const transformedSchema = shouldTransform ? applyParamsCasing(schema, paramsCasing) : schema\n\n const tree = schemaGenerator.parse({ schema: transformedSchema, name, parentName: null })\n const imports = getImports(tree)\n const group = options.operation ? getGroup(options.operation) : undefined\n\n const type = {\n name: schemaManager.getName(name, { type: 'type' }),\n typedName: schemaManager.getName(name, { type: 'type' }),\n file: schemaManager.getFile(options.operationName || name, { group }),\n }\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[name, imp.name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={description}\n tree={tree}\n schema={transformedSchema}\n mapper={mapper}\n enumType={enumType}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n keysToOmit={keysToOmit}\n syntaxType={syntaxType}\n />\n </>\n )\n }\n\n const responseName = schemaManager.getName(schemas.response.name, {\n type: 'type',\n })\n\n const combinedSchemaName = operation.method === 'get' ? `${name}Query` : `${name}Mutation`\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: plugin.options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: plugin.options.output })}\n >\n {operationSchemas.map(mapOperationSchema)}\n\n {generator.context.UNSTABLE_NAMING ? (\n <>\n <File.Source name={`${name}Request`} isExportable isIndexable isTypeOnly>\n {printRequestSchema({ baseName: name, operation, schemas, pluginManager })}\n </File.Source>\n <File.Source name={responseName} isExportable isIndexable isTypeOnly>\n {printResponseSchema({ baseName: name, schemas, pluginManager, unknownType })}\n </File.Source>\n </>\n ) : (\n <File.Source name={combinedSchemaName} isExportable isIndexable isTypeOnly>\n {printCombinedSchema({ name: combinedSchemaName, schemas, pluginManager })}\n </File.Source>\n )}\n </File>\n )\n },\n Schema({ schema, plugin }) {\n const {\n options: { mapper, enumType, enumKeyCasing, syntaxType, optionalType, arrayType, output },\n } = plugin\n const mode = useMode()\n\n const oas = useOas()\n const pluginManager = usePluginManager()\n\n const { getName, getFile } = useSchemaManager()\n const imports = getImports(schema.tree)\n const schemaFromTree = schema.tree.find((item) => item.keyword === schemaKeywords.schema)\n\n let typedName = getName(schema.name, { type: 'type' })\n\n if (['asConst', 'asPascalConst'].includes(enumType) && schemaFromTree && isKeyword(schemaFromTree, schemaKeywords.enum)) {\n typedName = typedName += 'Key' //Suffix for avoiding collisions (https://github.com/kubb-labs/kubb/issues/1873)\n }\n\n const type = {\n name: getName(schema.name, { type: 'function' }),\n typedName,\n file: getFile(schema.name),\n }\n\n return (\n <File\n baseName={type.file.baseName}\n path={type.file.path}\n meta={type.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[schema.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n typedName={type.typedName}\n description={schema.value.description}\n tree={schema.tree}\n schema={schema.value}\n mapper={mapper}\n enumType={enumType}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n />\n </File>\n )\n },\n})\n","import { jsStringEscape, stringify } from '@internals/utils'\nimport { isPlainStringType } from '@kubb/ast'\nimport type { ArraySchemaNode, SchemaNode } from '@kubb/ast/types'\nimport type { PrinterFactoryOptions } from '@kubb/core'\nimport { definePrinter } from '@kubb/core'\nimport type ts from 'typescript'\nimport * as factory from './factory.ts'\n\ntype TsOptions = {\n /**\n * @default `'questionToken'`\n */\n optionalType: 'questionToken' | 'undefined' | 'questionTokenAndUndefined'\n /**\n * @default `'array'`\n */\n arrayType: 'array' | 'generic'\n /**\n * @default `'inlineLiteral'`\n */\n enumType: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral'\n /**\n * Custom property signatures that override specific object properties by name.\n */\n mapper?: Record<string, ts.PropertySignature>\n}\n\ntype TsPrinter = PrinterFactoryOptions<'typescript', TsOptions, ts.TypeNode>\n\nfunction constToTypeNode(value: string | number | boolean, format: 'string' | 'number' | 'boolean'): ts.TypeNode | undefined {\n if (format === 'boolean') {\n return factory.createLiteralTypeNode(value === true ? factory.createTrue() : factory.createFalse())\n }\n if (format === 'number' && typeof value === 'number') {\n if (value < 0) {\n return factory.createLiteralTypeNode(factory.createPrefixUnaryExpression(factory.SyntaxKind.MinusToken, factory.createNumericLiteral(Math.abs(value))))\n }\n return factory.createLiteralTypeNode(factory.createNumericLiteral(value))\n }\n return factory.createLiteralTypeNode(factory.createStringLiteral(String(value)))\n}\n\nfunction dateOrStringNode(node: { representation?: string }): ts.TypeNode {\n return node.representation === 'date' ? factory.createTypeReferenceNode(factory.createIdentifier('Date')) : factory.keywordTypeNodes.string\n}\n\nfunction buildMemberNodes(members: Array<SchemaNode> | undefined, print: (node: SchemaNode) => ts.TypeNode | null | undefined): Array<ts.TypeNode> {\n return (members ?? []).map(print).filter(Boolean) as Array<ts.TypeNode>\n}\n\nfunction buildTupleNode(node: ArraySchemaNode, print: (node: SchemaNode) => ts.TypeNode | null | undefined): ts.TypeNode | undefined {\n let items = (node.items ?? []).map(print).filter(Boolean) as Array<ts.TypeNode>\n\n const restNode = node.rest ? (print(node.rest) ?? undefined) : undefined\n const { min, max } = node\n\n if (max !== undefined) {\n items = items.slice(0, max)\n if (items.length < max && restNode) {\n items = [...items, ...Array(max - items.length).fill(restNode)]\n }\n }\n\n if (min !== undefined) {\n items = items.map((item, i) => (i >= min ? factory.createOptionalTypeNode(item) : item))\n }\n\n if (max === undefined && restNode) {\n items.push(factory.createRestTypeNode(factory.createArrayTypeNode(restNode)))\n }\n\n return factory.createTupleTypeNode(items)\n}\n\nfunction buildPropertyType(schema: SchemaNode, baseType: ts.TypeNode, optionalType: TsOptions['optionalType']): ts.TypeNode {\n const addsUndefined = ['undefined', 'questionTokenAndUndefined'].includes(optionalType)\n\n let type = baseType\n\n if (schema.nullable) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.null] }) as ts.TypeNode\n }\n\n if ((schema.nullish || schema.optional) && addsUndefined) {\n type = factory.createUnionDeclaration({ nodes: [type, factory.keywordTypeNodes.undefined] }) as ts.TypeNode\n }\n\n return type\n}\n\nfunction buildPropertyJSDocComments(schema: SchemaNode): Array<string | undefined> {\n return [\n 'description' in schema && schema.description ? `@description ${jsStringEscape(schema.description as string)}` : undefined,\n 'deprecated' in schema && schema.deprecated ? '@deprecated' : undefined,\n 'min' in schema && schema.min !== undefined ? `@minLength ${schema.min}` : undefined,\n 'max' in schema && schema.max !== undefined ? `@maxLength ${schema.max}` : undefined,\n 'pattern' in schema && schema.pattern ? `@pattern ${schema.pattern}` : undefined,\n 'default' in schema && schema.default !== undefined\n ? `@default ${'primitive' in schema && schema.primitive === 'string' ? stringify(schema.default as string) : schema.default}`\n : undefined,\n 'example' in schema && schema.example !== undefined ? `@example ${schema.example}` : undefined,\n 'primitive' in schema && schema.primitive\n ? [`@type ${schema.primitive || 'unknown'}`, 'optional' in schema && schema.optional ? ' | undefined' : undefined].filter(Boolean).join('')\n : undefined,\n ]\n}\n\nfunction buildIndexSignatures(\n node: { additionalProperties?: SchemaNode | boolean; patternProperties?: Record<string, SchemaNode> },\n propertyCount: number,\n print: (node: SchemaNode) => ts.TypeNode | null | undefined,\n): Array<ts.TypeElement> {\n const elements: Array<ts.TypeElement> = []\n\n if (node.additionalProperties && node.additionalProperties !== true) {\n const additionalType = (print(node.additionalProperties as SchemaNode) ?? factory.keywordTypeNodes.unknown) as ts.TypeNode\n elements.push(factory.createIndexSignature(propertyCount > 0 ? factory.keywordTypeNodes.unknown : additionalType))\n } else if (node.additionalProperties === true) {\n elements.push(factory.createIndexSignature(factory.keywordTypeNodes.unknown))\n }\n\n if (node.patternProperties) {\n const first = Object.values(node.patternProperties)[0]\n if (first) {\n let patternType = (print(first) ?? factory.keywordTypeNodes.unknown) as ts.TypeNode\n if (first.nullable) {\n patternType = factory.createUnionDeclaration({ nodes: [patternType, factory.keywordTypeNodes.null] }) as ts.TypeNode\n }\n elements.push(factory.createIndexSignature(patternType))\n }\n }\n\n return elements\n}\n\n/**\n * Converts a `SchemaNode` AST node into a TypeScript `ts.TypeNode`.\n *\n * Built on `definePrinter` — dispatches on `node.type`, with options closed over\n * per printer instance. Produces the same `ts.TypeNode` output as the keyword-based\n * `parse` in `parser.ts`.\n */\nexport const printerTs = definePrinter<TsPrinter>((options) => ({\n name: 'typescript',\n options,\n nodes: {\n any: () => factory.keywordTypeNodes.any,\n unknown: () => factory.keywordTypeNodes.unknown,\n void: () => factory.keywordTypeNodes.void,\n never: () => factory.keywordTypeNodes.never,\n boolean: () => factory.keywordTypeNodes.boolean,\n null: () => factory.keywordTypeNodes.null,\n blob: () => factory.createTypeReferenceNode('Blob', []),\n string: () => factory.keywordTypeNodes.string,\n uuid: () => factory.keywordTypeNodes.string,\n email: () => factory.keywordTypeNodes.string,\n url: (node) => {\n if (node.path) {\n return factory.createUrlTemplateType(node.path)\n }\n return factory.keywordTypeNodes.string\n },\n datetime: () => factory.keywordTypeNodes.string,\n number: () => factory.keywordTypeNodes.number,\n integer: () => factory.keywordTypeNodes.number,\n bigint: () => factory.keywordTypeNodes.bigint,\n date: (node) => dateOrStringNode(node),\n time: (node) => dateOrStringNode(node),\n ref(node) {\n if (!node.name) {\n return undefined\n }\n return factory.createTypeReferenceNode(node.name, undefined)\n },\n enum(node) {\n const values = node.namedEnumValues?.map((v) => v.value) ?? node.enumValues ?? []\n\n if (this.options.enumType === 'inlineLiteral' || !node.name) {\n const literalNodes = values\n .filter((v): v is string | number | boolean => v !== null)\n .map((value) => constToTypeNode(value, typeof value === 'number' ? 'number' : typeof value === 'boolean' ? 'boolean' : 'string'))\n .filter(Boolean) as Array<ts.TypeNode>\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: literalNodes }) ?? undefined\n }\n\n const typeName = ['asConst', 'asPascalConst'].includes(this.options.enumType) ? `${node.name}Key` : node.name\n\n return factory.createTypeReferenceNode(typeName, undefined)\n },\n union(node) {\n const members = node.members ?? []\n\n const hasStringLiteral = members.some((m) => m.type === 'enum' && m.enumType === 'string')\n const hasPlainString = members.some((m) => isPlainStringType(m))\n\n if (hasStringLiteral && hasPlainString) {\n const nodes = members\n .map((m) => {\n if (isPlainStringType(m)) {\n return factory.createIntersectionDeclaration({\n nodes: [factory.keywordTypeNodes.string, factory.createTypeLiteralNode([])],\n withParentheses: true,\n }) as ts.TypeNode\n }\n\n return this.print(m)\n })\n .filter(Boolean) as Array<ts.TypeNode>\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes }) ?? undefined\n }\n\n return factory.createUnionDeclaration({ withParentheses: true, nodes: buildMemberNodes(members, this.print) }) ?? undefined\n },\n intersection(node) {\n return factory.createIntersectionDeclaration({ withParentheses: true, nodes: buildMemberNodes(node.members, this.print) }) ?? undefined\n },\n array(node) {\n const itemNodes = (node.items ?? []).map((item) => this.print(item)).filter(Boolean) as Array<ts.TypeNode>\n\n return factory.createArrayDeclaration({ nodes: itemNodes, arrayType: this.options.arrayType }) ?? undefined\n },\n tuple(node) {\n return buildTupleNode(node, this.print)\n },\n object(node) {\n const addsQuestionToken = ['questionToken', 'questionTokenAndUndefined'].includes(this.options.optionalType)\n const { print } = this\n\n const propertyNodes: Array<ts.TypeElement> = node.properties.map((prop) => {\n if (this.options.mapper && Object.hasOwn(this.options.mapper, prop.name)) {\n return this.options.mapper[prop.name]!\n }\n\n const baseType = (print(prop.schema) ?? factory.keywordTypeNodes.unknown) as ts.TypeNode\n const type = buildPropertyType(prop.schema, baseType, this.options.optionalType)\n\n const propertyNode = factory.createPropertySignature({\n questionToken: prop.schema.optional || prop.schema.nullish ? addsQuestionToken : false,\n name: prop.name,\n type,\n readOnly: prop.schema.readOnly,\n })\n\n return factory.appendJSDocToNode({ node: propertyNode, comments: buildPropertyJSDocComments(prop.schema) })\n })\n\n const allElements = [...propertyNodes, ...buildIndexSignatures(node, propertyNodes.length, print)]\n\n if (!allElements.length) {\n return factory.keywordTypeNodes.object\n }\n\n return factory.createTypeLiteralNode(allElements)\n },\n },\n}))\n","import { camelCase, jsStringEscape, pascalCase, trimQuotes } from '@internals/utils'\nimport { collect } from '@kubb/ast'\nimport type { EnumSchemaNode, SchemaNode } from '@kubb/ast/types'\nimport { safePrint } from '@kubb/fabric-core/parsers/typescript'\nimport { File } from '@kubb/react-fabric'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\nimport type ts from 'typescript'\nimport * as factory from '../../factory.ts'\nimport { printerTs } from '../../printer.ts'\nimport type { PluginTs } from '../../types.ts'\n\ntype Props = {\n name: string\n typedName: string\n node: SchemaNode\n optionalType: PluginTs['resolvedOptions']['optionalType']\n arrayType: PluginTs['resolvedOptions']['arrayType']\n enumType: PluginTs['resolvedOptions']['enumType']\n enumKeyCasing: PluginTs['resolvedOptions']['enumKeyCasing']\n syntaxType: PluginTs['resolvedOptions']['syntaxType']\n mapper?: PluginTs['resolvedOptions']['mapper']\n description?: string\n keysToOmit?: string[]\n}\n\nexport function Type({\n name,\n typedName,\n node,\n keysToOmit,\n optionalType,\n arrayType,\n syntaxType,\n enumType,\n enumKeyCasing,\n mapper,\n ...rest\n}: Props): FabricReactNode {\n const typeNodes: ts.Node[] = []\n\n const description = rest.description || node?.description\n const enumSchemaNodes = collect<EnumSchemaNode>(node, {\n schema(n): EnumSchemaNode | undefined {\n if (n.type === 'enum' && n.name) return n as EnumSchemaNode\n },\n })\n\n const printer = printerTs({ optionalType, arrayType, enumType, mapper })\n let type = printer.print(node)\n\n if (!type) {\n return\n }\n\n // Add a \"Key\" suffix to avoid collisions where necessary\n if (['asConst', 'asPascalConst'].includes(enumType) && enumSchemaNodes.length > 0) {\n const isDirectEnum = node.type === 'array' && node.items !== undefined\n const isEnumOnly = 'enum' in node && node.enum\n\n if (isDirectEnum || isEnumOnly) {\n const enumSchemaNode = enumSchemaNodes[0]!\n const typeNameWithKey = `${enumSchemaNode.name!}Key`\n\n type = factory.createTypeReferenceNode(typeNameWithKey)\n\n if (isDirectEnum) {\n if (arrayType === 'generic') {\n type = factory.createTypeReferenceNode(factory.createIdentifier('Array'), [type])\n } else {\n type = factory.createArrayTypeNode(type)\n }\n }\n }\n }\n\n if (node) {\n if (node.nullable) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.null],\n }) as ts.TypeNode\n }\n\n if (node.nullish && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n\n if (node.optional && ['undefined', 'questionTokenAndUndefined'].includes(optionalType as string)) {\n type = factory.createUnionDeclaration({\n nodes: [type, factory.keywordTypeNodes.undefined],\n }) as ts.TypeNode\n }\n }\n\n const useTypeGeneration = syntaxType === 'type' || [factory.syntaxKind.union].includes(type.kind as typeof factory.syntaxKind.union) || !!keysToOmit?.length\n\n typeNodes.push(\n factory.createTypeDeclaration({\n name,\n isExportable: true,\n type: keysToOmit?.length\n ? factory.createOmitDeclaration({\n keys: keysToOmit,\n type,\n nonNullable: true,\n })\n : type,\n syntax: useTypeGeneration ? 'type' : 'interface',\n comments: [\n node?.title ? `${jsStringEscape(node.title)}` : undefined,\n description ? `@description ${jsStringEscape(description)}` : undefined,\n node?.deprecated ? '@deprecated' : undefined,\n node && 'min' in node && node.min !== undefined ? `@minLength ${node.min}` : undefined,\n node && 'max' in node && node.max !== undefined ? `@maxLength ${node.max}` : undefined,\n node && 'pattern' in node && node.pattern ? `@pattern ${node.pattern}` : undefined,\n node?.default ? `@default ${node.default}` : undefined,\n node?.example ? `@example ${node.example}` : undefined,\n ],\n }),\n )\n\n const enums = [...new Map(enumSchemaNodes.map((n) => [n.name, n])).values()].map((enumSchemaNode) => {\n const enumName = enumType === 'asPascalConst' ? pascalCase(enumSchemaNode.name!) : camelCase(enumSchemaNode.name!)\n const typeName = ['asConst', 'asPascalConst'].includes(enumType) ? `${enumSchemaNode.name!}Key` : enumSchemaNode.name!\n\n const [nameNode, typeNode] = factory.createEnumDeclaration({\n name: enumName,\n typeName,\n enums: (enumSchemaNode.namedEnumValues?.map((v) => [trimQuotes(v.name.toString()), v.value]) ??\n enumSchemaNode.enumValues?.filter((v): v is NonNullable<typeof v> => v !== null && v !== undefined).map((v) => [trimQuotes(v.toString()), v]) ??\n []) as unknown as Array<[string, string]>,\n type: enumType,\n enumKeyCasing,\n })\n\n return {\n nameNode,\n typeNode,\n name: enumName,\n typeName,\n }\n })\n\n // Skip enum exports when using inlineLiteral\n const shouldExportEnums = enumType !== 'inlineLiteral'\n const shouldExportType = enumType === 'inlineLiteral' || enums.every((item) => item.typeName !== name)\n\n return (\n <>\n {shouldExportEnums &&\n enums.map(({ name: enumName, nameNode, typeName, typeNode }) => (\n <>\n {nameNode && (\n <File.Source name={enumName} isExportable isIndexable isTypeOnly={false}>\n {safePrint(nameNode)}\n </File.Source>\n )}\n {\n <File.Source\n name={typeName}\n isIndexable\n isExportable={['enum', 'asConst', 'asPascalConst', 'constEnum', 'literal', undefined].includes(enumType)}\n isTypeOnly={['asConst', 'asPascalConst', 'literal', undefined].includes(enumType)}\n >\n {safePrint(typeNode)}\n </File.Source>\n }\n </>\n ))}\n {shouldExportType && (\n <File.Source name={typedName} isTypeOnly isExportable isIndexable>\n {safePrint(...typeNodes)}\n </File.Source>\n )}\n </>\n )\n}\n","import { createProperty, createSchema } from '@kubb/ast'\nimport type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'\n\ntype ResolveName = (opts: { name: string; type: 'type' | 'function' }) => string\n\ntype BuildParamsSchemaOptions = {\n params: Array<ParameterNode>\n operationId: string\n resolveName: ResolveName\n}\n\n/**\n * Builds an `ObjectSchemaNode` for a group of parameters (path/query/header).\n * Each property is a `ref` schema pointing to the individually-resolved parameter type.\n */\nexport function buildParamsSchema({ params, operationId, resolveName }: BuildParamsSchemaOptions): SchemaNode {\n return createSchema({\n type: 'object',\n properties: params.map((param) =>\n createProperty({\n name: param.name,\n schema: createSchema({\n type: 'ref',\n name: resolveName({ name: `${operationId} ${param.name}`, type: 'function' }),\n optional: !param.required,\n }),\n }),\n ),\n })\n}\n\ntype BuildOperationSchemaOptions = {\n node: OperationNode\n resolveName: ResolveName\n}\n\n/**\n * Builds an `ObjectSchemaNode` representing the `<OperationId>Data` type:\n * - `data` → request body ref (optional) or `never`\n * - `pathParams` → inline object of path param refs, or `never`\n * - `queryParams` → inline object of query param refs (optional), or `never`\n * - `headerParams` → inline object of header param refs (optional), or `never`\n * - `url` → Express-style template literal (plugin-ts extension, handled by printer)\n */\nexport function buildDataSchemaNode({ node, resolveName }: BuildOperationSchemaOptions): SchemaNode {\n const pathParams = node.parameters.filter((p) => p.in === 'path')\n const queryParams = node.parameters.filter((p) => p.in === 'query')\n const headerParams = node.parameters.filter((p) => p.in === 'header')\n\n return createSchema({\n type: 'object',\n properties: [\n createProperty({\n name: 'data',\n schema: node.requestBody\n ? createSchema({\n type: 'ref',\n name: resolveName({ name: `${node.operationId} MutationRequest`, type: 'function' }),\n optional: true,\n })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'pathParams',\n schema:\n pathParams.length > 0\n ? buildParamsSchema({ params: pathParams, operationId: node.operationId, resolveName })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'queryParams',\n schema:\n queryParams.length > 0\n ? createSchema({ ...buildParamsSchema({ params: queryParams, operationId: node.operationId, resolveName }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'headerParams',\n schema:\n headerParams.length > 0\n ? createSchema({ ...buildParamsSchema({ params: headerParams, operationId: node.operationId, resolveName }), optional: true })\n : createSchema({ type: 'never', optional: true }),\n }),\n createProperty({\n name: 'url',\n schema: createSchema({ type: 'url', path: node.path }),\n }),\n ],\n })\n}\n\n/**\n * Builds an `ObjectSchemaNode` representing `<OperationId>Responses` — keyed by HTTP status code.\n *\n * Example output:\n * ```ts\n * export type PlaceOrderPatchResponses = { 200: PlaceOrderPatch200; 405: PlaceOrderPatch405 }\n * ```\n */\nexport function buildResponsesSchemaNode({ node, resolveName }: BuildOperationSchemaOptions): SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'object',\n properties: responsesWithSchema.map((res) =>\n createProperty({\n name: String(res.statusCode),\n schema: createSchema({\n type: 'ref',\n name: resolveName({ name: `${node.operationId} ${res.statusCode}`, type: 'function' }),\n }),\n }),\n ),\n })\n}\n\n/**\n * Builds a `UnionSchemaNode` representing `<OperationId>Response` — all response types in union format.\n *\n * Example output:\n * ```ts\n * export type PlaceOrderPatchResponse = PlaceOrderPatch200 | PlaceOrderPatch405\n * ```\n */\nexport function buildResponseUnionSchemaNode({ node, resolveName }: BuildOperationSchemaOptions): SchemaNode | null {\n const responsesWithSchema = node.responses.filter((res) => res.schema)\n\n if (responsesWithSchema.length === 0) {\n return null\n }\n\n return createSchema({\n type: 'union',\n members: responsesWithSchema.map((res) =>\n createSchema({\n type: 'ref',\n name: resolveName({ name: `${node.operationId} ${res.statusCode}`, type: 'function' }),\n }),\n ),\n })\n}\n","import { applyParamsCasing } from '@kubb/ast'\nimport type { SchemaNode } from '@kubb/ast/types'\nimport { defineGenerator } from '@kubb/core'\nimport { useKubb } from '@kubb/core/hooks'\nimport { File } from '@kubb/react-fabric'\nimport { Type } from '../../components/v2/Type.tsx'\nimport type { PluginTs } from '../../types'\nimport { buildDataSchemaNode, buildResponsesSchemaNode, buildResponseUnionSchemaNode } from './utils.ts'\n\nexport const typeGenerator = defineGenerator<PluginTs>({\n name: 'typescript',\n type: 'react',\n Operation({ node, adapter, options }) {\n const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, mapper } = options\n const { mode, getFile, resolveName } = useKubb<PluginTs>()\n\n const file = getFile({ name: node.operationId, extname: '.ts', mode })\n const params = applyParamsCasing(node.parameters, paramsCasing)\n\n function renderSchemaType({\n node: schemaNode,\n name,\n typedName,\n description,\n }: {\n node: SchemaNode | null\n name: string\n typedName: string\n description?: string\n }) {\n if (!schemaNode) {\n return null\n }\n\n const imports = adapter.getImports(schemaNode, (schemaName) => ({\n name: resolveName({ name: schemaName, type: 'type' }),\n path: getFile({ name: schemaName, extname: '.ts', mode }).path,\n }))\n\n return (\n <>\n {mode === 'split' &&\n imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}\n <Type\n name={name}\n typedName={typedName}\n node={schemaNode}\n description={description}\n enumType={enumType}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n mapper={mapper}\n />\n </>\n )\n }\n\n const paramTypes = params.map((param) =>\n renderSchemaType({\n node: param.schema,\n name: resolveName({ name: `${node.operationId} ${param.name}`, type: 'function' }),\n typedName: resolveName({ name: `${node.operationId} ${param.name}`, type: 'type' }),\n }),\n )\n\n const responseTypes = node.responses\n .filter((res) => res.schema)\n .map((res) =>\n renderSchemaType({\n node: res.schema!,\n name: resolveName({ name: `${node.operationId} ${res.statusCode}`, type: 'function' }),\n typedName: resolveName({ name: `${node.operationId} ${res.statusCode}`, type: 'type' }),\n description: res.description,\n }),\n )\n\n const requestType = node.requestBody\n ? renderSchemaType({\n node: node.requestBody,\n name: resolveName({ name: `${node.operationId} MutationRequest`, type: 'function' }),\n typedName: resolveName({ name: `${node.operationId} MutationRequest`, type: 'type' }),\n description: node.requestBody.description,\n })\n : null\n\n const dataType = renderSchemaType({\n node: buildDataSchemaNode({ node: { ...node, parameters: params }, resolveName }),\n name: resolveName({ name: `${node.operationId} Data`, type: 'function' }),\n typedName: resolveName({ name: `${node.operationId} Data`, type: 'type' }),\n })\n\n const responsesType = renderSchemaType({\n node: buildResponsesSchemaNode({ node, resolveName }),\n name: resolveName({ name: `${node.operationId} Responses`, type: 'function' }),\n typedName: resolveName({ name: `${node.operationId} Responses`, type: 'type' }),\n })\n\n const responseType = renderSchemaType({\n node: buildResponseUnionSchemaNode({ node, resolveName }),\n name: resolveName({ name: `${node.operationId} Response`, type: 'function' }),\n typedName: resolveName({ name: `${node.operationId} Response`, type: 'type' }),\n })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta}>\n {paramTypes}\n {responseTypes}\n {requestType}\n {dataType}\n {responsesType}\n {responseType}\n </File>\n )\n },\n Schema({ node, adapter, options }) {\n const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, mapper } = options\n const { mode, resolveName, getFile } = useKubb<PluginTs>()\n\n if (!node.name) {\n return\n }\n\n const imports = adapter.getImports(node, (schemaName) => ({\n name: resolveName({ name: schemaName, type: 'type' }),\n path: getFile({ name: schemaName, extname: '.ts', mode }).path,\n }))\n\n const isEnumSchema = node.type === 'enum'\n\n let typedName = resolveName({ name: node.name, type: 'type' })\n if (['asConst', 'asPascalConst'].includes(enumType) && isEnumSchema) {\n typedName += 'Key'\n }\n\n const type = {\n name: resolveName({ name: node.name, type: 'function' }),\n typedName,\n file: getFile({ name: node.name, extname: '.ts', mode }),\n } as const\n\n return (\n <File baseName={type.file.baseName} path={type.file.path} meta={type.file.meta}>\n {mode === 'split' &&\n imports.map((imp) => (\n <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />\n ))}\n <Type\n name={type.name}\n typedName={type.typedName}\n node={node}\n enumType={enumType}\n enumKeyCasing={enumKeyCasing}\n optionalType={optionalType}\n arrayType={arrayType}\n syntaxType={syntaxType}\n mapper={mapper}\n />\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { camelCase, pascalCase } from '@internals/utils'\nimport { walk } from '@kubb/ast'\nimport { definePlugin, type Group, getBarrelFiles, getMode, resolveOptions } from '@kubb/core'\nimport { buildOperation, buildSchema, OperationGenerator, pluginOasName, SchemaGenerator } from '@kubb/plugin-oas'\nimport { typeGenerator, typeGeneratorV2 } from './generators'\nimport type { PluginTs } from './types.ts'\n\nexport const pluginTsName = 'plugin-ts' satisfies PluginTs['name']\n\nexport const pluginTs = definePlugin<PluginTs>((options) => {\n const {\n output = { path: 'types', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n enumType = 'asConst',\n enumKeyCasing = 'none',\n enumSuffix = 'enum',\n dateType = 'string',\n integerType = 'number',\n unknownType = 'any',\n optionalType = 'questionToken',\n arrayType = 'array',\n emptySchemaType = unknownType,\n syntaxType = 'type',\n transformers = {},\n mapper = {},\n paramsCasing,\n generators = [typeGenerator, typeGeneratorV2].filter(Boolean),\n contentType,\n UNSTABLE_NAMING,\n } = options\n\n // @deprecated Will be removed in v5 when collisionDetection defaults to true\n const usedEnumNames = {}\n\n return {\n name: pluginTsName,\n options: {\n output,\n transformers,\n dateType,\n integerType,\n optionalType,\n arrayType,\n enumType,\n enumKeyCasing,\n enumSuffix,\n unknownType,\n emptySchemaType,\n syntaxType,\n group,\n override,\n mapper,\n paramsCasing,\n usedEnumNames,\n },\n pre: [pluginOasName],\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n const resolvedName = pascalCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async install() {\n const { config, fabric, plugin, adapter, rootNode, pluginManager, openInStudio } = this\n\n const root = path.resolve(config.root, config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n\n if (adapter) {\n await openInStudio({ ast: true })\n\n await walk(\n rootNode,\n {\n async schema(schemaNode) {\n const writeTasks = generators.map(async (generator) => {\n if (generator.type === 'react' && generator.version === '2') {\n const options = resolveOptions(schemaNode, { options: plugin.options, exclude, include, override })\n\n if (options === null) {\n return\n }\n\n await buildSchema(schemaNode, {\n options,\n adapter,\n config,\n fabric,\n Component: generator.Schema,\n plugin,\n pluginManager,\n mode,\n version: generator.version,\n })\n }\n })\n\n await Promise.all(writeTasks)\n },\n async operation(operationNode) {\n const writeTasks = generators.map(async (generator) => {\n if (generator.type === 'react' && generator.version === '2') {\n const options = resolveOptions(operationNode, { options: plugin.options, exclude, include, override })\n\n if (options === null) {\n return\n }\n\n await buildOperation(operationNode, {\n options,\n adapter,\n config,\n fabric,\n Component: generator.Operation,\n plugin,\n pluginManager,\n mode,\n version: generator.version,\n })\n }\n })\n\n await Promise.all(writeTasks)\n },\n },\n { depth: 'shallow' },\n )\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginName: this.plugin.name,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n\n return\n }\n\n // v1 flow\n\n const oas = await this.getOas()\n\n const schemaGenerator = new SchemaGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n events: this.events,\n plugin: this.plugin,\n contentType,\n include: undefined,\n override,\n mode,\n output: output.path,\n })\n\n const schemaFiles = await schemaGenerator.build(...generators)\n await this.upsertFile(...schemaFiles)\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n events: this.events,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n UNSTABLE_NAMING,\n })\n\n const operationFiles = await operationGenerator.build(...generators)\n await this.upsertFile(...operationFiles)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginName: this.plugin.name,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AASA,SAAgB,UAAU,OAAsD;AAC9E,KAAI,UAAU,KAAA,KAAa,UAAU,KAAM,QAAO;AAClD,QAAO,KAAK,UAAUA,mBAAAA,WAAW,MAAM,UAAU,CAAC,CAAC;;;;ACMrD,SAAS,oBAAoB,EAAE,MAAM,SAAS,iBAAoG;CAChJ,MAAM,aAA0C,EAAE;AAElD,KAAI,QAAQ,SACV,YAAW,cAAA,mBAAA,uBAA6C,EACtD,OAAO,QAAQ,UAAU,KAAK,QAAQ;EACpC,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,IAAI;GACV,YAAY;GACZ,MAAM;GACP,CAAC;AAEF,SAAA,mBAAA,wBAAA,mBAAA,iBAAgE,WAAW,EAAE,KAAA,EAAU;GACvF,EACH,CAAC;AAGJ,KAAI,QAAQ,SAAS;EACnB,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,QAAQ,QAAQ;GACtB,YAAY;GACZ,MAAM;GACP,CAAC;AACF,aAAW,aAAA,mBAAA,wBAAA,mBAAA,iBAAsE,WAAW,EAAE,KAAA,EAAU;;AAG1G,KAAI,QAAQ,YAAY;EACtB,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,QAAQ,WAAW;GACzB,YAAY;GACZ,MAAM;GACP,CAAC;AACF,aAAW,gBAAA,mBAAA,wBAAA,mBAAA,iBAAyE,WAAW,EAAE,KAAA,EAAU;;AAG7G,KAAI,QAAQ,aAAa;EACvB,MAAM,aAAa,cAAc,YAAY;GAC3C,MAAM,QAAQ,YAAY;GAC1B,YAAY;GACZ,MAAM;GACP,CAAC;AACF,aAAW,iBAAA,mBAAA,wBAAA,mBAAA,iBAA0E,WAAW,EAAE,KAAA,EAAU;;AAG9G,KAAI,QAAQ,cAAc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