@meridianjs/meridian 0.1.0 → 0.1.1
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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Response } from "express";
|
|
2
|
+
/**
|
|
3
|
+
* GET /auth/setup
|
|
4
|
+
* Public endpoint — no auth required.
|
|
5
|
+
* Returns whether the app needs first-time setup (no users registered yet).
|
|
6
|
+
*/
|
|
7
|
+
export declare const GET: (req: any, res: Response) => Promise<void>;
|
|
8
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/api/auth/setup/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;GAIG;AACH,eAAO,MAAM,GAAG,GAAU,KAAK,GAAG,EAAE,KAAK,QAAQ,kBAShD,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /auth/setup
|
|
3
|
+
* Public endpoint — no auth required.
|
|
4
|
+
* Returns whether the app needs first-time setup (no users registered yet).
|
|
5
|
+
*/
|
|
6
|
+
export const GET = async (req, res) => {
|
|
7
|
+
try {
|
|
8
|
+
const userService = req.scope.resolve("userModuleService");
|
|
9
|
+
const count = await userService.countUsers();
|
|
10
|
+
res.json({ needsSetup: count === 0 });
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// userModuleService not configured — assume setup not needed
|
|
14
|
+
res.json({ needsSetup: false });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/api/auth/setup/route.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,GAAQ,EAAE,GAAa,EAAE,EAAE;IACnD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAQ,CAAA;QACjE,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,UAAU,EAAE,CAAA;QAC5C,GAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,KAAK,KAAK,CAAC,EAAE,CAAC,CAAA;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,6DAA6D;QAC7D,GAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAA;IACjC,CAAC;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED