@bobtail.software/b-ssr 1.0.8 → 1.0.9

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.
@@ -603,16 +603,17 @@ node_modules`),!r)return;let i=(0,Isr.default)({allowRelativePaths:!0}).add(r);r
603
603
  if (fn.isMultipart) throw new Error('RPC multipart no soportado en SSR.');
604
604
  await getOptionsMaps();
605
605
  const options = rpcOptionsMap.get('${f.url}');
606
- if (!options?.handler) throw new Error('Handler no encontrado para RPC: ${f.name}');
607
- const augmentedReq = Object.assign(Object.create(ssrContext.req), args);
608
- return await options.handler.call(ssrContext.req.server, augmentedReq, ssrContext.reply);
606
+ if (!options?.handler) throw new Error('Handler no encontrado para RPC: ${f.name}');
607
+ const augmentedReq = Object.assign(Object.create(ssrContext.req), args);
608
+ return await options.handler.call(ssrContext.req.server, augmentedReq, ssrContext.reply);
609
609
  `:`
610
610
  await getOptionsMaps();
611
611
  const options = renderOptionsMap.get('${f.url}');
612
612
  if (!options) throw new Error('Opciones loader no encontradas para: ${f.name}');
613
+ const augmentedReq = Object.assign(Object.create(ssrContext.req), args || {});
613
614
  let customData = {};
614
- if (options.handler) customData = (await options.handler.call(ssrContext.req.server, ssrContext.req, ssrContext.reply)) || {};
615
- if (ssrContext.reply.sent) return;
615
+ if (options.handler) customData = (await options.handler.call(ssrContext.req.server, augmentedReq, ssrContext.reply)) || {};
616
+ if (ssrContext.reply.sent) return;
616
617
  return { ...customData };
617
618
  `;return`exports.${f.name} = async (${v.join(", ")}) => {
618
619
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobtail.software/b-ssr",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Fastify + Vite SSR Plugin wrapper with RPC",
5
5
  "author": "Victor Moreno <info@bobtail.software> (https://bobtail.software)",
6
6
  "license": "GPL-3.0",