hazo_auth 5.1.7 → 5.1.9
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/cli-src/cli/init.ts +4 -3
- package/cli-src/cli/validate.ts +9 -9
- package/cli-src/lib/config/config_loader.server.ts +1 -1
- package/cli-src/lib/services/invitation_service.ts +2 -2
- package/config/hazo_auth_config.ini +768 -0
- package/config/hazo_logs_config.ini +32 -0
- package/config/hazo_notify_config.ini +158 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +4 -3
- package/dist/cli/validate.js +7 -7
- package/dist/lib/config/config_loader.server.js +1 -1
- package/dist/lib/services/invitation_service.js +2 -2
- package/dist/server/routes/app_user_data_schema.d.ts +33 -0
- package/dist/server/routes/app_user_data_schema.d.ts.map +1 -0
- package/dist/server/routes/app_user_data_schema.js +72 -0
- package/dist/server/routes/index.d.ts +1 -0
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +1 -0
- package/package.json +2 -3
- /package/{hazo_auth_config.example.ini → config/hazo_auth_config.example.ini} +0 -0
- /package/{hazo_notify_config.example.ini → config/hazo_notify_config.example.ini} +0 -0
package/cli-src/cli/init.ts
CHANGED
|
@@ -23,11 +23,12 @@ const REQUIRED_DIRECTORIES = [
|
|
|
23
23
|
"public/profile_pictures/library",
|
|
24
24
|
"public/profile_pictures/uploads",
|
|
25
25
|
"data",
|
|
26
|
+
"config",
|
|
26
27
|
];
|
|
27
28
|
|
|
28
29
|
const CONFIG_FILES = [
|
|
29
|
-
{ source: "hazo_auth_config.example.ini", target: "hazo_auth_config.ini" },
|
|
30
|
-
{ source: "hazo_notify_config.example.ini", target: "hazo_notify_config.ini" },
|
|
30
|
+
{ source: "config/hazo_auth_config.example.ini", target: "config/hazo_auth_config.ini" },
|
|
31
|
+
{ source: "config/hazo_notify_config.example.ini", target: "config/hazo_notify_config.ini" },
|
|
31
32
|
];
|
|
32
33
|
|
|
33
34
|
// section: helpers
|
|
@@ -246,7 +247,7 @@ export function handle_init(): void {
|
|
|
246
247
|
|
|
247
248
|
console.log("\n\x1b[32m🦊 Initialization complete!\x1b[0m");
|
|
248
249
|
console.log("\nNext steps:");
|
|
249
|
-
console.log(" 1. Edit \x1b[
|
|
250
|
+
console.log(" 1. Edit \x1b[36mconfig/hazo_auth_config.ini\x1b[0m with your settings");
|
|
250
251
|
console.log(" 2. Copy \x1b[36m.env.local.example\x1b[0m to \x1b[36m.env.local\x1b[0m and add your API keys");
|
|
251
252
|
console.log(" 3. Run \x1b[36mnpx hazo_auth generate-routes --pages\x1b[0m to generate routes and pages");
|
|
252
253
|
console.log(" 4. Run \x1b[36mnpx hazo_auth validate\x1b[0m to check your setup");
|
package/cli-src/cli/validate.ts
CHANGED
|
@@ -22,8 +22,8 @@ export type ValidationSummary = {
|
|
|
22
22
|
|
|
23
23
|
// section: constants
|
|
24
24
|
const REQUIRED_CONFIG_FILES = [
|
|
25
|
-
"hazo_auth_config.ini",
|
|
26
|
-
"hazo_notify_config.ini",
|
|
25
|
+
"config/hazo_auth_config.ini",
|
|
26
|
+
"config/hazo_notify_config.ini",
|
|
27
27
|
];
|
|
28
28
|
|
|
29
29
|
const REQUIRED_ENV_VARS = [
|
|
@@ -141,7 +141,7 @@ function check_config_files(project_root: string): CheckResult[] {
|
|
|
141
141
|
results.push({
|
|
142
142
|
name: `Config file: ${config_file}`,
|
|
143
143
|
status: exists ? "pass" : "fail",
|
|
144
|
-
message: exists ? "" : `File not found. Run:
|
|
144
|
+
message: exists ? "" : `File not found. Run: npx hazo_auth init`,
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
|
|
@@ -150,8 +150,8 @@ function check_config_files(project_root: string): CheckResult[] {
|
|
|
150
150
|
|
|
151
151
|
function check_config_values(project_root: string): CheckResult[] {
|
|
152
152
|
const results: CheckResult[] = [];
|
|
153
|
-
|
|
154
|
-
const hazo_config_path = path.join(project_root, "hazo_auth_config.ini");
|
|
153
|
+
|
|
154
|
+
const hazo_config_path = path.join(project_root, "config", "hazo_auth_config.ini");
|
|
155
155
|
const hazo_config = read_ini_file(hazo_config_path);
|
|
156
156
|
|
|
157
157
|
if (hazo_config) {
|
|
@@ -224,7 +224,7 @@ function check_config_values(project_root: string): CheckResult[] {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
const notify_config_path = path.join(project_root, "hazo_notify_config.ini");
|
|
227
|
+
const notify_config_path = path.join(project_root, "config", "hazo_notify_config.ini");
|
|
228
228
|
const notify_config = read_ini_file(notify_config_path);
|
|
229
229
|
|
|
230
230
|
if (notify_config) {
|
|
@@ -414,15 +414,15 @@ function check_profile_pictures(project_root: string): CheckResult[] {
|
|
|
414
414
|
|
|
415
415
|
function check_database(project_root: string): CheckResult[] {
|
|
416
416
|
const results: CheckResult[] = [];
|
|
417
|
-
|
|
418
|
-
const hazo_config_path = path.join(project_root, "hazo_auth_config.ini");
|
|
417
|
+
|
|
418
|
+
const hazo_config_path = path.join(project_root, "config", "hazo_auth_config.ini");
|
|
419
419
|
const hazo_config = read_ini_file(hazo_config_path);
|
|
420
420
|
|
|
421
421
|
if (!hazo_config) {
|
|
422
422
|
results.push({
|
|
423
423
|
name: "Database check",
|
|
424
424
|
status: "fail",
|
|
425
|
-
message: "Could not read hazo_auth_config.ini",
|
|
425
|
+
message: "Could not read config/hazo_auth_config.ini",
|
|
426
426
|
});
|
|
427
427
|
return results;
|
|
428
428
|
}
|
|
@@ -261,7 +261,7 @@ export async function accept_invitation(
|
|
|
261
261
|
if (invitation.status !== "PENDING") {
|
|
262
262
|
return {
|
|
263
263
|
success: false,
|
|
264
|
-
error: `Invitation is ${invitation.status
|
|
264
|
+
error: `Invitation is ${invitation.status}, not PENDING`,
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
|
|
@@ -361,7 +361,7 @@ export async function revoke_invitation(
|
|
|
361
361
|
if (invitation_result.invitation.status !== "PENDING") {
|
|
362
362
|
return {
|
|
363
363
|
success: false,
|
|
364
|
-
error: `Cannot revoke invitation with status ${invitation_result.invitation.status
|
|
364
|
+
error: `Cannot revoke invitation with status ${invitation_result.invitation.status}`,
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
367
|
|