@bridge-ai-dev/ecom-chat 1.0.7 → 1.0.8
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/bin/cli.js +10 -26
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -21,32 +21,16 @@ const log = {
|
|
|
21
21
|
step: (msg) => console.log(`${colors.bold}🚀 ${msg}${colors.reset}`)
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
//
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* before initializing the chat widget.
|
|
35
|
-
*/
|
|
36
|
-
export const GET = async (request: NextRequest) => {
|
|
37
|
-
const cookies = request.cookies;
|
|
38
|
-
|
|
39
|
-
// Retrieve the secure cookies
|
|
40
|
-
// Note: cart-context is now retrieved from the URL query params in the client component
|
|
41
|
-
const identity = cookies.get(".AspNetCore.Identity.Application")?.value;
|
|
42
|
-
|
|
43
|
-
return NextResponse.json({
|
|
44
|
-
identity: identity || null,
|
|
45
|
-
// Optional: Include the raw cookie string if your backend needs it
|
|
46
|
-
raw: request.headers.get("cookie")
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
`;
|
|
24
|
+
// Read the API route content from the template file
|
|
25
|
+
const templatePath = path.join(__dirname, '..', 'templates', 'route.ts.template');
|
|
26
|
+
let apiRouteContent;
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
apiRouteContent = fs.readFileSync(templatePath, 'utf8');
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error(`${colors.red}❌ Error reading template file: ${error.message}${colors.reset}`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
50
34
|
|
|
51
35
|
function isNextJsProject(cwd) {
|
|
52
36
|
// Check for Next.js indicators
|
package/package.json
CHANGED