@kubb/plugin-vue-query 5.0.0-beta.74 → 5.0.0-beta.76
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/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ import { Exclude, Group, Include, Output, OutputOptions, Override, PluginFactory
|
|
|
4
4
|
/**
|
|
5
5
|
* Validator applied to request and response bodies using schemas from `@kubb/plugin-zod`.
|
|
6
6
|
* - `false`: no validation.
|
|
7
|
-
* - `'zod'`: validates success (2xx) response
|
|
7
|
+
* - `'zod'`: validates the success (2xx) response body, and the error body when a non-2xx call does
|
|
8
|
+
* not throw (`throwOnError: false`).
|
|
8
9
|
* - `{ request?: 'zod'; response?: 'zod' }`: opt in per direction. `request` validates the request
|
|
9
|
-
* body and query parameters before the call; `response` validates the success response body
|
|
10
|
+
* body and query parameters before the call; `response` validates the success response body and,
|
|
11
|
+
* on the non-throw path, the error body.
|
|
10
12
|
*/
|
|
11
13
|
type ParserOptions = false | 'zod' | {
|
|
12
14
|
request?: 'zod';
|
package/dist/index.js
CHANGED
|
@@ -199,6 +199,17 @@ var Url = class Url {
|
|
|
199
199
|
return path.replace(/\{([^}]+)\}/g, ":$1");
|
|
200
200
|
}
|
|
201
201
|
/**
|
|
202
|
+
* Rewrites OpenAPI placeholder names while keeping the `{...}` braces, so the generated `url`
|
|
203
|
+
* literal aligns with the grouped `path` request option that the runtime client interpolates by
|
|
204
|
+
* key.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* Url.toCasedTemplate('/projects/{project_id}', { casing: 'camelcase' }) // '/projects/{projectId}'
|
|
208
|
+
*/
|
|
209
|
+
static toCasedTemplate(path, { casing } = {}) {
|
|
210
|
+
return path.replace(/\{([^}]+)\}/g, (_, name) => `{${transformParam(name, casing)}}`);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
202
213
|
* Converts an OpenAPI/Swagger path to a TypeScript template literal string.
|
|
203
214
|
* `prefix` is prepended inside the literal, `replacer` transforms each parameter name,
|
|
204
215
|
* and `casing` controls parameter identifier casing.
|
|
@@ -1822,7 +1833,7 @@ const pluginVueQuery = definePlugin((options) => {
|
|
|
1822
1833
|
});
|
|
1823
1834
|
ctx.setResolver(resolver);
|
|
1824
1835
|
if (userMacros?.length) ctx.setMacros(userMacros);
|
|
1825
|
-
ctx.addGenerator(selectedGenerators);
|
|
1836
|
+
ctx.addGenerator(...selectedGenerators);
|
|
1826
1837
|
} }
|
|
1827
1838
|
};
|
|
1828
1839
|
});
|