routesync 1.0.8 → 1.0.10
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/cli.js +2 -2
- package/dist/react.d.mts +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/sdk.d.mts +1 -0
- package/dist/sdk.d.ts +1 -0
- package/dist/sdk.js +1 -1
- package/dist/sdk.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -8785,10 +8785,10 @@ var NextActionGenerator = class {
|
|
|
8785
8785
|
lines.push(`import { cookies } from 'next/headers'`);
|
|
8786
8786
|
lines.push(``);
|
|
8787
8787
|
lines.push(`// Helper to auto-inject token from cookies if available`);
|
|
8788
|
-
lines.push(`async function getAuthHeaders() {`);
|
|
8788
|
+
lines.push(`async function getAuthHeaders(): Promise<Record<string, string> | undefined> {`);
|
|
8789
8789
|
lines.push(` const cookieStore = await cookies()`);
|
|
8790
8790
|
lines.push(` const token = cookieStore.get('token')?.value`);
|
|
8791
|
-
lines.push(` return token ? { Authorization: \`Bearer \${token}\` } :
|
|
8791
|
+
lines.push(` return token ? { Authorization: \`Bearer \${token}\` } : undefined`);
|
|
8792
8792
|
lines.push(`}`);
|
|
8793
8793
|
lines.push(``);
|
|
8794
8794
|
const grouped = buildGeneratedRoutes(manifest.routes);
|
package/dist/react.d.mts
CHANGED
package/dist/react.d.ts
CHANGED
package/dist/sdk.d.mts
CHANGED
package/dist/sdk.d.ts
CHANGED
package/dist/sdk.js
CHANGED
|
@@ -280,7 +280,7 @@ function defineApi(definition, config) {
|
|
|
280
280
|
);
|
|
281
281
|
const resolvedPath = PathResolver.resolve(route.path, params);
|
|
282
282
|
const method = route.method.toLowerCase();
|
|
283
|
-
const requestConfig = { params: query, headers: route.headers };
|
|
283
|
+
const requestConfig = { params: query, headers: { ...route.headers, ...options?.headers } };
|
|
284
284
|
let response;
|
|
285
285
|
if (method === "get" || method === "delete") {
|
|
286
286
|
response = await client[method](resolvedPath, requestConfig);
|
package/dist/sdk.mjs
CHANGED
|
@@ -238,7 +238,7 @@ function defineApi(definition, config) {
|
|
|
238
238
|
);
|
|
239
239
|
const resolvedPath = PathResolver.resolve(route.path, params);
|
|
240
240
|
const method = route.method.toLowerCase();
|
|
241
|
-
const requestConfig = { params: query, headers: route.headers };
|
|
241
|
+
const requestConfig = { params: query, headers: { ...route.headers, ...options?.headers } };
|
|
242
242
|
let response;
|
|
243
243
|
if (method === "get" || method === "delete") {
|
|
244
244
|
response = await client[method](resolvedPath, requestConfig);
|