@kubb/plugin-zod 3.0.0-alpha.9 → 3.0.0-beta.10
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/README.md +14 -5
- package/dist/chunk-37OP7TSO.cjs +354 -0
- package/dist/chunk-37OP7TSO.cjs.map +1 -0
- package/dist/chunk-OOAUU32I.js +235 -0
- package/dist/chunk-OOAUU32I.js.map +1 -0
- package/dist/chunk-QEYWJ6VH.cjs +244 -0
- package/dist/chunk-QEYWJ6VH.cjs.map +1 -0
- package/dist/chunk-SSOO3TXR.js +347 -0
- package/dist/chunk-SSOO3TXR.js.map +1 -0
- package/dist/components.cjs +11 -10
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +20 -19
- package/dist/components.d.ts +20 -19
- package/dist/components.js +2 -14
- package/dist/components.js.map +1 -1
- package/dist/generators.cjs +17 -0
- package/dist/generators.cjs.map +1 -0
- package/dist/generators.d.cts +10 -0
- package/dist/generators.d.ts +10 -0
- package/dist/generators.js +4 -0
- package/dist/generators.js.map +1 -0
- package/dist/index.cjs +12 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -137
- package/dist/index.d.ts +4 -137
- package/dist/index.js +3 -12
- package/dist/index.js.map +1 -1
- package/dist/types-L1fXCZAs.d.cts +100 -0
- package/dist/types-L1fXCZAs.d.ts +100 -0
- package/package.json +19 -21
- package/src/components/Operations.tsx +12 -98
- package/src/components/Zod.tsx +68 -0
- package/src/components/index.ts +1 -2
- package/src/generators/__snapshots__/anyof.ts +3 -0
- package/src/generators/__snapshots__/coercion.ts +3 -0
- package/src/generators/__snapshots__/coercionDates.ts +3 -0
- package/src/generators/__snapshots__/coercionNumbers.ts +3 -0
- package/src/generators/__snapshots__/coercionStrings.ts +3 -0
- package/src/generators/__snapshots__/createPet.ts +15 -0
- package/src/generators/__snapshots__/createPetWithUnknownTypeAny.ts +13 -0
- package/src/generators/__snapshots__/createPetWithUnknownTypeUnknown.ts +15 -0
- package/src/generators/__snapshots__/deletePet.ts +3 -0
- package/src/generators/__snapshots__/discriminator.ts +3 -0
- package/src/generators/__snapshots__/enumBooleanLiteral.ts +3 -0
- package/src/generators/__snapshots__/enumNamesType.ts +3 -0
- package/src/generators/__snapshots__/enumNullable.ts +3 -0
- package/src/generators/__snapshots__/enumSingleLiteral.ts +3 -0
- package/src/generators/__snapshots__/enumVarNamesType.ts +3 -0
- package/src/generators/__snapshots__/example.ts +3 -0
- package/src/generators/__snapshots__/getPets.ts +15 -0
- package/src/generators/__snapshots__/mixedValueTypeConst.ts +6 -0
- package/src/generators/__snapshots__/nullableString.ts +3 -0
- package/src/generators/__snapshots__/nullableStringUuid.ts +3 -0
- package/src/generators/__snapshots__/nullableStringWithAnyOf.ts +3 -0
- package/src/generators/__snapshots__/numberValueConst.ts +6 -0
- package/src/generators/__snapshots__/oneof.ts +3 -0
- package/src/generators/__snapshots__/operations.ts +43 -0
- package/src/generators/__snapshots__/optionalPetInfer.ts +5 -0
- package/src/generators/__snapshots__/optionalPetTyped.ts +3 -0
- package/src/generators/__snapshots__/order.ts +3 -0
- package/src/generators/__snapshots__/orderDateTyeString.ts +10 -0
- package/src/generators/__snapshots__/orderDateTypeFalse.ts +3 -0
- package/src/generators/__snapshots__/orderDateTypeString.ts +3 -0
- package/src/generators/__snapshots__/pet.ts +3 -0
- package/src/generators/__snapshots__/petArray.ts +6 -0
- package/src/generators/__snapshots__/petCoercion.ts +3 -0
- package/src/generators/__snapshots__/petTupleObject.ts +6 -0
- package/src/generators/__snapshots__/petWithMapper.ts +3 -0
- package/src/generators/__snapshots__/pets.ts +3 -0
- package/src/generators/__snapshots__/recursive.ts +3 -0
- package/src/generators/__snapshots__/showPetById.ts +15 -0
- package/src/generators/__snapshots__/stringValueConst.ts +6 -0
- package/src/generators/__snapshots__/uuidSchema.ts +3 -0
- package/src/generators/index.ts +2 -0
- package/src/generators/operationsGenerator.tsx +39 -0
- package/src/generators/zodGenerator.tsx +121 -0
- package/src/parser/index.ts +59 -31
- package/src/plugin.ts +30 -39
- package/src/types.ts +50 -89
- package/dist/Operations-BG26e_MW.d.cts +0 -47
- package/dist/Operations-BG26e_MW.d.ts +0 -47
- package/dist/chunk-57AHBVYK.cjs +0 -3502
- package/dist/chunk-57AHBVYK.cjs.map +0 -1
- package/dist/chunk-CUPQVLRZ.js +0 -3502
- package/dist/chunk-CUPQVLRZ.js.map +0 -1
- package/src/SchemaGenerator.tsx +0 -22
- package/src/components/OperationSchema.tsx +0 -60
- package/src/components/Schema.tsx +0 -166
- package/src/components/__snapshots__/operations.ts +0 -53
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Operation } from '@kubb/oas';
|
|
2
|
-
import { KubbNode } from '@kubb/react/types';
|
|
3
|
-
import { ComponentType, ComponentProps } from 'react';
|
|
4
|
-
|
|
5
|
-
type TemplateProps = {
|
|
6
|
-
/**
|
|
7
|
-
* Name of the function
|
|
8
|
-
*/
|
|
9
|
-
operationsName: string;
|
|
10
|
-
/**
|
|
11
|
-
* Name of the function
|
|
12
|
-
*/
|
|
13
|
-
pathsName: string;
|
|
14
|
-
operations: Operation[];
|
|
15
|
-
};
|
|
16
|
-
declare function Template({ operationsName, pathsName, operations }: TemplateProps): KubbNode;
|
|
17
|
-
type RootTemplateProps = {
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
};
|
|
20
|
-
declare function RootTemplate({ children }: RootTemplateProps): JSX.Element;
|
|
21
|
-
declare const defaultTemplates: {
|
|
22
|
-
readonly default: typeof Template;
|
|
23
|
-
readonly root: typeof RootTemplate;
|
|
24
|
-
};
|
|
25
|
-
type Templates = Partial<typeof defaultTemplates>;
|
|
26
|
-
type Props = {
|
|
27
|
-
/**
|
|
28
|
-
* This will make it possible to override the default behaviour.
|
|
29
|
-
*/
|
|
30
|
-
Template?: ComponentType<ComponentProps<typeof Template>>;
|
|
31
|
-
};
|
|
32
|
-
declare function Operations({ Template }: Props): KubbNode;
|
|
33
|
-
declare namespace Operations {
|
|
34
|
-
var File: (props: FileProps) => KubbNode;
|
|
35
|
-
var templates: {
|
|
36
|
-
readonly default: typeof Template;
|
|
37
|
-
readonly root: typeof RootTemplate;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
type FileProps = {
|
|
41
|
-
/**
|
|
42
|
-
* This will make it possible to override the default behaviour.
|
|
43
|
-
*/
|
|
44
|
-
templates?: Templates;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export { Operations as O };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Operation } from '@kubb/oas';
|
|
2
|
-
import { KubbNode } from '@kubb/react/types';
|
|
3
|
-
import { ComponentType, ComponentProps } from 'react';
|
|
4
|
-
|
|
5
|
-
type TemplateProps = {
|
|
6
|
-
/**
|
|
7
|
-
* Name of the function
|
|
8
|
-
*/
|
|
9
|
-
operationsName: string;
|
|
10
|
-
/**
|
|
11
|
-
* Name of the function
|
|
12
|
-
*/
|
|
13
|
-
pathsName: string;
|
|
14
|
-
operations: Operation[];
|
|
15
|
-
};
|
|
16
|
-
declare function Template({ operationsName, pathsName, operations }: TemplateProps): KubbNode;
|
|
17
|
-
type RootTemplateProps = {
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
};
|
|
20
|
-
declare function RootTemplate({ children }: RootTemplateProps): JSX.Element;
|
|
21
|
-
declare const defaultTemplates: {
|
|
22
|
-
readonly default: typeof Template;
|
|
23
|
-
readonly root: typeof RootTemplate;
|
|
24
|
-
};
|
|
25
|
-
type Templates = Partial<typeof defaultTemplates>;
|
|
26
|
-
type Props = {
|
|
27
|
-
/**
|
|
28
|
-
* This will make it possible to override the default behaviour.
|
|
29
|
-
*/
|
|
30
|
-
Template?: ComponentType<ComponentProps<typeof Template>>;
|
|
31
|
-
};
|
|
32
|
-
declare function Operations({ Template }: Props): KubbNode;
|
|
33
|
-
declare namespace Operations {
|
|
34
|
-
var File: (props: FileProps) => KubbNode;
|
|
35
|
-
var templates: {
|
|
36
|
-
readonly default: typeof Template;
|
|
37
|
-
readonly root: typeof RootTemplate;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
type FileProps = {
|
|
41
|
-
/**
|
|
42
|
-
* This will make it possible to override the default behaviour.
|
|
43
|
-
*/
|
|
44
|
-
templates?: Templates;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export { Operations as O };
|