swaggie 1.0.2-test.3 → 1.0.2-test.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swaggie",
|
|
3
|
-
"version": "1.0.2-test.
|
|
3
|
+
"version": "1.0.2-test.4",
|
|
4
4
|
"description": "Generate TypeScript REST client code from an OpenAPI spec",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Piotr Dabrowski",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"@types/chai": "5.0.1",
|
|
62
62
|
"@types/js-yaml": "4.0.9",
|
|
63
63
|
"@types/mocha": "10.0.10",
|
|
64
|
-
"@types/node": "22.13.
|
|
65
|
-
"chai": "5.
|
|
64
|
+
"@types/node": "22.13.4",
|
|
65
|
+
"chai": "5.2.0",
|
|
66
66
|
"mocha": "11.1.0",
|
|
67
67
|
"openapi-types": "^12.1.3",
|
|
68
68
|
"sucrase": "3.35.0",
|
|
@@ -6,13 +6,16 @@
|
|
|
6
6
|
* @param $config (optional) Additional configuration for TanStack Query
|
|
7
7
|
* @param $httpConfig (optional) Additional configuration for xior request (actually executes the request)
|
|
8
8
|
*/
|
|
9
|
-
export function <%= it.rqOpName
|
|
9
|
+
export function <%= it.rqOpName %><TData = <%~ it.returnType %>, TError = Error>(<% it.parameters.forEach((parameter) => { %>
|
|
10
10
|
<%= parameter.name %>: <%~ parameter.type %> <%= parameter.optional ? ' | null | undefined' : '' %>,
|
|
11
11
|
<% }); %>
|
|
12
|
-
$config?:
|
|
12
|
+
$config?: Omit<
|
|
13
|
+
UseQueryOptions<<%~ it.returnType %>, TError, TData>>,
|
|
14
|
+
'queryKey' | 'queryFn'
|
|
15
|
+
>,
|
|
13
16
|
$httpConfig?: XiorRequestConfig
|
|
14
17
|
) {
|
|
15
|
-
return useQuery({
|
|
18
|
+
return useQuery<<%~ it.returnType %>, TError, TData>({
|
|
16
19
|
queryKey: ['<%= it.clientName %>', '<%= it.opKey %>', <% it.query.forEach((parameter) => { %><%= parameter.name %>, <% }); %>],
|
|
17
20
|
queryFn: () => <%= it.clientName %>Client.<%= it.name %>(<% it.parameters.forEach((parameter) => { %>
|
|
18
21
|
<%= parameter.name %>, <% }); %>$httpConfig).then(res => res.data),
|