@kubb/plugin-react-query 3.0.0-alpha.0

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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +114 -0
  3. package/dist/chunk-5IL6M74X.js +1504 -0
  4. package/dist/chunk-5IL6M74X.js.map +1 -0
  5. package/dist/chunk-JFX7DCS7.cjs +1504 -0
  6. package/dist/chunk-JFX7DCS7.cjs.map +1 -0
  7. package/dist/components.cjs +15 -0
  8. package/dist/components.cjs.map +1 -0
  9. package/dist/components.d.cts +8 -0
  10. package/dist/components.d.ts +8 -0
  11. package/dist/components.js +15 -0
  12. package/dist/components.js.map +1 -0
  13. package/dist/index-yXskx3Td.d.cts +584 -0
  14. package/dist/index-yXskx3Td.d.ts +584 -0
  15. package/dist/index.cjs +223 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/dist/index.d.cts +13 -0
  18. package/dist/index.d.ts +13 -0
  19. package/dist/index.js +223 -0
  20. package/dist/index.js.map +1 -0
  21. package/package.json +97 -0
  22. package/src/OperationGenerator.tsx +86 -0
  23. package/src/__snapshots__/mutateAsQuery/updatePetWithForm.ts +64 -0
  24. package/src/__snapshots__/pathParamsTypeInline/getPetById.ts +57 -0
  25. package/src/__snapshots__/pathParamsTypeObject/getPetById.ts +63 -0
  26. package/src/__snapshots__/queryOptions/getPetById.ts +37 -0
  27. package/src/__snapshots__/queryWithoutQueryOptions/getPetById.ts +47 -0
  28. package/src/__snapshots__/upload/UploadFile.ts +67 -0
  29. package/src/__snapshots__/uploadMutation/UploadFile.ts +44 -0
  30. package/src/__snapshots__/variablesTypeMutate/deletePet.ts +21 -0
  31. package/src/components/Mutation.tsx +341 -0
  32. package/src/components/Operations.tsx +74 -0
  33. package/src/components/Query.tsx +627 -0
  34. package/src/components/QueryImports.tsx +167 -0
  35. package/src/components/QueryKey.tsx +200 -0
  36. package/src/components/QueryOptions.tsx +487 -0
  37. package/src/components/SchemaType.tsx +55 -0
  38. package/src/components/__snapshots__/gen/showPetById.ts +57 -0
  39. package/src/components/__snapshots__/gen/useCreatePets.ts +46 -0
  40. package/src/components/__snapshots__/gen/useCreatePetsMutate.ts +47 -0
  41. package/src/components/index.ts +5 -0
  42. package/src/index.ts +2 -0
  43. package/src/plugin.ts +183 -0
  44. package/src/types.ts +240 -0
  45. package/src/utils.ts +96 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Stijn Van Hulle
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ <div align="center">
2
+
3
+ <!-- <img src="assets/logo.png" alt="logo" width="200" height="auto" /> -->
4
+ <h1>@kubb/plugin-tanstack-query</h1>
5
+
6
+ <p>
7
+ Swagger integration for React-Query to generate all the different hooks based on an OpenAPI specification.
8
+ </p>
9
+ <img src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/banner.png" alt="logo" height="auto" />
10
+
11
+ [![npm version][npm-version-src]][npm-version-href]
12
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
13
+ [![Coverage][coverage-src]][coverage-href]
14
+ [![License][license-src]][license-href]
15
+
16
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
17
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
18
+ </p>
19
+
20
+ <h4>
21
+ <a href="https://codesandbox.io/s/github/kubb-labs/kubb/tree/alpha/examples/typescript" target="_blank">View Demo</a>
22
+ <span> · </span>
23
+ <a href="https://kubb.dev/" target="_blank">Documentation</a>
24
+ <span> · </span>
25
+ <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
26
+ <span> · </span>
27
+ <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
28
+ </h4>
29
+ </div>
30
+
31
+ <!-- Badges -->
32
+
33
+ [npm-version-src]: https://img.shields.io/npm/v/@kubb/plugin-tanstack-query?flat&colorA=18181B&colorB=f58517
34
+ [npm-version-href]: https://npmjs.com/package/@kubb/plugin-tanstack-query
35
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@kubb/plugin-tanstack-query?flat&colorA=18181B&colorB=f58517
36
+ [npm-downloads-href]: https://npmjs.com/package/@kubb/plugin-tanstack-query
37
+ [license-src]: https://img.shields.io/github/license/kubb-labs/kubb.svg?flat&colorA=18181B&colorB=f58517
38
+ [license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
39
+ [build-src]: https://img.shields.io/github/actions/workflow/status/kubb-labs/kubb/ci.yaml?style=flat&colorA=18181B&colorB=f58517
40
+ [build-href]: https://www.npmjs.com/package/@kubb/plugin-tanstack-query
41
+ [minified-src]: https://img.shields.io/bundlephobia/min/@kubb/plugin-tanstack-query?style=flat&colorA=18181B&colorB=f58517
42
+ [minified-href]: https://www.npmjs.com/package/@kubb/plugin-tanstack-query
43
+ [coverage-src]: https://img.shields.io/codecov/c/github/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517
44
+ [coverage-href]: https://www.npmjs.com/package/@kubb/plugin-tanstack-query
45
+
46
+ ## options query
47
+
48
+ ### v4
49
+
50
+ UseBaseQueryOptions => react-query only
51
+ UseQueryOptions => vue-query only
52
+ CreateQueryOptions => solid-query only
53
+ CreateQueryOptions => svelte-query only
54
+
55
+ ### v5
56
+
57
+ UseBaseQueryOptions => react-query only https://github.com/TanStack/query/blob/ce1305c27e7ac7988656d171d882a665a286cc6a/packages/react-query/src/types.ts#L18
58
+ QueryObserverOptions => vue-query only https://github.com/TanStack/query/blob/main/packages/vue-query/src/useQuery.ts#L24
59
+ UseQueryOptions => solid-query only
60
+
61
+ ## result query
62
+
63
+ ### v4
64
+
65
+ UseQueryResult => react-query only
66
+ UseQueryReturnType => vue-query only
67
+ CreateQueryResult => solid-query only
68
+ CreateQueryResult => svelte-query only
69
+
70
+ ### v5
71
+
72
+ UseQueryResult => react-query only
73
+ UseQueryReturnType => vue-query only
74
+
75
+ ## queryOptions() query
76
+
77
+ ### v5
78
+
79
+ queryOptions => react-query only
80
+
81
+ ```typescript
82
+ {
83
+ query: {
84
+ types: {
85
+ options: 'UseBaseQueryOptions'
86
+ result: 'UseQueryResult'
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ ## options mutation
93
+
94
+ ### v4
95
+
96
+ UseMutationOptions => react-query only
97
+ VueMutationObserverOptions => vue-query only
98
+
99
+ ### v5
100
+
101
+ UseMutationOptions => react-query only
102
+ MutationObserverOptions => vue-query only
103
+
104
+ ## result mutation
105
+
106
+ ### v4
107
+
108
+ UseMutationResult => react-query only
109
+ UseMutationReturnType => vue-query only
110
+
111
+ ### v5
112
+
113
+ UseMutationResult => react-query only
114
+ UseMutationReturnType => vue-query only