@chimerai/cli 1.2.6 → 1.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AA26ED,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,iBAyHtE"}
|
package/dist/commands/add.js
CHANGED
|
@@ -1186,6 +1186,10 @@ function stripAuthFromRoute(content) {
|
|
|
1186
1186
|
.replace(/^ import \{ getServerSession \} from 'next-auth';\n/m, '')
|
|
1187
1187
|
.replace(/^ import \{ authOptions \} from '@\/lib\/auth';\n/m, '')
|
|
1188
1188
|
.replace(/\n const session = await getServerSession\(authOptions\);\n if \(!session\?\.user\?\.id\) \{\n return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n \}\n/g, '\n')
|
|
1189
|
+
.replace(/\n const session = await getServerSession\(authOptions\);\n if \(!session\?\.user\) \{\n return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n \}\n/g, '\n')
|
|
1190
|
+
.replace(/^ const session = await getServerSession\(authOptions\);\n/m, '')
|
|
1191
|
+
.replace(/^ if \(!session\?\.user\?\.id\) \{\n return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n \}\n/m, '')
|
|
1192
|
+
.replace(/^ if \(!session\?\.user\) \{\n return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n \}\n/m, '')
|
|
1189
1193
|
.replace(/,?\n\s*user_id: session\.user\.id,?/g, '');
|
|
1190
1194
|
}
|
|
1191
1195
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0EH,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAmED,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,iBAyI9E"}
|
package/dist/commands/create.js
CHANGED
|
@@ -65,9 +65,14 @@ function stripAuthFromGeneratedCode(code) {
|
|
|
65
65
|
code = code.replace(/\n {4}const session = await getServerSession\(authOptions\);\n {4}if \(!session\?\.user\) \{\n {6}return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n {4}\}\n/g, '\n');
|
|
66
66
|
// Remove inline session check blocks — 2-space indentation (models/prompts routes)
|
|
67
67
|
code = code.replace(/\n {2}const session = await getServerSession\(authOptions\);\n {2}if \(!session\?\.user\) \{\n {4}return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n {2}\}\n/g, '\n');
|
|
68
|
+
// Remove inline session check blocks — 2-space indentation with ?.user?.id (RAG routes)
|
|
69
|
+
code = code.replace(/\n {2}const session = await getServerSession\(authOptions\);\n {2}if \(!session\?\.user\?\.id\) \{\n {4}return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n {2}\}\n/g, '\n');
|
|
70
|
+
// Remove inline session check blocks — 4-space indentation with ?.user?.id
|
|
71
|
+
code = code.replace(/\n {4}const session = await getServerSession\(authOptions\);\n {4}if \(!session\?\.user\?\.id\) \{\n {6}return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n {4}\}\n/g, '\n');
|
|
68
72
|
// Also catch orphaned getServerSession calls (import already removed but call remains)
|
|
69
73
|
code = code.replace(/^ {2}const session = await getServerSession\(authOptions\);\n/m, '');
|
|
70
74
|
code = code.replace(/^ {2}if \(!session\?\.user\) \{\n {4}return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n {2}\}\n/m, '');
|
|
75
|
+
code = code.replace(/^ {2}if \(!session\?\.user\?\.id\) \{\n {4}return NextResponse\.json\(\{ error: 'Unauthorized' \}, \{ status: 401 \}\);\n {2}\}\n/m, '');
|
|
71
76
|
// Replace session.user.id with local-dev fallback
|
|
72
77
|
code = code.replace(/session\.user\.id/g, "'local-dev'");
|
|
73
78
|
code = code.replace(/session\?\.user\?\.id/g, "'local-dev'");
|
package/package.json
CHANGED