mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(config): ♻️ Redo config structure from scratch, simplify validation code, improve checks, add support for loading sensitive data from paths
This commit is contained in:
parent
d4afd84019
commit
54fd81f076
118 changed files with 3892 additions and 5291 deletions
|
|
@ -37,7 +37,7 @@
|
|||
"format": "uri"
|
||||
}
|
||||
},
|
||||
"required": ["name"],
|
||||
"required": ["name", "email", "url"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
|
|
@ -75,10 +75,18 @@
|
|||
"format": "uri"
|
||||
}
|
||||
},
|
||||
"required": ["type", "url"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["name", "version", "description"],
|
||||
"required": [
|
||||
"$schema",
|
||||
"name",
|
||||
"version",
|
||||
"description",
|
||||
"authors",
|
||||
"repository"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export class Plugin<ConfigSchema extends z.ZodTypeAny> {
|
|||
try {
|
||||
this.store = await this.configSchema.parseAsync(config);
|
||||
} catch (error) {
|
||||
throw fromZodError(error as ZodError).message;
|
||||
throw fromZodError(error as ZodError);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue