@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.cjs
CHANGED
|
@@ -225,6 +225,17 @@ var Url = class Url {
|
|
|
225
225
|
return path.replace(/\{([^}]+)\}/g, ":$1");
|
|
226
226
|
}
|
|
227
227
|
/**
|
|
228
|
+
* Rewrites OpenAPI placeholder names while keeping the `{...}` braces, so the generated `url`
|
|
229
|
+
* literal aligns with the grouped `path` request option that the runtime client interpolates by
|
|
230
|
+
* key.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* Url.toCasedTemplate('/projects/{project_id}', { casing: 'camelcase' }) // '/projects/{projectId}'
|
|
234
|
+
*/
|
|
235
|
+
static toCasedTemplate(path, { casing } = {}) {
|
|
236
|
+
return path.replace(/\{([^}]+)\}/g, (_, name) => `{${transformParam(name, casing)}}`);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
228
239
|
* Converts an OpenAPI/Swagger path to a TypeScript template literal string.
|
|
229
240
|
* `prefix` is prepended inside the literal, `replacer` transforms each parameter name,
|
|
230
241
|
* and `casing` controls parameter identifier casing.
|
|
@@ -1848,7 +1859,7 @@ const pluginVueQuery = (0, _kubb_core.definePlugin)((options) => {
|
|
|
1848
1859
|
});
|
|
1849
1860
|
ctx.setResolver(resolver);
|
|
1850
1861
|
if (userMacros?.length) ctx.setMacros(userMacros);
|
|
1851
|
-
ctx.addGenerator(selectedGenerators);
|
|
1862
|
+
ctx.addGenerator(...selectedGenerators);
|
|
1852
1863
|
} }
|
|
1853
1864
|
};
|
|
1854
1865
|
});
|