routesync 1.0.6 → 1.0.7

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.
Files changed (2) hide show
  1. package/dist/cli.js +7 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -8831,12 +8831,16 @@ var MswGenerator = class {
8831
8831
  const mswMethod = route.method.toLowerCase();
8832
8832
  const mswPath = manifest.baseURL + route.path.replace(/\{([^}]+)\}/g, ":$1");
8833
8833
  const actionName = toMethodName(route);
8834
- lines.push(" http." + mswMethod + "('" + mswPath + "', async ({ request: _request, params: _params }) => {");
8834
+ lines.push(" http." + mswMethod + "('" + mswPath + "', async ({ request, params }) => {");
8835
8835
  lines.push(` await delay(300) // Simulated network latency`);
8836
+ lines.push(` const url = new URL(request.url)`);
8836
8837
  lines.push(` return HttpResponse.json({`);
8837
8838
  lines.push(` success: true,`);
8838
- lines.push(` message: 'Mocked response for ${actionName}',`);
8839
- lines.push(` data: {} // TODO: Add mock data based on your schema`);
8839
+ lines.push(` message: 'Mocked response for ${actionName} at ' + url.pathname,`);
8840
+ lines.push(` data: {`);
8841
+ lines.push(` params,`);
8842
+ lines.push(` // TODO: Add mock data based on your schema`);
8843
+ lines.push(` }`);
8840
8844
  lines.push(` })`);
8841
8845
  lines.push(` }),`);
8842
8846
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "routesync",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Laravel routes to typed frontend SDKs.",
5
5
  "main": "./dist/sdk.js",
6
6
  "module": "./dist/sdk.mjs",