@kubb/plugin-ts 4.5.2 → 4.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{types-SviN821p.d.cts → types-3bqiJQCB.d.cts} +137 -137
- package/dist/{types-HJWH9NtA.d.ts → types-Ck_bg9OD.d.ts} +137 -137
- package/package.json +5 -5
package/dist/components.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as Schema, n as PluginTs, o as OasTypes, s as SchemaObject } from "./types-
|
|
1
|
+
import { i as Schema, n as PluginTs, o as OasTypes, s as SchemaObject } from "./types-3bqiJQCB.cjs";
|
|
2
2
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/OasType.d.ts
|
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as Schema, n as PluginTs, o as OasTypes, s as SchemaObject } from "./types-
|
|
1
|
+
import { i as Schema, n as PluginTs, o as OasTypes, s as SchemaObject } from "./types-Ck_bg9OD.js";
|
|
2
2
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/OasType.d.ts
|
package/dist/generators.d.cts
CHANGED
package/dist/generators.d.ts
CHANGED
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -555,6 +555,133 @@ type FileMetaBase = {
|
|
|
555
555
|
pluginKey?: Plugin['key'];
|
|
556
556
|
};
|
|
557
557
|
//#endregion
|
|
558
|
+
//#region ../plugin-oas/src/types.d.ts
|
|
559
|
+
type Context$2 = {
|
|
560
|
+
getOas(): Promise<Oas>;
|
|
561
|
+
getBaseURL(): Promise<string | undefined>;
|
|
562
|
+
};
|
|
563
|
+
declare global {
|
|
564
|
+
namespace Kubb {
|
|
565
|
+
interface PluginContext extends Context$2 {}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
type ResolvePathOptions = {
|
|
569
|
+
pluginKey?: Plugin['key'];
|
|
570
|
+
group?: {
|
|
571
|
+
tag?: string;
|
|
572
|
+
path?: string;
|
|
573
|
+
};
|
|
574
|
+
type?: ResolveNameParams['type'];
|
|
575
|
+
};
|
|
576
|
+
/**
|
|
577
|
+
* `propertyName` is the ref name + resolved with the nameResolver
|
|
578
|
+
* @example import { Pet } from './Pet'
|
|
579
|
+
*
|
|
580
|
+
* `originalName` is the original name used(in PascalCase), only used to remove duplicates
|
|
581
|
+
*
|
|
582
|
+
* `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
|
|
583
|
+
* @example import a type(plugin-ts) for a mock file(swagger-faker)
|
|
584
|
+
*/
|
|
585
|
+
type Ref = {
|
|
586
|
+
propertyName: string;
|
|
587
|
+
originalName: string;
|
|
588
|
+
path: KubbFile.Path;
|
|
589
|
+
pluginKey?: Plugin['key'];
|
|
590
|
+
};
|
|
591
|
+
type Refs = Record<string, Ref>;
|
|
592
|
+
type OperationSchema = {
|
|
593
|
+
/**
|
|
594
|
+
* Converted name, contains already `PathParams`, `QueryParams`, ...
|
|
595
|
+
*/
|
|
596
|
+
name: string;
|
|
597
|
+
schema: SchemaObject$1;
|
|
598
|
+
operation?: Operation$1;
|
|
599
|
+
/**
|
|
600
|
+
* OperationName in PascalCase, only being used in OperationGenerator
|
|
601
|
+
*/
|
|
602
|
+
operationName: string;
|
|
603
|
+
description?: string;
|
|
604
|
+
statusCode?: number;
|
|
605
|
+
keys?: string[];
|
|
606
|
+
keysToOmit?: string[];
|
|
607
|
+
withData?: boolean;
|
|
608
|
+
};
|
|
609
|
+
type OperationSchemas = {
|
|
610
|
+
pathParams?: OperationSchema & {
|
|
611
|
+
keysToOmit?: never;
|
|
612
|
+
};
|
|
613
|
+
queryParams?: OperationSchema & {
|
|
614
|
+
keysToOmit?: never;
|
|
615
|
+
};
|
|
616
|
+
headerParams?: OperationSchema & {
|
|
617
|
+
keysToOmit?: never;
|
|
618
|
+
};
|
|
619
|
+
request?: OperationSchema;
|
|
620
|
+
response: OperationSchema;
|
|
621
|
+
responses: Array<OperationSchema>;
|
|
622
|
+
statusCodes?: Array<OperationSchema>;
|
|
623
|
+
errors?: Array<OperationSchema>;
|
|
624
|
+
};
|
|
625
|
+
type ByTag = {
|
|
626
|
+
type: 'tag';
|
|
627
|
+
pattern: string | RegExp;
|
|
628
|
+
};
|
|
629
|
+
type ByOperationId = {
|
|
630
|
+
type: 'operationId';
|
|
631
|
+
pattern: string | RegExp;
|
|
632
|
+
};
|
|
633
|
+
type ByPath = {
|
|
634
|
+
type: 'path';
|
|
635
|
+
pattern: string | RegExp;
|
|
636
|
+
};
|
|
637
|
+
type ByMethod = {
|
|
638
|
+
type: 'method';
|
|
639
|
+
pattern: HttpMethod | RegExp;
|
|
640
|
+
};
|
|
641
|
+
type BySchemaName = {
|
|
642
|
+
type: 'schemaName';
|
|
643
|
+
pattern: string | RegExp;
|
|
644
|
+
};
|
|
645
|
+
type ByContentType = {
|
|
646
|
+
type: 'contentType';
|
|
647
|
+
pattern: string | RegExp;
|
|
648
|
+
};
|
|
649
|
+
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
650
|
+
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
651
|
+
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
652
|
+
options: Partial<TOptions>;
|
|
653
|
+
};
|
|
654
|
+
//#endregion
|
|
655
|
+
//#region ../plugin-oas/src/OperationGenerator.d.ts
|
|
656
|
+
type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
657
|
+
fabric: Fabric;
|
|
658
|
+
oas: Oas;
|
|
659
|
+
exclude: Array<Exclude$1> | undefined;
|
|
660
|
+
include: Array<Include> | undefined;
|
|
661
|
+
override: Array<Override<TOptions>> | undefined;
|
|
662
|
+
contentType: contentType | undefined;
|
|
663
|
+
pluginManager: PluginManager;
|
|
664
|
+
/**
|
|
665
|
+
* Current plugin
|
|
666
|
+
*/
|
|
667
|
+
plugin: Plugin<TPluginOptions>;
|
|
668
|
+
mode: KubbFile.Mode;
|
|
669
|
+
};
|
|
670
|
+
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
671
|
+
#private;
|
|
672
|
+
getSchemas(operation: Operation$1, {
|
|
673
|
+
resolveName
|
|
674
|
+
}?: {
|
|
675
|
+
resolveName?: (name: string) => string;
|
|
676
|
+
}): OperationSchemas;
|
|
677
|
+
getOperations(): Promise<Array<{
|
|
678
|
+
path: string;
|
|
679
|
+
method: HttpMethod;
|
|
680
|
+
operation: Operation$1;
|
|
681
|
+
}>>;
|
|
682
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
683
|
+
}
|
|
684
|
+
//#endregion
|
|
558
685
|
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
559
686
|
type SchemaKeywordMapper = {
|
|
560
687
|
object: {
|
|
@@ -772,105 +899,8 @@ type Schema = {
|
|
|
772
899
|
keyword: string;
|
|
773
900
|
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
|
|
774
901
|
//#endregion
|
|
775
|
-
//#region ../plugin-oas/src/types.d.ts
|
|
776
|
-
type Context$2 = {
|
|
777
|
-
getOas(): Promise<Oas>;
|
|
778
|
-
getBaseURL(): Promise<string | undefined>;
|
|
779
|
-
};
|
|
780
|
-
declare global {
|
|
781
|
-
namespace Kubb {
|
|
782
|
-
interface PluginContext extends Context$2 {}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
type ResolvePathOptions = {
|
|
786
|
-
pluginKey?: Plugin['key'];
|
|
787
|
-
group?: {
|
|
788
|
-
tag?: string;
|
|
789
|
-
path?: string;
|
|
790
|
-
};
|
|
791
|
-
type?: ResolveNameParams['type'];
|
|
792
|
-
};
|
|
793
|
-
/**
|
|
794
|
-
* `propertyName` is the ref name + resolved with the nameResolver
|
|
795
|
-
* @example import { Pet } from './Pet'
|
|
796
|
-
*
|
|
797
|
-
* `originalName` is the original name used(in PascalCase), only used to remove duplicates
|
|
798
|
-
*
|
|
799
|
-
* `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
|
|
800
|
-
* @example import a type(plugin-ts) for a mock file(swagger-faker)
|
|
801
|
-
*/
|
|
802
|
-
type Ref = {
|
|
803
|
-
propertyName: string;
|
|
804
|
-
originalName: string;
|
|
805
|
-
path: KubbFile.Path;
|
|
806
|
-
pluginKey?: Plugin['key'];
|
|
807
|
-
};
|
|
808
|
-
type Refs = Record<string, Ref>;
|
|
809
|
-
type OperationSchema = {
|
|
810
|
-
/**
|
|
811
|
-
* Converted name, contains already `PathParams`, `QueryParams`, ...
|
|
812
|
-
*/
|
|
813
|
-
name: string;
|
|
814
|
-
schema: SchemaObject$1;
|
|
815
|
-
operation?: Operation$1;
|
|
816
|
-
/**
|
|
817
|
-
* OperationName in PascalCase, only being used in OperationGenerator
|
|
818
|
-
*/
|
|
819
|
-
operationName: string;
|
|
820
|
-
description?: string;
|
|
821
|
-
statusCode?: number;
|
|
822
|
-
keys?: string[];
|
|
823
|
-
keysToOmit?: string[];
|
|
824
|
-
withData?: boolean;
|
|
825
|
-
};
|
|
826
|
-
type OperationSchemas = {
|
|
827
|
-
pathParams?: OperationSchema & {
|
|
828
|
-
keysToOmit?: never;
|
|
829
|
-
};
|
|
830
|
-
queryParams?: OperationSchema & {
|
|
831
|
-
keysToOmit?: never;
|
|
832
|
-
};
|
|
833
|
-
headerParams?: OperationSchema & {
|
|
834
|
-
keysToOmit?: never;
|
|
835
|
-
};
|
|
836
|
-
request?: OperationSchema;
|
|
837
|
-
response: OperationSchema;
|
|
838
|
-
responses: Array<OperationSchema>;
|
|
839
|
-
statusCodes?: Array<OperationSchema>;
|
|
840
|
-
errors?: Array<OperationSchema>;
|
|
841
|
-
};
|
|
842
|
-
type ByTag = {
|
|
843
|
-
type: 'tag';
|
|
844
|
-
pattern: string | RegExp;
|
|
845
|
-
};
|
|
846
|
-
type ByOperationId = {
|
|
847
|
-
type: 'operationId';
|
|
848
|
-
pattern: string | RegExp;
|
|
849
|
-
};
|
|
850
|
-
type ByPath = {
|
|
851
|
-
type: 'path';
|
|
852
|
-
pattern: string | RegExp;
|
|
853
|
-
};
|
|
854
|
-
type ByMethod = {
|
|
855
|
-
type: 'method';
|
|
856
|
-
pattern: HttpMethod | RegExp;
|
|
857
|
-
};
|
|
858
|
-
type BySchemaName = {
|
|
859
|
-
type: 'schemaName';
|
|
860
|
-
pattern: string | RegExp;
|
|
861
|
-
};
|
|
862
|
-
type ByContentType = {
|
|
863
|
-
type: 'contentType';
|
|
864
|
-
pattern: string | RegExp;
|
|
865
|
-
};
|
|
866
|
-
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
867
|
-
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
868
|
-
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
869
|
-
options: Partial<TOptions>;
|
|
870
|
-
};
|
|
871
|
-
//#endregion
|
|
872
902
|
//#region ../plugin-oas/src/SchemaGenerator.d.ts
|
|
873
|
-
type Context
|
|
903
|
+
type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
874
904
|
fabric: Fabric;
|
|
875
905
|
oas: Oas;
|
|
876
906
|
pluginManager: PluginManager;
|
|
@@ -911,7 +941,7 @@ type SchemaProps$1 = {
|
|
|
911
941
|
name?: string;
|
|
912
942
|
parentName?: string;
|
|
913
943
|
};
|
|
914
|
-
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context
|
|
944
|
+
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
|
|
915
945
|
#private;
|
|
916
946
|
refs: Refs;
|
|
917
947
|
/**
|
|
@@ -926,15 +956,6 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
926
956
|
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
927
957
|
}
|
|
928
958
|
//#endregion
|
|
929
|
-
//#region ../plugin-oas/src/generators/createGenerator.d.ts
|
|
930
|
-
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
931
|
-
name: string;
|
|
932
|
-
type: 'core';
|
|
933
|
-
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
934
|
-
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
935
|
-
schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
936
|
-
};
|
|
937
|
-
//#endregion
|
|
938
959
|
//#region ../plugin-oas/src/generators/createReactGenerator.d.ts
|
|
939
960
|
type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
940
961
|
name: string;
|
|
@@ -969,35 +990,14 @@ type SchemaProps<TOptions extends PluginFactoryOptions> = {
|
|
|
969
990
|
};
|
|
970
991
|
type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions> | ReactGenerator<TOptions>;
|
|
971
992
|
//#endregion
|
|
972
|
-
//#region ../plugin-oas/src/
|
|
973
|
-
type
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
contentType: contentType | undefined;
|
|
980
|
-
pluginManager: PluginManager;
|
|
981
|
-
/**
|
|
982
|
-
* Current plugin
|
|
983
|
-
*/
|
|
984
|
-
plugin: Plugin<TPluginOptions>;
|
|
985
|
-
mode: KubbFile.Mode;
|
|
993
|
+
//#region ../plugin-oas/src/generators/createGenerator.d.ts
|
|
994
|
+
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
995
|
+
name: string;
|
|
996
|
+
type: 'core';
|
|
997
|
+
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
998
|
+
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
999
|
+
schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
986
1000
|
};
|
|
987
|
-
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
988
|
-
#private;
|
|
989
|
-
getSchemas(operation: Operation$1, {
|
|
990
|
-
resolveName
|
|
991
|
-
}?: {
|
|
992
|
-
resolveName?: (name: string) => string;
|
|
993
|
-
}): OperationSchemas;
|
|
994
|
-
getOperations(): Promise<Array<{
|
|
995
|
-
path: string;
|
|
996
|
-
method: HttpMethod;
|
|
997
|
-
operation: Operation$1;
|
|
998
|
-
}>>;
|
|
999
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
1000
|
-
}
|
|
1001
1001
|
//#endregion
|
|
1002
1002
|
//#region src/types.d.ts
|
|
1003
1003
|
type Options$1 = {
|
|
@@ -1110,4 +1110,4 @@ type ResolvedOptions = {
|
|
|
1110
1110
|
type PluginTs = PluginFactoryOptions<'plugin-ts', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1111
1111
|
//#endregion
|
|
1112
1112
|
export { UserPluginWithLifeCycle as a, Schema as i, PluginTs as n, OasTypes as o, ReactGenerator as r, SchemaObject$1 as s, Options$1 as t };
|
|
1113
|
-
//# sourceMappingURL=types-
|
|
1113
|
+
//# sourceMappingURL=types-3bqiJQCB.d.cts.map
|
|
@@ -555,6 +555,133 @@ type FileMetaBase = {
|
|
|
555
555
|
pluginKey?: Plugin['key'];
|
|
556
556
|
};
|
|
557
557
|
//#endregion
|
|
558
|
+
//#region ../plugin-oas/src/types.d.ts
|
|
559
|
+
type Context$2 = {
|
|
560
|
+
getOas(): Promise<Oas>;
|
|
561
|
+
getBaseURL(): Promise<string | undefined>;
|
|
562
|
+
};
|
|
563
|
+
declare global {
|
|
564
|
+
namespace Kubb {
|
|
565
|
+
interface PluginContext extends Context$2 {}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
type ResolvePathOptions = {
|
|
569
|
+
pluginKey?: Plugin['key'];
|
|
570
|
+
group?: {
|
|
571
|
+
tag?: string;
|
|
572
|
+
path?: string;
|
|
573
|
+
};
|
|
574
|
+
type?: ResolveNameParams['type'];
|
|
575
|
+
};
|
|
576
|
+
/**
|
|
577
|
+
* `propertyName` is the ref name + resolved with the nameResolver
|
|
578
|
+
* @example import { Pet } from './Pet'
|
|
579
|
+
*
|
|
580
|
+
* `originalName` is the original name used(in PascalCase), only used to remove duplicates
|
|
581
|
+
*
|
|
582
|
+
* `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
|
|
583
|
+
* @example import a type(plugin-ts) for a mock file(swagger-faker)
|
|
584
|
+
*/
|
|
585
|
+
type Ref = {
|
|
586
|
+
propertyName: string;
|
|
587
|
+
originalName: string;
|
|
588
|
+
path: KubbFile.Path;
|
|
589
|
+
pluginKey?: Plugin['key'];
|
|
590
|
+
};
|
|
591
|
+
type Refs = Record<string, Ref>;
|
|
592
|
+
type OperationSchema = {
|
|
593
|
+
/**
|
|
594
|
+
* Converted name, contains already `PathParams`, `QueryParams`, ...
|
|
595
|
+
*/
|
|
596
|
+
name: string;
|
|
597
|
+
schema: SchemaObject$1;
|
|
598
|
+
operation?: Operation$1;
|
|
599
|
+
/**
|
|
600
|
+
* OperationName in PascalCase, only being used in OperationGenerator
|
|
601
|
+
*/
|
|
602
|
+
operationName: string;
|
|
603
|
+
description?: string;
|
|
604
|
+
statusCode?: number;
|
|
605
|
+
keys?: string[];
|
|
606
|
+
keysToOmit?: string[];
|
|
607
|
+
withData?: boolean;
|
|
608
|
+
};
|
|
609
|
+
type OperationSchemas = {
|
|
610
|
+
pathParams?: OperationSchema & {
|
|
611
|
+
keysToOmit?: never;
|
|
612
|
+
};
|
|
613
|
+
queryParams?: OperationSchema & {
|
|
614
|
+
keysToOmit?: never;
|
|
615
|
+
};
|
|
616
|
+
headerParams?: OperationSchema & {
|
|
617
|
+
keysToOmit?: never;
|
|
618
|
+
};
|
|
619
|
+
request?: OperationSchema;
|
|
620
|
+
response: OperationSchema;
|
|
621
|
+
responses: Array<OperationSchema>;
|
|
622
|
+
statusCodes?: Array<OperationSchema>;
|
|
623
|
+
errors?: Array<OperationSchema>;
|
|
624
|
+
};
|
|
625
|
+
type ByTag = {
|
|
626
|
+
type: 'tag';
|
|
627
|
+
pattern: string | RegExp;
|
|
628
|
+
};
|
|
629
|
+
type ByOperationId = {
|
|
630
|
+
type: 'operationId';
|
|
631
|
+
pattern: string | RegExp;
|
|
632
|
+
};
|
|
633
|
+
type ByPath = {
|
|
634
|
+
type: 'path';
|
|
635
|
+
pattern: string | RegExp;
|
|
636
|
+
};
|
|
637
|
+
type ByMethod = {
|
|
638
|
+
type: 'method';
|
|
639
|
+
pattern: HttpMethod | RegExp;
|
|
640
|
+
};
|
|
641
|
+
type BySchemaName = {
|
|
642
|
+
type: 'schemaName';
|
|
643
|
+
pattern: string | RegExp;
|
|
644
|
+
};
|
|
645
|
+
type ByContentType = {
|
|
646
|
+
type: 'contentType';
|
|
647
|
+
pattern: string | RegExp;
|
|
648
|
+
};
|
|
649
|
+
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
650
|
+
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
651
|
+
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
652
|
+
options: Partial<TOptions>;
|
|
653
|
+
};
|
|
654
|
+
//#endregion
|
|
655
|
+
//#region ../plugin-oas/src/OperationGenerator.d.ts
|
|
656
|
+
type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
657
|
+
fabric: Fabric;
|
|
658
|
+
oas: Oas;
|
|
659
|
+
exclude: Array<Exclude$1> | undefined;
|
|
660
|
+
include: Array<Include> | undefined;
|
|
661
|
+
override: Array<Override<TOptions>> | undefined;
|
|
662
|
+
contentType: contentType | undefined;
|
|
663
|
+
pluginManager: PluginManager;
|
|
664
|
+
/**
|
|
665
|
+
* Current plugin
|
|
666
|
+
*/
|
|
667
|
+
plugin: Plugin<TPluginOptions>;
|
|
668
|
+
mode: KubbFile.Mode;
|
|
669
|
+
};
|
|
670
|
+
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
671
|
+
#private;
|
|
672
|
+
getSchemas(operation: Operation$1, {
|
|
673
|
+
resolveName
|
|
674
|
+
}?: {
|
|
675
|
+
resolveName?: (name: string) => string;
|
|
676
|
+
}): OperationSchemas;
|
|
677
|
+
getOperations(): Promise<Array<{
|
|
678
|
+
path: string;
|
|
679
|
+
method: HttpMethod;
|
|
680
|
+
operation: Operation$1;
|
|
681
|
+
}>>;
|
|
682
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
683
|
+
}
|
|
684
|
+
//#endregion
|
|
558
685
|
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
559
686
|
type SchemaKeywordMapper = {
|
|
560
687
|
object: {
|
|
@@ -772,105 +899,8 @@ type Schema = {
|
|
|
772
899
|
keyword: string;
|
|
773
900
|
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
|
|
774
901
|
//#endregion
|
|
775
|
-
//#region ../plugin-oas/src/types.d.ts
|
|
776
|
-
type Context$2 = {
|
|
777
|
-
getOas(): Promise<Oas>;
|
|
778
|
-
getBaseURL(): Promise<string | undefined>;
|
|
779
|
-
};
|
|
780
|
-
declare global {
|
|
781
|
-
namespace Kubb {
|
|
782
|
-
interface PluginContext extends Context$2 {}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
type ResolvePathOptions = {
|
|
786
|
-
pluginKey?: Plugin['key'];
|
|
787
|
-
group?: {
|
|
788
|
-
tag?: string;
|
|
789
|
-
path?: string;
|
|
790
|
-
};
|
|
791
|
-
type?: ResolveNameParams['type'];
|
|
792
|
-
};
|
|
793
|
-
/**
|
|
794
|
-
* `propertyName` is the ref name + resolved with the nameResolver
|
|
795
|
-
* @example import { Pet } from './Pet'
|
|
796
|
-
*
|
|
797
|
-
* `originalName` is the original name used(in PascalCase), only used to remove duplicates
|
|
798
|
-
*
|
|
799
|
-
* `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
|
|
800
|
-
* @example import a type(plugin-ts) for a mock file(swagger-faker)
|
|
801
|
-
*/
|
|
802
|
-
type Ref = {
|
|
803
|
-
propertyName: string;
|
|
804
|
-
originalName: string;
|
|
805
|
-
path: KubbFile.Path;
|
|
806
|
-
pluginKey?: Plugin['key'];
|
|
807
|
-
};
|
|
808
|
-
type Refs = Record<string, Ref>;
|
|
809
|
-
type OperationSchema = {
|
|
810
|
-
/**
|
|
811
|
-
* Converted name, contains already `PathParams`, `QueryParams`, ...
|
|
812
|
-
*/
|
|
813
|
-
name: string;
|
|
814
|
-
schema: SchemaObject$1;
|
|
815
|
-
operation?: Operation$1;
|
|
816
|
-
/**
|
|
817
|
-
* OperationName in PascalCase, only being used in OperationGenerator
|
|
818
|
-
*/
|
|
819
|
-
operationName: string;
|
|
820
|
-
description?: string;
|
|
821
|
-
statusCode?: number;
|
|
822
|
-
keys?: string[];
|
|
823
|
-
keysToOmit?: string[];
|
|
824
|
-
withData?: boolean;
|
|
825
|
-
};
|
|
826
|
-
type OperationSchemas = {
|
|
827
|
-
pathParams?: OperationSchema & {
|
|
828
|
-
keysToOmit?: never;
|
|
829
|
-
};
|
|
830
|
-
queryParams?: OperationSchema & {
|
|
831
|
-
keysToOmit?: never;
|
|
832
|
-
};
|
|
833
|
-
headerParams?: OperationSchema & {
|
|
834
|
-
keysToOmit?: never;
|
|
835
|
-
};
|
|
836
|
-
request?: OperationSchema;
|
|
837
|
-
response: OperationSchema;
|
|
838
|
-
responses: Array<OperationSchema>;
|
|
839
|
-
statusCodes?: Array<OperationSchema>;
|
|
840
|
-
errors?: Array<OperationSchema>;
|
|
841
|
-
};
|
|
842
|
-
type ByTag = {
|
|
843
|
-
type: 'tag';
|
|
844
|
-
pattern: string | RegExp;
|
|
845
|
-
};
|
|
846
|
-
type ByOperationId = {
|
|
847
|
-
type: 'operationId';
|
|
848
|
-
pattern: string | RegExp;
|
|
849
|
-
};
|
|
850
|
-
type ByPath = {
|
|
851
|
-
type: 'path';
|
|
852
|
-
pattern: string | RegExp;
|
|
853
|
-
};
|
|
854
|
-
type ByMethod = {
|
|
855
|
-
type: 'method';
|
|
856
|
-
pattern: HttpMethod | RegExp;
|
|
857
|
-
};
|
|
858
|
-
type BySchemaName = {
|
|
859
|
-
type: 'schemaName';
|
|
860
|
-
pattern: string | RegExp;
|
|
861
|
-
};
|
|
862
|
-
type ByContentType = {
|
|
863
|
-
type: 'contentType';
|
|
864
|
-
pattern: string | RegExp;
|
|
865
|
-
};
|
|
866
|
-
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
867
|
-
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
868
|
-
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
869
|
-
options: Partial<TOptions>;
|
|
870
|
-
};
|
|
871
|
-
//#endregion
|
|
872
902
|
//#region ../plugin-oas/src/SchemaGenerator.d.ts
|
|
873
|
-
type Context
|
|
903
|
+
type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
874
904
|
fabric: Fabric;
|
|
875
905
|
oas: Oas;
|
|
876
906
|
pluginManager: PluginManager;
|
|
@@ -911,7 +941,7 @@ type SchemaProps$1 = {
|
|
|
911
941
|
name?: string;
|
|
912
942
|
parentName?: string;
|
|
913
943
|
};
|
|
914
|
-
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context
|
|
944
|
+
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
|
|
915
945
|
#private;
|
|
916
946
|
refs: Refs;
|
|
917
947
|
/**
|
|
@@ -926,15 +956,6 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
926
956
|
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
927
957
|
}
|
|
928
958
|
//#endregion
|
|
929
|
-
//#region ../plugin-oas/src/generators/createGenerator.d.ts
|
|
930
|
-
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
931
|
-
name: string;
|
|
932
|
-
type: 'core';
|
|
933
|
-
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
934
|
-
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
935
|
-
schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
936
|
-
};
|
|
937
|
-
//#endregion
|
|
938
959
|
//#region ../plugin-oas/src/generators/createReactGenerator.d.ts
|
|
939
960
|
type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
940
961
|
name: string;
|
|
@@ -969,35 +990,14 @@ type SchemaProps<TOptions extends PluginFactoryOptions> = {
|
|
|
969
990
|
};
|
|
970
991
|
type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions> | ReactGenerator<TOptions>;
|
|
971
992
|
//#endregion
|
|
972
|
-
//#region ../plugin-oas/src/
|
|
973
|
-
type
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
contentType: contentType | undefined;
|
|
980
|
-
pluginManager: PluginManager;
|
|
981
|
-
/**
|
|
982
|
-
* Current plugin
|
|
983
|
-
*/
|
|
984
|
-
plugin: Plugin<TPluginOptions>;
|
|
985
|
-
mode: KubbFile.Mode;
|
|
993
|
+
//#region ../plugin-oas/src/generators/createGenerator.d.ts
|
|
994
|
+
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
995
|
+
name: string;
|
|
996
|
+
type: 'core';
|
|
997
|
+
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
998
|
+
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
999
|
+
schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
986
1000
|
};
|
|
987
|
-
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
988
|
-
#private;
|
|
989
|
-
getSchemas(operation: Operation$1, {
|
|
990
|
-
resolveName
|
|
991
|
-
}?: {
|
|
992
|
-
resolveName?: (name: string) => string;
|
|
993
|
-
}): OperationSchemas;
|
|
994
|
-
getOperations(): Promise<Array<{
|
|
995
|
-
path: string;
|
|
996
|
-
method: HttpMethod;
|
|
997
|
-
operation: Operation$1;
|
|
998
|
-
}>>;
|
|
999
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
1000
|
-
}
|
|
1001
1001
|
//#endregion
|
|
1002
1002
|
//#region src/types.d.ts
|
|
1003
1003
|
type Options$1 = {
|
|
@@ -1110,4 +1110,4 @@ type ResolvedOptions = {
|
|
|
1110
1110
|
type PluginTs = PluginFactoryOptions<'plugin-ts', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1111
1111
|
//#endregion
|
|
1112
1112
|
export { UserPluginWithLifeCycle as a, Schema as i, PluginTs as n, OasTypes as o, ReactGenerator as r, SchemaObject$1 as s, Options$1 as t };
|
|
1113
|
-
//# sourceMappingURL=types-
|
|
1113
|
+
//# sourceMappingURL=types-Ck_bg9OD.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-ts",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.4",
|
|
4
4
|
"description": "TypeScript code generation plugin for Kubb, transforming OpenAPI schemas into TypeScript interfaces, types, and utility functions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -68,12 +68,12 @@
|
|
|
68
68
|
"@kubb/react-fabric": "0.2.19",
|
|
69
69
|
"remeda": "^2.32.0",
|
|
70
70
|
"typescript": "5.9.3",
|
|
71
|
-
"@kubb/core": "4.5.
|
|
72
|
-
"@kubb/oas": "4.5.
|
|
73
|
-
"@kubb/plugin-oas": "4.5.
|
|
71
|
+
"@kubb/core": "4.5.4",
|
|
72
|
+
"@kubb/oas": "4.5.4",
|
|
73
|
+
"@kubb/plugin-oas": "4.5.4"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@kubb/plugin-oas": "4.5.
|
|
76
|
+
"@kubb/plugin-oas": "4.5.4"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"@kubb/react-fabric": "0.2.19"
|