@kubb/plugin-react-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 CHANGED
@@ -227,6 +227,17 @@ var Url = class Url {
227
227
  return path.replace(/\{([^}]+)\}/g, ":$1");
228
228
  }
229
229
  /**
230
+ * Rewrites OpenAPI placeholder names while keeping the `{...}` braces, so the generated `url`
231
+ * literal aligns with the grouped `path` request option that the runtime client interpolates by
232
+ * key.
233
+ *
234
+ * @example
235
+ * Url.toCasedTemplate('/projects/{project_id}', { casing: 'camelcase' }) // '/projects/{projectId}'
236
+ */
237
+ static toCasedTemplate(path, { casing } = {}) {
238
+ return path.replace(/\{([^}]+)\}/g, (_, name) => `{${transformParam(name, casing)}}`);
239
+ }
240
+ /**
230
241
  * Converts an OpenAPI/Swagger path to a TypeScript template literal string.
231
242
  * `prefix` is prepended inside the literal, `replacer` transforms each parameter name,
232
243
  * and `casing` controls parameter identifier casing.
@@ -2779,7 +2790,7 @@ const pluginReactQuery = (0, _kubb_core.definePlugin)((options) => {
2779
2790
  });
2780
2791
  ctx.setResolver(resolver);
2781
2792
  if (userMacros?.length) ctx.setMacros(userMacros);
2782
- ctx.addGenerator(selectedGenerators);
2793
+ ctx.addGenerator(...selectedGenerators);
2783
2794
  } }
2784
2795
  };
2785
2796
  });