@fydemy/cms 1.0.3 → 1.0.5

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/index.mjs CHANGED
@@ -1992,9 +1992,17 @@ export { handleUpload as POST };
1992
1992
  await fs2.writeFile(
1993
1993
  path3.join(apiCmsDir, "list", "[[...path]]", "route.ts"),
1994
1994
  `import { createListApiHandlers } from '@fydemy/cms';
1995
+ import { NextRequest } from 'next/server';
1995
1996
 
1996
1997
  const handlers = createListApiHandlers();
1997
- export const GET = handlers.GET;
1998
+
1999
+ export async function GET(
2000
+ request: NextRequest,
2001
+ context: { params: Promise<{ path?: string[] }> }
2002
+ ) {
2003
+ const params = await context.params;
2004
+ return handlers.GET(request, { params });
2005
+ }
1998
2006
  `,
1999
2007
  "utf-8"
2000
2008
  );
@@ -2004,11 +2012,33 @@ export const GET = handlers.GET;
2004
2012
  await fs2.writeFile(
2005
2013
  path3.join(apiCmsDir, "content", "[...path]", "route.ts"),
2006
2014
  `import { createContentApiHandlers } from '@fydemy/cms';
2015
+ import { NextRequest } from 'next/server';
2007
2016
 
2008
2017
  const handlers = createContentApiHandlers();
2009
- export const GET = handlers.GET;
2010
- export const POST = handlers.POST;
2011
- export const DELETE = handlers.DELETE;
2018
+
2019
+ export async function GET(
2020
+ request: NextRequest,
2021
+ context: { params: Promise<{ path: string[] }> }
2022
+ ) {
2023
+ const params = await context.params;
2024
+ return handlers.GET(request, { params });
2025
+ }
2026
+
2027
+ export async function POST(
2028
+ request: NextRequest,
2029
+ context: { params: Promise<{ path: string[] }> }
2030
+ ) {
2031
+ const params = await context.params;
2032
+ return handlers.POST(request, { params });
2033
+ }
2034
+
2035
+ export async function DELETE(
2036
+ request: NextRequest,
2037
+ context: { params: Promise<{ path: string[] }> }
2038
+ ) {
2039
+ const params = await context.params;
2040
+ return handlers.DELETE(request, { params });
2041
+ }
2012
2042
  `,
2013
2043
  "utf-8"
2014
2044
  );
@@ -2043,6 +2073,7 @@ export function middleware(request: NextRequest) {
2043
2073
 
2044
2074
  export const config = {
2045
2075
  matcher: ['/admin/:path*'],
2076
+ runtime: 'nodejs',
2046
2077
  };
2047
2078
  `,
2048
2079
  "utf-8"