@kubb/plugin-react-query 3.0.0-alpha.1 → 3.0.0-alpha.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/dist/{chunk-JFX7DCS7.cjs → chunk-7ZODZVKP.cjs} +116 -150
- package/dist/chunk-7ZODZVKP.cjs.map +1 -0
- package/dist/{chunk-5IL6M74X.js → chunk-ZYTZV43V.js} +168 -202
- package/dist/chunk-ZYTZV43V.js.map +1 -0
- package/dist/components.cjs +2 -4
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +1 -2
- package/dist/components.d.ts +1 -2
- package/dist/components.js +1 -3
- package/dist/{index-C9fwRDH7.d.cts → index-5kpkk-7M.d.cts} +7 -41
- package/dist/{index-C9fwRDH7.d.ts → index-5kpkk-7M.d.ts} +7 -41
- package/dist/index.cjs +28 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +17 -53
- package/dist/index.js.map +1 -1
- package/package.json +15 -15
- package/src/OperationGenerator.tsx +0 -29
- package/src/__snapshots__/mutateAsQuery/updatePetWithForm.ts +14 -9
- package/src/__snapshots__/pathParamsTypeInline/getPetById.ts +14 -9
- package/src/__snapshots__/pathParamsTypeObject/getPetById.ts +14 -9
- package/src/__snapshots__/queryOptions/getPetById.ts +9 -5
- package/src/__snapshots__/queryWithoutQueryOptions/getPetById.ts +11 -7
- package/src/__snapshots__/variablesTypeMutate/deletePet.ts +6 -3
- package/src/components/Mutation.tsx +30 -30
- package/src/components/Query.tsx +74 -78
- package/src/components/QueryKey.tsx +13 -9
- package/src/components/QueryOptions.tsx +21 -13
- package/src/components/SchemaType.tsx +9 -5
- package/src/components/__snapshots__/gen/showPetById.ts +58 -48
- package/src/components/__snapshots__/gen/useCreatePets.ts +36 -36
- package/src/components/__snapshots__/gen/useCreatePetsMutate.ts +36 -37
- package/src/components/index.ts +0 -1
- package/src/plugin.ts +16 -34
- package/src/types.ts +0 -3
- package/dist/chunk-5IL6M74X.js.map +0 -1
- package/dist/chunk-JFX7DCS7.cjs.map +0 -1
- package/src/__snapshots__/upload/UploadFile.ts +0 -67
- package/src/__snapshots__/uploadMutation/UploadFile.ts +0 -44
- package/src/components/Operations.tsx +0 -74
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Parser, File, useApp } from '@kubb/react'
|
|
2
|
-
|
|
3
|
-
import type { KubbNode } from '@kubb/react'
|
|
4
|
-
import type { ComponentProps, ComponentType } from 'react'
|
|
5
|
-
import type { FileMeta, PluginReactQuery } from '../types.ts'
|
|
6
|
-
|
|
7
|
-
type TemplateProps = {}
|
|
8
|
-
|
|
9
|
-
function Template({}: TemplateProps): KubbNode {
|
|
10
|
-
return null
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type RootTemplateProps = {
|
|
14
|
-
children?: React.ReactNode
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function RootTemplate({ children }: RootTemplateProps) {
|
|
18
|
-
const {
|
|
19
|
-
pluginManager,
|
|
20
|
-
plugin: { key: pluginKey },
|
|
21
|
-
} = useApp<PluginReactQuery>()
|
|
22
|
-
|
|
23
|
-
const file = pluginManager.getFile({
|
|
24
|
-
name: 'operations',
|
|
25
|
-
mode: 'split',
|
|
26
|
-
extName: '.ts',
|
|
27
|
-
pluginKey,
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<Parser language="typescript">
|
|
32
|
-
<File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>
|
|
33
|
-
<File.Source>{children}</File.Source>
|
|
34
|
-
</File>
|
|
35
|
-
</Parser>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const defaultTemplates = { default: Template, root: RootTemplate } as const
|
|
40
|
-
|
|
41
|
-
type Templates = Partial<typeof defaultTemplates>
|
|
42
|
-
|
|
43
|
-
type Props = {
|
|
44
|
-
/**
|
|
45
|
-
* This will make it possible to override the default behaviour.
|
|
46
|
-
*/
|
|
47
|
-
Template?: ComponentType<ComponentProps<typeof Template>>
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function Operations({ Template = defaultTemplates.default }: Props): KubbNode {
|
|
51
|
-
return <Template />
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
type FileProps = {
|
|
55
|
-
/**
|
|
56
|
-
* This will make it possible to override the default behaviour.
|
|
57
|
-
*/
|
|
58
|
-
templates?: Templates
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
Operations.File = function (props: FileProps): KubbNode {
|
|
62
|
-
const templates = { ...defaultTemplates, ...props.templates }
|
|
63
|
-
|
|
64
|
-
const Template = templates.default
|
|
65
|
-
const RootTemplate = templates.root
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<RootTemplate>
|
|
69
|
-
<Operations Template={Template} />
|
|
70
|
-
</RootTemplate>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
Operations.templates = defaultTemplates
|